초기 커밋.
This commit is contained in:
41
DDUtilityApp/SPECDOCUMENT/DocumentInfo.cs
Normal file
41
DDUtilityApp/SPECDOCUMENT/DocumentInfo.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.SPECDOCUMENT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class DocumentInfo
|
||||
{
|
||||
|
||||
#region [ Variables ] =================================================
|
||||
#endregion
|
||||
|
||||
#region [ Properties ] ================================================
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ DocumentInfo ] ==============================================
|
||||
#endregion
|
||||
|
||||
#region [ Public Methods ] ============================================
|
||||
#endregion
|
||||
|
||||
#region [ Methods ] ===================================================
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
92
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.Designer.cs
generated
Normal file
92
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.Designer.cs
generated
Normal file
@@ -0,0 +1,92 @@
|
||||
namespace DDUtilityApp.SPECDOCUMENT
|
||||
{
|
||||
partial class FrmSpecDocument
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pnlForm = new System.Windows.Forms.Panel();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.tree = new System.Windows.Forms.TreeView();
|
||||
this.pnlForm.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlForm
|
||||
//
|
||||
this.pnlForm.Controls.Add(this.splitContainer1);
|
||||
this.pnlForm.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlForm.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlForm.Name = "pnlForm";
|
||||
this.pnlForm.Size = new System.Drawing.Size(800, 450);
|
||||
this.pnlForm.TabIndex = 0;
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.tree);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(800, 450);
|
||||
this.splitContainer1.SplitterDistance = 266;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// tree
|
||||
//
|
||||
this.tree.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tree.Location = new System.Drawing.Point(0, 0);
|
||||
this.tree.Name = "tree";
|
||||
this.tree.Size = new System.Drawing.Size(266, 450);
|
||||
this.tree.TabIndex = 0;
|
||||
//
|
||||
// FrmSpecDocument
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.pnlForm);
|
||||
this.Name = "FrmSpecDocument";
|
||||
this.Text = "FrmSpecDocument";
|
||||
this.pnlForm.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pnlForm;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TreeView tree;
|
||||
}
|
||||
}
|
||||
98
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.cs
Normal file
98
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using JWH.NETWORK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DDUtilityApp.SPECDOCUMENT
|
||||
{
|
||||
|
||||
public partial class FrmSpecDocument : Form
|
||||
{
|
||||
|
||||
#region [ Variables ] =================================================
|
||||
|
||||
private SpecDocument SpecDocument { get; set; } = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ Properties ] ================================================
|
||||
#endregion
|
||||
|
||||
#region [ FrmSpecDocument ] ===========================================
|
||||
|
||||
public FrmSpecDocument()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.SetLayout();
|
||||
this.SetEventHandler();
|
||||
this.SpecDocument = new SpecDocument("ftp://127.0.0.1:2100", "", "");
|
||||
//this.SpecDocument = new SpecDocument("ftp://192.168.8.217", "", "");
|
||||
//192.168.8.217
|
||||
}
|
||||
|
||||
private void SetLayout()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetEventHandler()
|
||||
{
|
||||
this.Load += this.FrmSpecDocument_Load;
|
||||
this.FormClosed += this.FrmSpecDocument_FormClosed;
|
||||
|
||||
this.tree.AfterExpand += this.Tree_AfterExpand;
|
||||
}
|
||||
|
||||
private string TreeNodeLastFullPath { get; set; } = string.Empty;
|
||||
|
||||
private void Tree_AfterExpand(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
FtpDirectory ftpDirectory = e.Node.Tag as FtpDirectory;
|
||||
if (ftpDirectory == null) return;
|
||||
if (string.Compare(this.TreeNodeLastFullPath, e.Node.FullPath) == 0) return;
|
||||
|
||||
int index = e.Node.Index;
|
||||
this.TreeNodeLastFullPath = e.Node.FullPath;
|
||||
TreeNode parent = e.Node.Parent;
|
||||
|
||||
FtpClient ftpClient = this.SpecDocument.GetFtpClient();
|
||||
ftpDirectory.GetChilds(ftpClient, 1);
|
||||
TreeNode newNode = ftpDirectory.GetTreeNode();
|
||||
newNode.Expand();
|
||||
|
||||
this.tree.SuspendLayout();
|
||||
parent.Nodes.Insert(index, newNode);
|
||||
e.Node.Remove();
|
||||
this.tree.ResumeLayout();
|
||||
}
|
||||
|
||||
private void FrmSpecDocument_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.SpecDocument.ReBuild(1);
|
||||
TreeNode node = this.SpecDocument.GetTreeNode();
|
||||
this.tree.Nodes.Add(node);
|
||||
}
|
||||
|
||||
private void FrmSpecDocument_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ Events ] ====================================================
|
||||
#endregion
|
||||
|
||||
#region [ Methods ] ===================================================
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
120
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.resx
Normal file
120
DDUtilityApp/SPECDOCUMENT/FrmSpecDocument.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
128
DDUtilityApp/SPECDOCUMENT/SpecDocument.cs
Normal file
128
DDUtilityApp/SPECDOCUMENT/SpecDocument.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using JWH;
|
||||
using JWH.NETWORK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DDUtilityApp.SPECDOCUMENT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class SpecDocument
|
||||
{
|
||||
|
||||
#region [ Variables ] =================================================
|
||||
#endregion
|
||||
|
||||
#region [ Properties ] ================================================
|
||||
|
||||
public string URI { get; set; } = string.Empty;
|
||||
|
||||
public string UID { get; set; } = string.Empty;
|
||||
|
||||
public string PWD { get; set; } = string.Empty;
|
||||
|
||||
public List<SpecInfo> SpecInfos { get; set; } = new List<SpecInfo>();
|
||||
|
||||
public List<FtpObject> Childs { get; set; } = new List<FtpObject>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ SpecDocument ] ==============================================
|
||||
|
||||
public SpecDocument()
|
||||
{
|
||||
}
|
||||
|
||||
public SpecDocument(string uri, string uid, string pwd)
|
||||
{
|
||||
this.URI = uri;
|
||||
this.UID = uid;
|
||||
this.PWD = pwd;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ Public Methods ] ============================================
|
||||
|
||||
public bool ReBuild(int depth = 0)
|
||||
{
|
||||
FtpObject[] ftpObjects = this.GetChilds(depth);
|
||||
|
||||
this.Childs.Clear();
|
||||
this.Childs.AddRange(ftpObjects);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public TreeNode GetTreeNode()
|
||||
{
|
||||
TreeNode node = new TreeNode(this.URI, 1, 0);
|
||||
foreach(FtpObject child in this.Childs)
|
||||
{
|
||||
node.Nodes.Add(child.GetTreeNode());
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
public void Refresh(FtpObject ftpObject, int depth = 0)
|
||||
{
|
||||
}
|
||||
|
||||
public void Refresh(TreeNode node, int depth = 0)
|
||||
{
|
||||
FtpObject ftpObject = node.Tag as FtpObject;
|
||||
if (ftpObject == null) return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ Methods ] ===================================================
|
||||
|
||||
public FtpClient GetFtpClient()
|
||||
{
|
||||
try
|
||||
{
|
||||
FtpClient ftpClient = new FtpClient(this.URI, this.UID, this.PWD);
|
||||
return ftpClient;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private FtpObject[] GetChilds(int depth = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<FtpObject> lstChild = new List<FtpObject>();
|
||||
|
||||
FtpClient ftpClient = this.GetFtpClient();
|
||||
foreach(FtpObject child in ftpClient.GetFtpObjects(""))
|
||||
{
|
||||
lstChild.Add(child);
|
||||
if (child.GetType() == typeof(FtpDirectory) && depth > 0)
|
||||
{
|
||||
FtpDirectory ftpDirectory = child as FtpDirectory;
|
||||
ftpDirectory.GetChilds(ftpClient, depth - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return lstChild.ToArray();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
38
DDUtilityApp/SPECDOCUMENT/SpecInfo.cs
Normal file
38
DDUtilityApp/SPECDOCUMENT/SpecInfo.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.SPECDOCUMENT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class SpecInfo
|
||||
{
|
||||
|
||||
#region [ Variables ] =================================================
|
||||
#endregion
|
||||
|
||||
#region [ Properties ] ================================================
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public List<DocumentInfo> DocumentInfos { get; set; } = new List<DocumentInfo>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ SpecInfo ] ==================================================
|
||||
#endregion
|
||||
|
||||
#region [ Public Methods ] ============================================
|
||||
#endregion
|
||||
|
||||
#region [ Methods ] ===================================================
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user