static void Main(string[] args) { if (!Directory.Exists("UNPACK/")) { Directory.CreateDirectory("UNPACK/"); } if (!Directory.Exists("PATCH/")) { Directory.CreateDirectory("PATCH/"); } if (!Directory.Exists("IMPORT/")) { Directory.CreateDirectory("IMPORT/"); } Console.Clear(); Console.WriteLine("选择执行模式"); Console.WriteLine("\t 按1 解包"); Console.WriteLine("\t 按2 打包"); Console.WriteLine("\t 按esc 退出"); ConsoleKeyInfo info = Console.ReadKey(); switch (info.Key) { case ConsoleKey.D1: DDT ddtContainer = new DDT("./dds3.img", "./dds3.ddt"); ddtContainer.GetEntry(); ddtContainer.Extract("UNPACK"); Console.WriteLine("解包完毕"); Console.ReadLine(); break; case ConsoleKey.D2: DDT ddtContainers = new DDT("./dds3.img", "./dds3.ddt"); ddtContainers.Repack("./UNPACK/", "./PATCH/", "./IMPORT/"); Console.WriteLine("打包完毕"); Console.ReadLine(); break; case ConsoleKey.Escape: Environment.Exit(0); break; } //test(); //Console.WriteLine("alldone, have fun"); }
public void mainprocess() { if (Tools.CheckFileList(TB_Path.Text, filelist) < 0) { MessageBox.Show("导出文件不全,请检查!", "提示"); return; } Dictionary <string, DataTable> DDT; DDT = Tools.GetDatatable(TB_Path.Text, filelist); MakeNewTable.PrimaryKeyForDatatable(ref DDT); DirectoryInfo di = new DirectoryInfo(TB_Path.Text + "\\Export\\"); if (!di.Exists) { di.Create(); } //patient DataTable dt_patient = MakeNewTable.cl_patient(DDT); Tools.DataTableToCSV(dt_patient, TB_Path.Text + "\\Export\\" + "cl_patient.csv"); dt_patient.Dispose(); //sample DataTable dt_sample = MakeNewTable.cl_sample(DDT); Tools.DataTableToCSV(dt_sample, TB_Path.Text + "\\Export\\" + "cl_sample.csv"); dt_sample.Dispose(); //request DataTable dt_requested_tests = MakeNewTable.cl_requested_tests(DDT); Tools.DataTableToCSV(dt_requested_tests, TB_Path.Text + "\\Export\\" + "cl_requested_tests.csv"); dt_requested_tests.Dispose(); //result DataTable dt_result = MakeNewTable.cl_result(DDT); Tools.DataTableToCSV(dt_result, TB_Path.Text + "\\Export\\" + "cl_result.csv"); dt_result.Dispose(); //flag DataTable dt_flag = MakeNewTable.cl_flag(DDT); Tools.DataTableToCSV(dt_flag, TB_Path.Text + "\\Export\\" + "cl_flag.csv"); dt_flag.Dispose(); //test DataTable dt_test = MakeNewTable.cl_test(DDT); Tools.DataTableToCSV(dt_test, TB_Path.Text + "\\Export\\" + "cl_tests.csv"); dt_test.Dispose(); DDT.Clear(); GC.Collect(); MessageBox.Show("已完成!", "提示"); }
public void addTabPage(DDT.DDTDiagram diagram) { DiagramControl dc = new DiagramControl(); //syncronize Diagram and DiagramControl dc.diagramID = diagram.ID; dc.AllowDrop = true; dc.BackColor = getTabColor(); dc.BackgroundType = Netron.NetronLight.CanvasBackgroundTypes.FlatColor; dc.Dock = System.Windows.Forms.DockStyle.Fill; dc.EnableAddConnection = true; dc.Location = new System.Drawing.Point(3, 3); dc.Name = diagram.name; //dc.Size = new System.Drawing.Size(506, 435); dc.Size = new System.Drawing.Size(1506, 1435); dc.AutoScroll = false; dc.TabIndex = 0; dc.Text = diagram.name; //dc.OnShowSelectionProperties += new System.EventHandler<Netron.NetronLight.SelectionEventArgs>(this.diagramControl1_OnShowSelectionProperties); //dc.OnEntityAdded += new System.EventHandler<Netron.NetronLight.EntityEventArgs>(this.diagramControl1_OnEntityAdded); dc.controller.OnShowContextMenu += new System.EventHandler<System.Windows.Forms.MouseEventArgs>(this.controller_OnShowContextMenu); dc.controller.OnShowContextMenu2 += new System.EventHandler<System.Windows.Forms.MouseEventArgs>(this.controller_OnShowContextMenu2); dc.controller.OnHistoryChange+=new EventHandler<HistoryChangeEventArgs>(controller_OnHistoryChange); System.Windows.Forms.TabPage NewTab = new TabPage(); this.tabControl.Controls.Add(NewTab); NewTab.Controls.Add(dc); NewTab.Location = new System.Drawing.Point(4, 22); NewTab.Name = diagram.name; NewTab.Padding = new System.Windows.Forms.Padding(3); //NewTab.Size = new System.Drawing.Size(512, 441); NewTab.Size = new System.Drawing.Size(1512, 1441); NewTab.BorderStyle = BorderStyle.FixedSingle; NewTab.AutoScroll = false; NewTab.AutoScrollMinSize = new System.Drawing.Size(2500, 2500); NewTab.TabIndex = 0; NewTab.Text = diagram.name; NewTab.UseVisualStyleBackColor = true; //save NewTab this.tabControl.savePage(NewTab); //select NewTab this.tabControl.SelectedTab = NewTab; DDT.DDTHelper.UNSAVED(); }
//create a new tabpage, load the diagram, each Diagram is corresponding to a diagramControl public void LoadDiagram(DDT.DDTDiagram diagram) { this.addTabPage(diagram); DDTHelper.manager.LoadDiagram(this.getDiagramControl(), diagram); }
//save diagrams in 'tc' private void SaveDiagramsInTabControl(DDT.DDTTabControl tc) { DDT.DDTTabControl orignialTc = tabmgmt.TabControl; tabmgmt.TabControl = tc; tabmgmt.SaveDiagrams(); tabmgmt.TabControl = orignialTc; }
private void LoadDiagramsInTabControl(DDT.DDTTabControl tc) { tabmgmt.TabControl = tc; tabmgmt.LoadDiagrams(); if (tc.TabCount != 0) tc.Show(); }
private void ClearDiagram(DDT.DDTTabControl tc) { this.tabControl = tc; this.tabmgmt.TabControl = tc; this.tabmgmt.removeAllPages(); this.tabControl.Hide(); hideTabControlIfNoTabPage(); }
public static string getObjectTypeString(DDT.DDTObject obj) { switch (obj.type) { case DDT_Obj_Type.ADT: return "ADTObject"; case DDT_Obj_Type.COBJECT: return "CObject"; case DDT_Obj_Type.SMOBJECT: return "SMObject"; case DDT_Obj_Type.DATASTORE: return "DataStoreObject"; case DDT_Obj_Type.DATASINK: return "DataSinkObject"; case DDT_Obj_Type.TERMINATOR: return "Terminator"; case DDT_Obj_Type.CUSTOMIZED: return "CustomizedObject"; default: return ""; } }
public static Netron.NetronLight.IDDTObject DDTObjectToCanvas(DDT.DDTObject obj, System.Drawing.Point loc) { Netron.NetronLight.IDDTObject temp=null; switch (obj.type) { case DDT_Obj_Type.ADT: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.ADTObject); break; case DDT_Obj_Type.COBJECT: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.CObject); break; case DDT_Obj_Type.SMOBJECT: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.SMObject); break; case DDT_Obj_Type.DATASTORE: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.DataStoreObject); break; case DDT_Obj_Type.DATASINK: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.DataSinkObject); break; case DDT_Obj_Type.TERMINATOR: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.Terminator); break; case DDT_Obj_Type.CUSTOMIZED: temp = (Netron.NetronLight.IDDTObject)Netron.NetronLight.ShapeFactory.GetShape(ShapeTypes.CustomizedObject); break; default: break; } if (temp != null) { temp.Text = obj.name; temp.ID = obj.ID; temp.Location = loc; } // MessageBox.Show(temp.ToString()); return temp; }