Compare commits

..

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

  1. 6
      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. 68
      Vlimport/Properties/Resources.Designer.cs
  7. 30
      Vlimport/Properties/Settings.Designer.cs
  8. BIN
      Vlimport/SData.dll
  9. 32
      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.5.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
</configuration>

3
Vlimport/Form1.Designer.cs generated

@ -62,7 +62,6 @@
this.AcceptButton.TabIndex = 2;
this.AcceptButton.Text = "Добавить значения";
this.AcceptButton.UseVisualStyleBackColor = true;
this.AcceptButton.Click += new System.EventHandler(this.AcceptButton_Click);
//
// FilePathBox
//
@ -84,8 +83,6 @@
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);

12
Vlimport/Form1.cs

@ -13,21 +13,19 @@ 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;
// получаем выбранный файл
@ -39,11 +37,5 @@ namespace Vlimport
Transporter tr = new Transporter();
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>

68
Vlimport/Properties/Resources.Designer.cs generated

@ -1,61 +1,69 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
// Этот код создан программным средством.
// Версия среды выполнения: 4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
// код создан повторно.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Vlimport.Properties {
using System;
namespace Vlimport.Properties
{
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
// класс с помощью таких средств, как ResGen или Visual Studio.
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
// с параметром /str или заново постройте свой VS-проект.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 (object.ReferenceEquals(resourceMan, null)) {
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((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,24 +1,28 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
// This code was generated by a tool.
// 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>
//------------------------------------------------------------------------------
namespace Vlimport.Properties {
namespace Vlimport.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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.

32
Vlimport/Transporter.cs

@ -14,8 +14,6 @@ namespace Vlimport
{
public class Transporter
{
static List<Operations> operations = new List<Operations>(); //Объявляю список
public void CollectItems(string filePath, ListBox Itemlist)
{
@ -23,50 +21,28 @@ namespace Vlimport
xDoc.Load(filePath.ToString());
XmlElement xRoot = xDoc.DocumentElement;
XmlNodeList mySearch = xRoot.XPath2SelectNodes("//Object[ends-with(@Name,'_oper')]");
foreach (XmlNode oper in mySearch)
{
//Operations operation = new Operations();
var operId = oper.XPath2SelectSingleNode("//Attribute[@Name='indexoper']").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')]"))
{
var stepNum = step.XPath2SelectSingleNode("//Attribute[@Name='numstep']").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>
<RootNamespace>Vlimport</RootNamespace>
<AssemblyName>Vlimport</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -33,10 +32,6 @@
<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" />
@ -60,7 +55,6 @@
<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" />
@ -75,10 +69,8 @@
<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,6 +8,8 @@ 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
@ -16,6 +18,10 @@ 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