Browse Source

list

master
6 years ago
parent
commit
5230cefafd
  1. 6
      Vlimport/App.config
  2. 2
      Vlimport/Form1.Designer.cs
  3. 6
      Vlimport/Form1.cs
  4. 50
      Vlimport/Operations.cs
  5. 10
      Vlimport/Properties/DataSources/Operations.datasource
  6. 68
      Vlimport/Properties/Resources.Designer.cs
  7. 30
      Vlimport/Properties/Settings.Designer.cs
  8. BIN
      Vlimport/SData.dll
  9. 23
      Vlimport/Transporter.cs
  10. 10
      Vlimport/Vlimport.csproj
  11. 6
      xmlDeser.sln

6
Vlimport/App.config

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
</configuration>

2
Vlimport/Form1.Designer.cs generated

@ -83,6 +83,8 @@
this.Controls.Add(this.AcceptButton);
this.Controls.Add(this.SelectButton);
this.Controls.Add(this.ItemList);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "mainForm";
this.Text = "Перенос значений";
this.ResumeLayout(false);

6
Vlimport/Form1.cs

@ -13,19 +13,21 @@ namespace Vlimport
{
public partial class mainForm : Form
{
List<Operations> operations = new List<Operations>();
public mainForm()
{
InitializeComponent();
openFileDialog1.Filter = "Text files(*.xml)|*.xml|All files(*.*)|*.*";
saveFileDialog1.Filter = "Text files(*.xml)|*.xml|All files(*.*)|*.*";
}
private void SelectButton_Click(object sender, EventArgs e)
{
ItemList.Items.Clear();
//ItemList.Items.Clear();
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
return;
// получаем выбранный файл

50
Vlimport/Operations.cs

@ -0,0 +1,50 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Vlimport
{
public class Operations : IEnumerable
{
//public Operations[] operations;
ArrayList operations = new ArrayList();
IEnumerator IEnumerable.GetEnumerator()
{ return operations.GetEnumerator(); }
public Operations(string operNum, string operName)
{
OperNum = operNum;
OperName = operName;
}
public Operations()
{
}
private string operNum;
public string OperNum { get => operNum; set => operNum = value; }
private string operName;
public string OperName { get => operName; set => operName = value; }
public void Add(string OperNum, string OperName)
{
operations.Add(new Operations(operNum, operName));
}
public override string ToString()
{
return operNum + " " + operName;
}
}
}

10
Vlimport/Properties/DataSources/Operations.datasource

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Operations" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Vlimport.Operations, Vlimport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

68
Vlimport/Properties/Resources.Designer.cs generated

@ -1,69 +1,61 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программным средством.
// Версия среды выполнения: 4.0.30319.42000
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
// код создан повторно.
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Vlimport.Properties
{
namespace Vlimport.Properties {
using System;
/// <summary>
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
// класс с помощью таких средств, как ResGen или Visual Studio.
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
// с параметром /str или заново постройте свой VS-проект.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Vlimport.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Переопределяет свойство CurrentUICulture текущего потока для всех
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

30
Vlimport/Properties/Settings.Designer.cs generated

@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Vlimport.Properties
{
namespace Vlimport.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

BIN
Vlimport/SData.dll

Binary file not shown.

23
Vlimport/Transporter.cs

@ -21,28 +21,43 @@ namespace Vlimport
xDoc.Load(filePath.ToString());
XmlElement xRoot = xDoc.DocumentElement;
XmlNodeList mySearch = xRoot.XPath2SelectNodes("//Object[ends-with(@Name,'_oper')]");
foreach (XmlNode oper in mySearch)
{
List<Operations> operations = new List<Operations>(); //Объявляю список
//Operations operation = new Operations();
var operId = oper.XPath2SelectSingleNode("//Attribute[@Name='indexoper']").Attributes["Value"].Value;
var operName = oper.XPath2SelectSingleNode("//Attribute[@Name='nameoper']").Attributes["Value"].Value;
Itemlist.Items.Add($"{operId} {operName}");
//Itemlist.Items.Add($"{operId} {operName}"); // Тут мы добавляем название операций прямо в листвью
operations.Add(new Operations(operId, operName));
foreach (XmlNode step in oper.XPath2SelectNodes("//Object[ends-with(@Name,'_step')]"))
{
var stepNum = step.XPath2SelectSingleNode("//Attribute[@Name='numstep']").Attributes["Value"].Value;
var stepName = step.XPath2SelectSingleNode("//Attribute[@Name='name']").Attributes["Value"].Value;
Itemlist.Items.Add($" {stepNum}. {stepName}");
//Itemlist.Items.Add($" {stepNum}. {stepName}"); // Тут добавляем название переходов в листвью
operations.Add(new Operations(stepNum, stepName));
}
foreach (Operations op in operations)
{
Itemlist.Items.Add(op);
}
}
}
}
}

10
Vlimport/Vlimport.csproj

@ -8,9 +8,10 @@
<OutputType>WinExe</OutputType>
<RootNamespace>Vlimport</RootNamespace>
<AssemblyName>Vlimport</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -32,6 +33,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="SData">
<HintPath>.\SData.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
@ -55,6 +60,7 @@
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Operations.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Transporter.cs" />
@ -69,8 +75,10 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\DataSources\Operations.datasource" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

6
xmlDeser.sln

@ -8,8 +8,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
vertical.xml = vertical.xml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlTest", "XmlTest\XmlTest.csproj", "{E78FB257-978B-4D79-9EAE-D62CE5169E03}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vlimport", "Vlimport\Vlimport.csproj", "{95FB88A3-2BFD-49AD-B6DB-39E402A47F75}"
EndProject
Global
@ -18,10 +16,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E78FB257-978B-4D79-9EAE-D62CE5169E03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E78FB257-978B-4D79-9EAE-D62CE5169E03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E78FB257-978B-4D79-9EAE-D62CE5169E03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E78FB257-978B-4D79-9EAE-D62CE5169E03}.Release|Any CPU.Build.0 = Release|Any CPU
{95FB88A3-2BFD-49AD-B6DB-39E402A47F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95FB88A3-2BFD-49AD-B6DB-39E402A47F75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95FB88A3-2BFD-49AD-B6DB-39E402A47F75}.Release|Any CPU.ActiveCfg = Release|Any CPU

Loading…
Cancel
Save