Compare commits

..

No commits in common. 'master' and 'tolist' have entirely different histories.

  1. 4
      Vlimport/App.config
  2. 3
      Vlimport/Form1.Designer.cs
  3. 12
      Vlimport/Form1.cs
  4. 50
      Vlimport/Operations.cs
  5. 10
      Vlimport/Properties/DataSources/Operations.datasource
  6. 54
      Vlimport/Properties/Resources.Designer.cs
  7. 22
      Vlimport/Properties/Settings.Designer.cs
  8. BIN
      Vlimport/SData.dll
  9. 28
      Vlimport/Transporter.cs
  10. 10
      Vlimport/Vlimport.csproj
  11. 6
      xmlDeser.sln

4
Vlimport/App.config

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

3
Vlimport/Form1.Designer.cs generated

@ -62,7 +62,6 @@
this.AcceptButton.TabIndex = 2; this.AcceptButton.TabIndex = 2;
this.AcceptButton.Text = "Добавить значения"; this.AcceptButton.Text = "Добавить значения";
this.AcceptButton.UseVisualStyleBackColor = true; this.AcceptButton.UseVisualStyleBackColor = true;
this.AcceptButton.Click += new System.EventHandler(this.AcceptButton_Click);
// //
// FilePathBox // FilePathBox
// //
@ -84,8 +83,6 @@
this.Controls.Add(this.AcceptButton); this.Controls.Add(this.AcceptButton);
this.Controls.Add(this.SelectButton); this.Controls.Add(this.SelectButton);
this.Controls.Add(this.ItemList); this.Controls.Add(this.ItemList);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "mainForm"; this.Name = "mainForm";
this.Text = "Перенос значений"; this.Text = "Перенос значений";
this.ResumeLayout(false); this.ResumeLayout(false);

12
Vlimport/Form1.cs

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

50
Vlimport/Operations.cs

@ -1,50 +0,0 @@
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

@ -1,10 +0,0 @@
<?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>

54
Vlimport/Properties/Resources.Designer.cs generated

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

22
Vlimport/Properties/Settings.Designer.cs generated

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

BIN
Vlimport/SData.dll

Binary file not shown.

28
Vlimport/Transporter.cs

@ -14,8 +14,6 @@ namespace Vlimport
{ {
public class Transporter public class Transporter
{ {
static List<Operations> operations = new List<Operations>(); //Объявляю список
public void CollectItems(string filePath, ListBox Itemlist) public void CollectItems(string filePath, ListBox Itemlist)
{ {
@ -30,43 +28,21 @@ namespace Vlimport
foreach (XmlNode oper in mySearch) foreach (XmlNode oper in mySearch)
{ {
//Operations operation = new Operations();
var operId = oper.XPath2SelectSingleNode("//Attribute[@Name='indexoper']").Attributes["Value"].Value; var operId = oper.XPath2SelectSingleNode("//Attribute[@Name='indexoper']").Attributes["Value"].Value;
var operName = oper.XPath2SelectSingleNode("//Attribute[@Name='nameoper']").Attributes["Value"].Value; var operName = oper.XPath2SelectSingleNode("//Attribute[@Name='nameoper']").Attributes["Value"].Value;
operations.Add(new Operations(operId, operName)); Itemlist.Items.Add($"{operId} {operName}");
foreach (XmlNode step in oper.XPath2SelectNodes("//Object[ends-with(@Name,'_step')]")) foreach (XmlNode step in oper.XPath2SelectNodes("//Object[ends-with(@Name,'_step')]"))
{ {
var stepNum = step.XPath2SelectSingleNode("//Attribute[@Name='numstep']").Attributes["Value"].Value; var stepNum = step.XPath2SelectSingleNode("//Attribute[@Name='numstep']").Attributes["Value"].Value;
var stepName = step.XPath2SelectSingleNode("//Attribute[@Name='name']").Attributes["Value"].Value; var stepName = step.XPath2SelectSingleNode("//Attribute[@Name='name']").Attributes["Value"].Value;
operations.Add(new Operations(stepNum, stepName)); Itemlist.Items.Add($" {stepNum}. {stepName}");
}
} }
foreach (Operations op in operations)
{
Itemlist.Items.Add(op);
}
}
public void addItems()
{
using (TextWriter tw = new StreamWriter("SavedList.txt"))
{
foreach (Operations oop in operations)
tw.WriteLine(oop);
} }
} }
} }
} }

10
Vlimport/Vlimport.csproj

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

6
xmlDeser.sln

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

Loading…
Cancel
Save