개정판 d19ae675
dev issue #000 : wrapper 제거 및 프로젝트 통합
Change-Id: I7b4c718316c9fde2508aad74af913c20de2bd798
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
27 | 27 |
{ |
28 | 28 |
Placement _placement; |
29 | 29 |
LMADataSource dataSource; |
30 |
dynamic application; |
|
30 | 31 |
Ingr.RAD2D.Application radApp; |
31 | 32 |
SPPID_Document document; |
32 | 33 |
ETCSetting _ETCSetting; |
33 | 34 |
|
34 | 35 |
List<Tuple<string, Line, Line>> BranchLines = new List<Tuple<string, Line, Line>>(); |
35 |
public AutoModeling(SPPID_Document document, Ingr.RAD2D.Application radApp) |
|
36 |
public AutoModeling(SPPID_Document document, dynamic application, Ingr.RAD2D.Application radApp)
|
|
36 | 37 |
{ |
37 | 38 |
this.document = document; |
39 |
this.application = application; |
|
38 | 40 |
this.radApp = radApp; |
39 | 41 |
this._ETCSetting = ETCSetting.GetInstance(); |
40 | 42 |
} |
... | ... | |
74 | 76 |
_placement = new Placement(); |
75 | 77 |
dataSource = _placement.PIDDataSource; |
76 | 78 |
|
77 |
//dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
78 |
//dynamic newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName); |
|
79 |
//application.ActiveWindow.Fit(); |
|
80 |
//Thread.Sleep(100); |
|
81 |
//application.ActiveWindow.Zoom = 60; |
|
82 |
//Thread.Sleep(100); |
|
79 |
dynamic newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName); |
|
80 |
application.ActiveWindow.Fit(); |
|
81 |
Thread.Sleep(100); |
|
82 |
application.ActiveWindow.Zoom = 60; |
|
83 |
Thread.Sleep(100); |
|
83 | 84 |
|
84 | 85 |
try |
85 | 86 |
{ |
DTI_PID/SPPIDConverter/ConverterDocking.Designer.cs | ||
---|---|---|
1 |
namespace Converter.SPPID.Wrapper |
|
2 |
{ |
|
3 |
partial class ConverterDocking |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// 필수 디자이너 변수입니다. |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// 사용 중인 모든 리소스를 정리합니다. |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region 구성 요소 디자이너에서 생성한 코드 |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// 디자이너 지원에 필요한 메서드입니다. |
|
27 |
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
this.components = new System.ComponentModel.Container(); |
|
32 |
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConverterDocking)); |
|
33 |
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
|
34 |
this.btnSPPIDConverter = new DevExpress.XtraEditors.SimpleButton(); |
|
35 |
this.Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
|
36 |
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
37 |
this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
|
38 |
this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components); |
|
39 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); |
|
40 |
this.layoutControl1.SuspendLayout(); |
|
41 |
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit(); |
|
42 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); |
|
43 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit(); |
|
44 |
this.SuspendLayout(); |
|
45 |
// |
|
46 |
// layoutControl1 |
|
47 |
// |
|
48 |
this.layoutControl1.Controls.Add(this.btnSPPIDConverter); |
|
49 |
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
|
50 |
this.layoutControl1.Location = new System.Drawing.Point(0, 0); |
|
51 |
this.layoutControl1.Name = "layoutControl1"; |
|
52 |
this.layoutControl1.Root = this.Root; |
|
53 |
this.layoutControl1.Size = new System.Drawing.Size(150, 300); |
|
54 |
this.layoutControl1.TabIndex = 0; |
|
55 |
this.layoutControl1.Text = "layoutControl1"; |
|
56 |
// |
|
57 |
// btnSPPIDConverter |
|
58 |
// |
|
59 |
this.btnSPPIDConverter.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnSPPIDConverter.ImageOptions.SvgImage"))); |
|
60 |
this.btnSPPIDConverter.Location = new System.Drawing.Point(12, 12); |
|
61 |
this.btnSPPIDConverter.Name = "btnSPPIDConverter"; |
|
62 |
this.btnSPPIDConverter.Size = new System.Drawing.Size(126, 36); |
|
63 |
this.btnSPPIDConverter.StyleController = this.layoutControl1; |
|
64 |
this.btnSPPIDConverter.TabIndex = 4; |
|
65 |
this.btnSPPIDConverter.Text = "Converter"; |
|
66 |
this.btnSPPIDConverter.Click += new System.EventHandler(this.btnConverter_Click); |
|
67 |
// |
|
68 |
// Root |
|
69 |
// |
|
70 |
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; |
|
71 |
this.Root.GroupBordersVisible = false; |
|
72 |
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { |
|
73 |
this.layoutControlItem1, |
|
74 |
this.emptySpaceItem1}); |
|
75 |
this.Root.Name = "Root"; |
|
76 |
this.Root.Size = new System.Drawing.Size(150, 300); |
|
77 |
this.Root.TextVisible = false; |
|
78 |
// |
|
79 |
// layoutControlItem1 |
|
80 |
// |
|
81 |
this.layoutControlItem1.Control = this.btnSPPIDConverter; |
|
82 |
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); |
|
83 |
this.layoutControlItem1.Name = "layoutControlItem1"; |
|
84 |
this.layoutControlItem1.Size = new System.Drawing.Size(130, 40); |
|
85 |
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); |
|
86 |
this.layoutControlItem1.TextVisible = false; |
|
87 |
// |
|
88 |
// emptySpaceItem1 |
|
89 |
// |
|
90 |
this.emptySpaceItem1.AllowHotTrack = false; |
|
91 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 40); |
|
92 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
|
93 |
this.emptySpaceItem1.Size = new System.Drawing.Size(130, 240); |
|
94 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
|
95 |
// |
|
96 |
// defaultLookAndFeel |
|
97 |
// |
|
98 |
this.defaultLookAndFeel.LookAndFeel.SkinName = "Office 2019 Colorful"; |
|
99 |
// |
|
100 |
// ConverterDocking |
|
101 |
// |
|
102 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); |
|
103 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
104 |
this.Controls.Add(this.layoutControl1); |
|
105 |
this.Name = "ConverterDocking"; |
|
106 |
this.Size = new System.Drawing.Size(150, 300); |
|
107 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); |
|
108 |
this.layoutControl1.ResumeLayout(false); |
|
109 |
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit(); |
|
110 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); |
|
111 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit(); |
|
112 |
this.ResumeLayout(false); |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
#endregion |
|
117 |
|
|
118 |
private DevExpress.XtraLayout.LayoutControl layoutControl1; |
|
119 |
private DevExpress.XtraLayout.LayoutControlGroup Root; |
|
120 |
private DevExpress.XtraEditors.SimpleButton btnSPPIDConverter; |
|
121 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
|
122 |
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; |
|
123 |
private DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel; |
|
124 |
} |
|
125 |
} |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Drawing; |
|
5 |
using System.Data; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 |
using System.Windows.Forms; |
|
10 |
using System.Threading; |
|
11 |
using Microsoft.VisualBasic; |
|
12 |
using Ingr.RAD2D; |
|
13 |
using Converter.BaseModel; |
|
14 |
using Converter.SPPID.Properties; |
|
15 |
using Converter.SPPID.DB; |
|
16 |
using Converter.SPPID.Util; |
|
17 |
using Converter.SPPID.Form; |
|
18 |
using Converter.SPPID.Model; |
|
19 |
|
|
20 |
namespace Converter.SPPID.Wrapper |
|
21 |
{ |
|
22 |
public partial class ConverterDocking : UserControl |
|
23 |
{ |
|
24 |
Ingr.RAD2D.Application radApp; |
|
25 |
dynamic application; |
|
26 |
public ConverterDocking() |
|
27 |
{ |
|
28 |
InitializeComponent(); |
|
29 |
application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
30 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
31 |
radApp = wApp.RADApplication; |
|
32 |
} |
|
33 |
|
|
34 |
private void btnConverter_Click(object sender, EventArgs e) |
|
35 |
{ |
|
36 |
try |
|
37 |
{ |
|
38 |
ConverterForm converterForm = new ConverterForm(); |
|
39 |
if (converterForm.ShowDialog() == DialogResult.OK) |
|
40 |
{ |
|
41 |
|
|
42 |
} |
|
43 |
} |
|
44 |
catch (Exception ex) |
|
45 |
{ |
|
46 |
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
47 |
} |
|
48 |
} |
|
49 |
} |
|
50 |
} |
DTI_PID/SPPIDConverter/ConverterDocking.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
<assembly alias="DevExpress.Data.v18.2" name="DevExpress.Data.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
|
121 |
<data name="btnSPPIDConverter.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v18.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
122 |
<value> |
|
123 |
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE4LjIsIFZlcnNpb249MTguMi43 |
|
124 |
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl |
|
125 |
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAFgCAAAC77u/ |
|
126 |
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi |
|
127 |
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv |
|
128 |
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBlbmFibGUt |
|
129 |
YmFja2dyb3VuZD0ibmV3IDAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaWQ9IkxheWVyXzEi |
|
130 |
Pg0KICA8ZyAvPg0KICA8ZyBpZD0iQ29udmVydFRvIj4NCiAgICA8cGF0aCBkPSJNMjIsNmwtNi02djRD |
|
131 |
OS40LDQsNCw5LjQsNCwxNmMwLDMuNiwxLjYsNi44LDQuMSw5bDIuOC0yLjhjLTEuOC0xLjUtMy0zLjct |
|
132 |
My02LjJjMC00LjQsMy42LTgsOC04djRMMjIsNnoiIGZpbGw9IiMwMzlDMjMiIGNsYXNzPSJHcmVlbiIg |
|
133 |
Lz4NCiAgICA8cGF0aCBkPSJNMjMuOSw3TDIxLDkuOGMxLjgsMS41LDMsMy43LDMsNi4yYzAsNC40LTMu |
|
134 |
Niw4LTgsOHYtNGwtNiw2bDYsNnYtNGM2LjYsMCwxMi01LjQsMTItMTIgICBDMjgsMTIuNCwyNi40LDku |
|
135 |
MiwyMy45LDd6IiBmaWxsPSIjMTE3N0Q3IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPC9nPg0KPC9zdmc+Cw== |
|
136 |
</value> |
|
137 |
</data> |
|
138 |
<metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|
139 |
<value>17, 17</value> |
|
140 |
</metadata> |
|
141 |
</root> |
DTI_PID/SPPIDConverter/ConverterForm.Designer.cs | ||
---|---|---|
28 | 28 |
/// </summary> |
29 | 29 |
private void InitializeComponent() |
30 | 30 |
{ |
31 |
this.components = new System.ComponentModel.Container(); |
|
32 | 31 |
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConverterForm)); |
33 |
this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components); |
|
34 | 32 |
this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
35 | 33 |
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
36 | 34 |
this.btnRun = new DevExpress.XtraEditors.SimpleButton(); |
... | ... | |
64 | 62 |
this.simpleLabelItem3 = new DevExpress.XtraLayout.SimpleLabelItem(); |
65 | 63 |
this.simpleLabelItem4 = new DevExpress.XtraLayout.SimpleLabelItem(); |
66 | 64 |
this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem(); |
67 |
this.xtraFolderBrowserDialog = new DevExpress.XtraEditors.XtraFolderBrowserDialog(this.components); |
|
68 |
this.xtraOpenFileDialog = new DevExpress.XtraEditors.XtraOpenFileDialog(this.components); |
|
69 |
this.commandControl = new Ingr.RAD2D.MacroControls.CmdCtrl.IgCommand(); |
|
65 |
this.xtraFolderBrowserDialog = new DevExpress.XtraEditors.XtraFolderBrowserDialog(); |
|
66 |
this.xtraOpenFileDialog = new DevExpress.XtraEditors.XtraOpenFileDialog(); |
|
70 | 67 |
((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit(); |
71 | 68 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); |
72 | 69 |
this.layoutControl1.SuspendLayout(); |
... | ... | |
97 | 94 |
((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem3)).BeginInit(); |
98 | 95 |
((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem4)).BeginInit(); |
99 | 96 |
((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit(); |
100 |
((System.ComponentModel.ISupportInitialize)(this.commandControl)).BeginInit(); |
|
101 | 97 |
this.SuspendLayout(); |
102 | 98 |
// |
103 |
// defaultLookAndFeel |
|
104 |
// |
|
105 |
this.defaultLookAndFeel.LookAndFeel.SkinName = "Office 2019 Colorful"; |
|
106 |
// |
|
107 | 99 |
// ribbonControl |
108 | 100 |
// |
109 | 101 |
this.ribbonControl.ExpandCollapseItem.Id = 0; |
... | ... | |
330 | 322 |
this.labelItemMappingStatus.Size = new System.Drawing.Size(189, 18); |
331 | 323 |
this.labelItemMappingStatus.Text = "MappingStatus"; |
332 | 324 |
this.labelItemMappingStatus.TextSize = new System.Drawing.Size(93, 14); |
333 |
this.labelItemMappingStatus.DoubleClick += new System.EventHandler(this.labelItemMappingStatus_DoubleClick); |
|
334 | 325 |
// |
335 | 326 |
// simpleLabelItem5 |
336 | 327 |
// |
... | ... | |
501 | 492 |
this.xtraOpenFileDialog.Filter = "Xml Files(*.xml)|*.xml"; |
502 | 493 |
this.xtraOpenFileDialog.Multiselect = true; |
503 | 494 |
// |
504 |
// commandControl |
|
505 |
// |
|
506 |
this.commandControl.Enabled = true; |
|
507 |
this.commandControl.Location = new System.Drawing.Point(193, -1); |
|
508 |
this.commandControl.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); |
|
509 |
this.commandControl.Name = "commandControl"; |
|
510 |
this.commandControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("commandControl.OcxState"))); |
|
511 |
this.commandControl.Size = new System.Drawing.Size(28, 28); |
|
512 |
this.commandControl.TabIndex = 3; |
|
513 |
this.commandControl.Activate += new System.EventHandler(this.commandControl_Activate); |
|
514 |
this.commandControl.Deactivate += new System.EventHandler(this.commandControl_Deactivate); |
|
515 |
this.commandControl.Terminate += new System.EventHandler(this.commandControl_Terminate); |
|
516 |
this.commandControl.Initialize += new System.EventHandler(this.commandControl_Initialize); |
|
517 |
// |
|
518 | 495 |
// ConverterForm |
519 | 496 |
// |
520 | 497 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
521 | 498 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
522 | 499 |
this.ClientSize = new System.Drawing.Size(1226, 593); |
523 |
this.Controls.Add(this.commandControl); |
|
524 | 500 |
this.Controls.Add(this.layoutControl1); |
525 | 501 |
this.Controls.Add(this.ribbonControl); |
526 | 502 |
this.Name = "ConverterForm"; |
... | ... | |
528 | 504 |
this.ShowIcon = false; |
529 | 505 |
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
530 | 506 |
this.Text = "SPPID Converter"; |
531 |
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConverterForm_FormClosing); |
|
532 | 507 |
((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).EndInit(); |
533 | 508 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); |
534 | 509 |
this.layoutControl1.ResumeLayout(false); |
... | ... | |
559 | 534 |
((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem3)).EndInit(); |
560 | 535 |
((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem4)).EndInit(); |
561 | 536 |
((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit(); |
562 |
((System.ComponentModel.ISupportInitialize)(this.commandControl)).EndInit(); |
|
563 | 537 |
this.ResumeLayout(false); |
564 | 538 |
this.PerformLayout(); |
565 | 539 |
|
566 | 540 |
} |
567 | 541 |
|
568 | 542 |
#endregion |
569 |
private DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel; |
|
570 | 543 |
private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl; |
571 | 544 |
private DevExpress.XtraLayout.LayoutControl layoutControl1; |
572 | 545 |
private DevExpress.XtraEditors.SimpleButton btnSPPIDDB; |
... | ... | |
602 | 575 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7; |
603 | 576 |
private DevExpress.XtraEditors.XtraFolderBrowserDialog xtraFolderBrowserDialog; |
604 | 577 |
private DevExpress.XtraEditors.XtraOpenFileDialog xtraOpenFileDialog; |
605 |
public Ingr.RAD2D.MacroControls.CmdCtrl.IgCommand commandControl; |
|
606 | 578 |
} |
607 | 579 |
} |
DTI_PID/SPPIDConverter/ConverterForm.cs | ||
---|---|---|
8 | 8 |
using System.Threading.Tasks; |
9 | 9 |
using System.Windows.Forms; |
10 | 10 |
using Microsoft.VisualBasic; |
11 |
using Converter.BaseModel; |
|
12 | 11 |
using DevExpress.XtraEditors.Repository; |
13 | 12 |
using DevExpress.XtraEditors.Controls; |
14 | 13 |
using DevExpress.XtraEditors; |
15 | 14 |
using System.Globalization; |
16 | 15 |
using System.Threading; |
17 | 16 |
using System.IO; |
17 |
using Ingr.RAD2D; |
|
18 |
using Converter.BaseModel; |
|
18 | 19 |
using Converter.SPPID.Properties; |
19 | 20 |
using Converter.SPPID.DB; |
20 | 21 |
using Converter.SPPID.Util; |
... | ... | |
60 | 61 |
InitID2Project(); |
61 | 62 |
} |
62 | 63 |
|
63 |
#region |
|
64 |
/// <summary> |
|
65 |
/// The Activate Event is where the command should show its form |
|
66 |
/// if it should be displayed. |
|
67 |
/// </summary> |
|
68 |
/// <param name="sender">The sender of the event</param> |
|
69 |
/// <param name="e">Arguments passed during event</param> |
|
70 |
private void commandControl_Activate(object sender, EventArgs e) |
|
71 |
{ |
|
72 |
Show(); |
|
73 |
} |
|
74 |
|
|
75 |
/// <summary> |
|
76 |
/// The Deactivate event is where the command should hide its form if it |
|
77 |
/// was displayed. The command should not unload the form here. |
|
78 |
/// The command's form should be unloaded in the Class Module Terminate event. |
|
79 |
/// </summary> |
|
80 |
/// <param name="sender">The sender of the event</param> |
|
81 |
/// <param name="e">Arguments passed during event</param> |
|
82 |
private void commandControl_Deactivate(object sender, EventArgs e) |
|
83 |
{ |
|
84 |
Hide(); |
|
85 |
} |
|
86 |
|
|
87 |
/// <summary> |
|
88 |
/// The Initialize event is where the command should perform 1 time |
|
89 |
/// initialization, for example it might save a reference to the |
|
90 |
/// active document in private global data. |
|
91 |
/// </summary> |
|
92 |
/// <param name="sender">The sender of the event</param> |
|
93 |
/// <param name="e">Arguments passed during event</param> |
|
94 |
private void commandControl_Initialize(object sender, EventArgs e) |
|
95 |
{ |
|
96 |
|
|
97 |
} |
|
98 |
|
|
99 |
/// <summary> |
|
100 |
/// The Terminate event is where the command can clean up any command |
|
101 |
/// specific allocated resources. |
|
102 |
/// </summary> |
|
103 |
/// <param name="sender">The sender of the event</param> |
|
104 |
/// <param name="e">Arguments passed during event</param> |
|
105 |
public void commandControl_Terminate(object sender, EventArgs e) |
|
106 |
{ |
|
107 |
|
|
108 |
} |
|
109 |
|
|
110 |
/// <summary> |
|
111 |
/// The primary form should not simply be unloaded. You should set the |
|
112 |
/// Intergraph Command Control Done property to True when you want the |
|
113 |
/// form to be unloaded. Then unload the form in the dispose method. |
|
114 |
/// </summary> |
|
115 |
/// <param name="sender">The sender of the event</param> |
|
116 |
/// <param name="e">Arguments passed during event</param> |
|
117 |
private void ConverterForm_FormClosing(object sender, FormClosingEventArgs e) |
|
118 |
{ |
|
119 |
Hide(); |
|
120 |
commandControl.Done = true; |
|
121 |
e.Cancel = true; //Do not let C# close out the form ... Let RAD close it. |
|
122 |
} |
|
123 |
#endregion |
|
124 |
|
|
125 | 64 |
private void InitUsedDataTable() |
126 | 65 |
{ |
127 | 66 |
// Converter Table |
... | ... | |
524 | 463 |
private void btnRun_Click(object sender, EventArgs e) |
525 | 464 |
{ |
526 | 465 |
_Documents.Clear(); |
527 |
|
|
528 | 466 |
foreach (int rowHandle in gridViewConverter.GetSelectedRows()) |
529 | 467 |
{ |
530 | 468 |
string _FilePath = gridViewConverter.GetRowCellDisplayText(rowHandle, "colDrawingFilePath"); |
... | ... | |
550 | 488 |
_Documents.Add(document); |
551 | 489 |
} |
552 | 490 |
|
553 |
foreach (var document in _Documents) |
|
554 |
{ |
|
555 |
if (document.SetSPPIDMapping() && document.Enable) |
|
556 |
{ |
|
557 |
AutoModeling modeling = new AutoModeling(document, commandControl.Application.RADApplication); |
|
558 |
modeling.Run(); |
|
559 |
break; |
|
560 |
} |
|
561 |
} |
|
562 |
|
|
563 |
Close(); |
|
491 |
DialogResult = DialogResult.OK; |
|
564 | 492 |
} |
565 | 493 |
|
566 | 494 |
private void btnSPPIDDB_Click(object sender, EventArgs e) |
... | ... | |
620 | 548 |
|
621 | 549 |
prevSelectedList = gridViewConverter.GetSelectedRows().ToList(); |
622 | 550 |
} |
623 |
|
|
624 |
private void labelItemMappingStatus_DoubleClick(object sender, EventArgs e) |
|
625 |
{ |
|
626 |
AutoModeling modeling = new AutoModeling(new SPPID_Document(""), commandControl.Application.RADApplication); |
|
627 |
modeling.Test(); |
|
628 |
} |
|
629 | 551 |
} |
630 | 552 |
} |
DTI_PID/SPPIDConverter/ConverterForm.resx | ||
---|---|---|
117 | 117 |
<resheader name="writer"> |
118 | 118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
119 | 119 |
</resheader> |
120 |
<metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|
121 |
<value>17, 17</value> |
|
122 |
</metadata> |
|
123 | 120 |
<assembly alias="DevExpress.Data.v18.2" name="DevExpress.Data.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
124 | 121 |
<data name="btnRun.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v18.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
125 | 122 |
<value> |
... | ... | |
276 | 273 |
<value>179, 17</value> |
277 | 274 |
</metadata> |
278 | 275 |
<metadata name="xtraOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
279 |
<value>367, 17</value>
|
|
276 |
<value>28, 18</value>
|
|
280 | 277 |
</metadata> |
281 |
<data name="commandControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
282 |
<value> |
|
283 |
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w |
|
284 |
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 |
|
285 |
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAJwAAAAIB |
|
286 |
AAAAAQAAAAAAAAAAAAAAABIAAAAFAAIAUQIAAFECAAAAAAAAAQEL |
|
287 |
</value> |
|
288 |
</data> |
|
289 | 278 |
</root> |
DTI_PID/SPPIDConverter/Properties/Resources.Designer.cs | ||
---|---|---|
89 | 89 |
return ((System.Drawing.Bitmap)(obj)); |
90 | 90 |
} |
91 | 91 |
} |
92 |
|
|
93 |
/// <summary> |
|
94 |
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다. |
|
95 |
/// </summary> |
|
96 |
internal static System.Drawing.Bitmap ToolbarImage { |
|
97 |
get { |
|
98 |
object obj = ResourceManager.GetObject("ToolbarImage", resourceCulture); |
|
99 |
return ((System.Drawing.Bitmap)(obj)); |
|
100 |
} |
|
101 |
} |
|
92 | 102 |
} |
93 | 103 |
} |
DTI_PID/SPPIDConverter/Properties/Resources.resx | ||
---|---|---|
127 | 127 |
<data name="cancel_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
128 | 128 |
<value>..\Resources\cancel_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
129 | 129 |
</data> |
130 |
<data name="ToolbarImage" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
|
131 |
<value>..\Resources\ToolbarImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
|
132 |
</data> |
|
130 | 133 |
</root> |
DTI_PID/SPPIDConverter/SPPIDConverter.csproj | ||
---|---|---|
146 | 146 |
<Compile Include="BaseModel\Text.cs" /> |
147 | 147 |
<Compile Include="BaseModel\TrimLine.cs" /> |
148 | 148 |
<Compile Include="CloseOPCForm.cs" /> |
149 |
<Compile Include="ConverterDocking.cs"> |
|
150 |
<SubType>UserControl</SubType> |
|
151 |
</Compile> |
|
152 |
<Compile Include="ConverterDocking.Designer.cs"> |
|
153 |
<DependentUpon>ConverterDocking.cs</DependentUpon> |
|
154 |
</Compile> |
|
149 | 155 |
<Compile Include="DB\SPPID_DB.cs" /> |
150 | 156 |
<Compile Include="DB\SPPID_DBInfo.cs" /> |
151 | 157 |
<Compile Include="ConverterForm.cs"> |
... | ... | |
197 | 203 |
<DependentUpon>Settings.settings</DependentUpon> |
198 | 204 |
</Compile> |
199 | 205 |
<Compile Include="Settings.cs" /> |
200 |
<Compile Include="SPPIDConverter_AutoModeling.cs" /> |
|
206 |
<Compile Include="Wrapper\SPPIDConverterWrapper.cs"> |
|
207 |
<SubType>Form</SubType> |
|
208 |
</Compile> |
|
209 |
<Compile Include="Wrapper\SPPIDConverterWrapper.Designer.cs"> |
|
210 |
<DependentUpon>SPPIDConverterWrapper.cs</DependentUpon> |
|
211 |
</Compile> |
|
212 |
<Compile Include="Wrapper\SPPIDConverter_Wrapper.cs" /> |
|
201 | 213 |
<Compile Include="SPPIDModel\AttributeMapping.cs" /> |
202 | 214 |
<Compile Include="SPPIDModel\ChildSymbolMapping.cs" /> |
203 | 215 |
<Compile Include="SPPIDModel\ETCSetting.cs" /> |
... | ... | |
209 | 221 |
<Compile Include="Util\SPPIDUtil.cs" /> |
210 | 222 |
</ItemGroup> |
211 | 223 |
<ItemGroup> |
224 |
<EmbeddedResource Include="ConverterDocking.resx"> |
|
225 |
<DependentUpon>ConverterDocking.cs</DependentUpon> |
|
226 |
</EmbeddedResource> |
|
212 | 227 |
<EmbeddedResource Include="ConverterForm.resx"> |
213 | 228 |
<DependentUpon>ConverterForm.cs</DependentUpon> |
214 | 229 |
</EmbeddedResource> |
... | ... | |
234 | 249 |
<Generator>ResXFileCodeGenerator</Generator> |
235 | 250 |
<LastGenOutput>Msg.ko.Designer.cs</LastGenOutput> |
236 | 251 |
</EmbeddedResource> |
252 |
<EmbeddedResource Include="Wrapper\SPPIDConverterWrapper.resx"> |
|
253 |
<DependentUpon>SPPIDConverterWrapper.cs</DependentUpon> |
|
254 |
<SubType>Designer</SubType> |
|
255 |
</EmbeddedResource> |
|
237 | 256 |
</ItemGroup> |
238 | 257 |
<ItemGroup> |
239 | 258 |
<COMReference Include="Llama"> |
... | ... | |
329 | 348 |
<ItemGroup> |
330 | 349 |
<None Include="Resources\actions_refresh.svg" /> |
331 | 350 |
</ItemGroup> |
351 |
<ItemGroup> |
|
352 |
<None Include="Resources\ToolbarImage.png" /> |
|
353 |
</ItemGroup> |
|
332 | 354 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
333 | 355 |
<Import Project="..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets')" /> |
334 | 356 |
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
DTI_PID/SPPIDConverter/SPPIDConverter_AutoModeling.cs | ||
---|---|---|
1 |
/*---------------------------------------------------------------------+\ |
|
2 |
| | |
|
3 |
| Copyright 2016 Intergraph Corporation | |
|
4 |
| All Rights Reserved | |
|
5 |
| | |
|
6 |
| Including software, file formats, and audio-visual displays; | |
|
7 |
| may only be used pursuant to applicable software license | |
|
8 |
| agreement; contains confidential and proprietary information of| |
|
9 |
| Intergraph and/or third parties which is protected by copyright| |
|
10 |
| and trade secret law and may not be provided or otherwise made | |
|
11 |
| available without proper authorization. | |
|
12 |
| | |
|
13 |
| Unpublished -- rights reserved under the Copyright Laws of the | |
|
14 |
| United States. | |
|
15 |
| | |
|
16 |
| Intergraph Corporation | |
|
17 |
| Huntsville, Alabama 35894-0001 | |
|
18 |
| | |
|
19 |
\+---------------------------------------------------------------------*/ |
|
20 |
|
|
21 |
using System; |
|
22 |
|
|
23 |
namespace Converter.SPPID |
|
24 |
{ |
|
25 |
/// <summary> |
|
26 |
/// This command class is the mechanism by which the Intergraph application |
|
27 |
/// communicates with the command. |
|
28 |
/// </summary> |
|
29 |
public class SPPIDConverter_AutoModeling : IDisposable |
|
30 |
{ |
|
31 |
/// <remarks> |
|
32 |
/// Declare the form as member data of this class such that each new |
|
33 |
/// instance of the command gets its own form. |
|
34 |
/// </remarks> |
|
35 |
private ConverterForm run; |
|
36 |
|
|
37 |
/// <summary> |
|
38 |
|
|
39 |
/// Initialize the class and use the member form such that each new |
|
40 |
/// instance of the command gets it own form. |
|
41 |
/// </summary> |
|
42 |
public SPPIDConverter_AutoModeling() |
|
43 |
{ |
|
44 |
run = new ConverterForm(); |
|
45 |
} |
|
46 |
|
|
47 |
/// <summary> |
|
48 |
/// This function lets the Intergraph application communicate with the command. |
|
49 |
/// </summary> |
|
50 |
/// <param name="basicCommand">The basic command.</param> |
|
51 |
public void Command_Initialize(object basicCommand) |
|
52 |
{ |
|
53 |
run.commandControl.Command = basicCommand; |
|
54 |
} |
|
55 |
|
|
56 |
/// <summary> |
|
57 |
/// Gets the description. |
|
58 |
/// </summary> |
|
59 |
/// <value> |
|
60 |
/// The description of the command as assigned in the resources file. |
|
61 |
/// </value> |
|
62 |
public string Description |
|
63 |
{ |
|
64 |
get |
|
65 |
{ |
|
66 |
return ""; //Properties.Resources.ResourceManager.GetString("Description", System.Globalization.CultureInfo.CurrentCulture); |
|
67 |
} |
|
68 |
} |
|
69 |
|
|
70 |
/// <summary> |
|
71 |
/// Gets the tooltip of the command. |
|
72 |
/// </summary> |
|
73 |
/// <value> |
|
74 |
/// The tooltip of the command as assigned in the resources file. |
|
75 |
/// </value> |
|
76 |
public string GetTooltip |
|
77 |
{ |
|
78 |
get |
|
79 |
{ |
|
80 |
return "";// Properties.Resources.ResourceManager.GetString("Tooltip", System.Globalization.CultureInfo.CurrentCulture); |
|
81 |
} |
|
82 |
} |
|
83 |
|
|
84 |
/// <summary> |
|
85 |
/// Gets the toolbar image. |
|
86 |
/// </summary> |
|
87 |
/// <value> |
|
88 |
/// The toolbar image of the command as assigned in the resources file. |
|
89 |
/// </value> |
|
90 |
public System.Drawing.Image ToolbarImage |
|
91 |
{ |
|
92 |
get |
|
93 |
{ |
|
94 |
return null;// (System.Drawing.Image)Properties.Resources.ResourceManager.GetObject("ToolbarImage", System.Globalization.CultureInfo.CurrentCulture); |
|
95 |
} |
|
96 |
} |
|
97 |
/// <summary> |
|
98 |
/// All Command classes should implement IDisposable and call the dispose over the |
|
99 |
/// Form on which our RADNetCommandControl lives(i.e Main Form) |
|
100 |
/// </summary> |
|
101 |
void IDisposable.Dispose() |
|
102 |
{ |
|
103 |
/* http://stackoverflow.com/questions/3097364/c-sharp-form-close-vs-form-dispose |
|
104 |
* http://www.alwaysgetbetter.com/blog/2008/04/04/c-formclose-vs-formdispose/ |
|
105 |
* From the above thread in case of Modal Forms we need to explicitly dispose |
|
106 |
* of the Form. Don't call run.Close() here. The form should only be closed |
|
107 |
* when user explicitly does it either via Code or Interactively. Using Close |
|
108 |
* will cause re-entrance into the Form's close event handlers when form is |
|
109 |
* closed explicitly and Done property is set to True. In all the other cases |
|
110 |
* where it is Terminated this method is called by RADNetLoader. |
|
111 |
*/ |
|
112 |
run.Dispose(); // This helps in the destruction of underlying COM Command. |
|
113 |
} |
|
114 |
} |
|
115 |
} |
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverterWrapper.Designer.cs | ||
---|---|---|
1 |
namespace Converter.SPPID.Wrapper |
|
2 |
{ |
|
3 |
partial class SPPIDConverterWrapper |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// Required designer variable. |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// Clean up any resources being used. |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region Windows Form Designer generated code |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// Required method for Designer support - do not modify |
|
27 |
/// the contents of this method with the code editor. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SPPIDConverterWrapper)); |
|
32 |
this.commandControl = new Ingr.RAD2D.MacroControls.CmdCtrl.IgCommand(); |
|
33 |
((System.ComponentModel.ISupportInitialize)(this.commandControl)).BeginInit(); |
|
34 |
this.SuspendLayout(); |
|
35 |
// |
|
36 |
// commandControl |
|
37 |
// |
|
38 |
this.commandControl.Enabled = true; |
|
39 |
this.commandControl.Location = new System.Drawing.Point(0, 0); |
|
40 |
this.commandControl.Name = "commandControl"; |
|
41 |
this.commandControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("commandControl.OcxState"))); |
|
42 |
this.commandControl.Size = new System.Drawing.Size(28, 28); |
|
43 |
this.commandControl.TabIndex = 0; |
|
44 |
this.commandControl.Activate += new System.EventHandler(this.commandControl_Activate); |
|
45 |
this.commandControl.Deactivate += new System.EventHandler(this.commandControl_Deactivate); |
|
46 |
this.commandControl.Terminate += new System.EventHandler(this.commandControl_Terminate); |
|
47 |
this.commandControl.Initialize += new System.EventHandler(this.commandControl_Initialize); |
|
48 |
// |
|
49 |
// FormName |
|
50 |
// |
|
51 |
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); |
|
52 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
53 |
this.ClientSize = new System.Drawing.Size(282, 255); |
|
54 |
this.Controls.Add(this.commandControl); |
|
55 |
this.Name = "SPPIDConverterDialogBarWrapper"; |
|
56 |
this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation; |
|
57 |
this.Text = "SPPIDConverter_DialogBarWrapper"; |
|
58 |
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SPPIDConverterDialogBarWrapper_FormClosing); |
|
59 |
((System.ComponentModel.ISupportInitialize)(this.commandControl)).EndInit(); |
|
60 |
this.ResumeLayout(false); |
|
61 |
|
|
62 |
} |
|
63 |
|
|
64 |
#endregion |
|
65 |
|
|
66 |
public Ingr.RAD2D.MacroControls.CmdCtrl.IgCommand commandControl; |
|
67 |
} |
|
68 |
} |
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverterWrapper.cs | ||
---|---|---|
1 |
/*---------------------------------------------------------------------+\ |
|
2 |
| | |
|
3 |
| Copyright 2016 Intergraph Corporation | |
|
4 |
| All Rights Reserved | |
|
5 |
| | |
|
6 |
| Including software, file formats, and audio-visual displays; | |
|
7 |
| may only be used pursuant to applicable software license | |
|
8 |
| agreement; contains confidential and proprietary information of| |
|
9 |
| Intergraph and/or third parties which is protected by copyright| |
|
10 |
| and trade secret law and may not be provided or otherwise made | |
|
11 |
| available without proper authorization. | |
|
12 |
| | |
|
13 |
| Unpublished -- rights reserved under the Copyright Laws of the | |
|
14 |
| United States. | |
|
15 |
| | |
|
16 |
| Intergraph Corporation | |
|
17 |
| Huntsville, Alabama 35894-0001 | |
|
18 |
| | |
|
19 |
\+---------------------------------------------------------------------*/ |
|
20 |
|
|
21 |
using System; |
|
22 |
using System.ComponentModel; |
|
23 |
using System.Windows.Forms; |
|
24 |
using Microsoft.Win32; |
|
25 |
using Ingr.RAD2D; |
|
26 |
|
|
27 |
namespace Converter.SPPID.Wrapper |
|
28 |
{ |
|
29 |
/// <summary> |
|
30 |
/// This is the primary form. |
|
31 |
/// This command may be built as an executable (EXE) or as a dynamic link |
|
32 |
/// library (DLL). |
|
33 |
/// |
|
34 |
/// When you implement the code that dismisses your form, e.g., an OK |
|
35 |
/// button or a Stop Processing button, you should include the following: |
|
36 |
/// |
|
37 |
/// Hide the form, for example |
|
38 |
/// sPPIDConverterDialogBarWrapper.Hide |
|
39 |
/// |
|
40 |
/// Set the Application's Interactive property to True, for example |
|
41 |
/// commandControl.Application.Interactive = True |
|
42 |
/// |
|
43 |
/// Set Intergraph Command Control Done property to True, for example |
|
44 |
/// commandControl.Done = True |
|
45 |
/// </summary> |
|
46 |
public partial class SPPIDConverterWrapper : System.Windows.Forms.Form |
|
47 |
{ |
|
48 |
const string DialogBarName = "Auto Converter"; |
|
49 |
public static string autoModelingDllPath = string.Empty; |
|
50 |
|
|
51 |
/// <summary> |
|
52 |
/// Constructor for the form. |
|
53 |
/// </summary> |
|
54 |
public SPPIDConverterWrapper() |
|
55 |
{ |
|
56 |
InitializeComponent(); |
|
57 |
} |
|
58 |
|
|
59 |
/// <summary> |
|
60 |
/// Gets the tooltip of the command. |
|
61 |
/// </summary> |
|
62 |
/// <value> |
|
63 |
/// The tooltip of the command as assigned in the resources file. |
|
64 |
/// </value> |
|
65 |
public string GetTooltip |
|
66 |
{ |
|
67 |
get |
|
68 |
{ |
|
69 |
return Properties.Resources.ResourceManager.GetString("Tooltip", System.Globalization.CultureInfo.CurrentCulture); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
/// <summary> |
|
74 |
/// Gets the toolbar image. |
|
75 |
/// </summary> |
|
76 |
/// <value> |
|
77 |
/// The toolbar image of the command as assigned in the resources file. |
|
78 |
/// </value> |
|
79 |
public System.Drawing.Image ToolbarImage |
|
80 |
{ |
|
81 |
get |
|
82 |
{ |
|
83 |
return (System.Drawing.Image)Properties.Resources.ResourceManager.GetObject("ToolbarImage", System.Globalization.CultureInfo.CurrentCulture); |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 |
/// <summary> |
|
88 |
/// The Activate Event is where the command should show its form |
|
89 |
/// if it should be displayed. |
|
90 |
/// </summary> |
|
91 |
/// <param name="sender">The sender of the event</param> |
|
92 |
/// <param name="e">The event's arguments</param> |
|
93 |
private void commandControl_Activate(object sender, EventArgs e) |
|
94 |
{ |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 |
/* The Deactivate event is where the command should hide its form if it |
|
99 |
* was displayed. The command should not unload the form here. |
|
100 |
* The command's form should be unloaded in the Class Module Terminate event. |
|
101 |
*/ |
|
102 |
/// <summary> |
|
103 |
/// |
|
104 |
/// </summary> |
|
105 |
/// <param name="sender">The sender of the event</param> |
|
106 |
/// <param name="e">The event's arguments</param> |
|
107 |
private void commandControl_Deactivate(object sender, EventArgs e) |
|
108 |
{ |
|
109 |
|
|
110 |
} |
|
111 |
|
|
112 |
/// <summary> |
|
113 |
/// The Initialize event is where the command should perform 1 time |
|
114 |
/// initialization, for example it might save a reference to the |
|
115 |
/// active document in private global data. |
|
116 |
/// </summary> |
|
117 |
/// <param name="sender">The sender of the event</param> |
|
118 |
/// <param name="e">The event's arguments</param> |
|
119 |
private void commandControl_Initialize(object sender, EventArgs e) |
|
120 |
{ |
|
121 |
Ingr.RAD2D.Application application = commandControl.Application.RADApplication; |
|
122 |
|
|
123 |
try |
|
124 |
{ |
|
125 |
RegistryKey key = Registry.LocalMachine; |
|
126 |
RegistryKey software = key.OpenSubKey("SOFTWARE"); |
|
127 |
RegistryKey DOFTECH = software.OpenSubKey("DOFTECH"); |
|
128 |
if (DOFTECH != null) |
|
129 |
{ |
|
130 |
RegistryKey ID2 = DOFTECH.OpenSubKey("ID2"); |
|
131 |
if (ID2 != null) |
|
132 |
{ |
|
133 |
autoModelingDllPath = ID2.GetValue("path") + @"Converter\SPPIDConverter.dll"; |
|
134 |
#if DEBUG |
|
135 |
autoModelingDllPath = @"Z:\HanKyouHo\Source\DTIPID\DTI_PID\SPPIDConverterDll\SPPIDConverter.dll"; |
|
136 |
#endif |
|
137 |
|
|
138 |
#region Set ToolBar and Menu |
|
139 |
ToolBars toolBars = application.ToolBars; |
|
140 |
//application.ActiveDocument.SelectSet.GetEnumerator(); |
|
141 |
bool find = true; |
|
142 |
while (find) |
|
143 |
{ |
|
144 |
find = false; |
|
145 |
foreach (Ingr.RAD2D.ToolBar toolBar in toolBars) |
|
146 |
{ |
|
147 |
if (toolBar.Name == "Main") |
|
148 |
{ |
|
149 |
foreach (ToolbarControl item in toolBars["Main"].Controls) |
|
150 |
{ |
|
151 |
if (item.DLLName.Contains("SPPIDConverter.dll")) |
|
152 |
{ |
|
153 |
item.Delete(); |
|
154 |
find = true; |
|
155 |
break; |
|
156 |
} |
|
157 |
} |
|
158 |
break; |
|
159 |
} |
|
160 |
} |
|
161 |
|
|
162 |
} |
|
163 |
foreach (Ingr.RAD2D.ToolBar toolBar in toolBars) |
|
164 |
{ |
|
165 |
if (toolBar.Name == "Main") |
|
166 |
{ |
|
167 |
ToolbarControl toolBarControl = toolBars["Main"].Controls.AppendMacroCommand(autoModelingDllPath); |
|
168 |
toolBarControl.ToolTipText = GetTooltip; |
|
169 |
toolBarControl.Picture = ToolbarImage; |
|
170 |
break; |
|
171 |
} |
|
172 |
} |
|
173 |
|
|
174 |
Menus menus = application.Menus; |
|
175 |
find = true; |
|
176 |
while (find) |
|
177 |
{ |
|
178 |
find = false; |
|
179 |
foreach (Ingr.RAD2D.Menu menu in menus) |
|
180 |
{ |
|
181 |
if (menu.Name == "&Tools") |
|
182 |
{ |
|
183 |
foreach (MenuControl item in menus["&Tools"].Controls) |
|
184 |
{ |
|
185 |
if (item.Caption == GetTooltip) |
|
186 |
{ |
|
187 |
item.Delete(); |
|
188 |
find = true; |
|
189 |
break; |
|
190 |
} |
|
191 |
} |
|
192 |
break; |
|
193 |
} |
|
194 |
} |
|
195 |
} |
|
196 |
foreach (Ingr.RAD2D.Menu menu in menus) |
|
197 |
{ |
|
198 |
if (menu.Name == "&Tools") |
|
199 |
{ |
|
200 |
MenuControl menuControl = application.Menus["&Tools"].Controls.AppendMacroCommand(GetTooltip, autoModelingDllPath); |
|
201 |
menuControl.ToolTipText = GetTooltip; |
|
202 |
} |
|
203 |
} |
|
204 |
|
|
205 |
#endregion |
|
206 |
|
|
207 |
#region Add Docking |
|
208 |
try |
|
209 |
{ |
|
210 |
bool bExist = false; |
|
211 |
foreach (DialogBar dialogBar in application.DialogBars) |
|
212 |
{ |
|
213 |
if (dialogBar.Name == DialogBarName) |
|
214 |
{ |
|
215 |
bExist = true; |
|
216 |
dialogBar.Delete(); |
|
217 |
break; |
|
218 |
} |
|
219 |
} |
|
220 |
if (!bExist) |
|
221 |
{ |
|
222 |
DialogBar dlgBar = application.DialogBars.Add(DialogBarName, DockingFlagsConstants.igDockableOnLeft, DockingLocationConstants.igDockOnLeft, |
|
223 |
DialogBarStyleConstants.igDialogBarStyleShowCaption | DialogBarStyleConstants.igDialogBarStyleStretchToFitHorizontal | DialogBarStyleConstants.igDialogBarStyleStretchToFitVertical | DialogBarStyleConstants.igDialogBarStyleNoBorder, 0, 0); |
|
224 |
DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.Wrapper.ConverterDocking", 150, 300); |
|
225 |
} |
|
226 |
} |
|
227 |
catch (Exception ex) |
|
228 |
{ |
|
229 |
MessageBox.Show("Fail", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
230 |
} |
|
231 |
|
|
232 |
#endregion |
|
233 |
} |
|
234 |
} |
|
235 |
else |
|
236 |
{ |
|
237 |
MessageBox.Show("Please SetUp ID2", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
238 |
} |
|
239 |
} |
|
240 |
catch (Exception ex) |
|
241 |
{ |
|
242 |
MessageBox.Show(ex.Message); |
|
243 |
} |
|
244 |
finally |
|
245 |
{ |
|
246 |
Close(); |
|
247 |
} |
|
248 |
|
|
249 |
} |
|
250 |
|
|
251 |
/// <summary> |
|
252 |
/// The Terminate event is where the command can clean up any command |
|
253 |
/// specific allocated resources. |
|
254 |
/// </summary> |
|
255 |
/// <param name="sender">The sender of the event</param> |
|
256 |
/// <param name="e">The event's arguments</param> |
|
257 |
public void commandControl_Terminate(object sender, EventArgs e) |
|
258 |
{ |
|
259 |
|
|
260 |
} |
|
261 |
|
|
262 |
/// <summary> |
|
263 |
/// The primary form should not simply be unloaded. You should set |
|
264 |
/// the Intergraph Command Control Done property to True when you |
|
265 |
/// want the form to be unloaded. Then unload the form in the |
|
266 |
/// dispose method. |
|
267 |
/// </summary> |
|
268 |
/// <param name="sender">The sender of the event</param> |
|
269 |
/// <param name="e">The event's arguments</param> |
|
270 |
private void SPPIDConverterDialogBarWrapper_FormClosing(object sender, FormClosingEventArgs e) |
|
271 |
{ |
|
272 |
commandControl.Application.RADApplication.Interactive = true; |
|
273 |
commandControl.Done = true; |
|
274 |
} |
|
275 |
|
|
276 |
} |
|
277 |
} |
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverterWrapper.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
<data name="commandControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
121 |
<value> |
|
122 |
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w |
|
123 |
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 |
|
124 |
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAJwAAAAIB |
|
125 |
AAAAAQAAAAAAAAAAAAAAABIAAAAFAAIAUQIAAFECAAAAAAAAAQEL |
|
126 |
</value> |
|
127 |
</data> |
|
128 |
<data name="mouseControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
129 |
<value> |
|
130 |
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w |
|
131 |
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 |
|
132 |
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAfAAAAAIB |
|
133 |
AAAAAQAAAAAAAAAAAAAAAGcAAAAFAAIAUQIAAFECAABAAAAAAQAAAQAAAAEAAAAAAAAAAAQAAAAAAAAA |
|
134 |
AAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
|
135 |
AAAACw== |
|
136 |
</value> |
|
137 |
</data> |
|
138 |
</root> |
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverter_Wrapper.cs | ||
---|---|---|
1 |
/*---------------------------------------------------------------------+\ |
|
2 |
| | |
|
3 |
| Copyright 2016 Intergraph Corporation | |
|
4 |
| All Rights Reserved | |
|
5 |
| | |
|
6 |
| Including software, file formats, and audio-visual displays; | |
|
7 |
| may only be used pursuant to applicable software license | |
|
8 |
| agreement; contains confidential and proprietary information of| |
|
9 |
| Intergraph and/or third parties which is protected by copyright| |
|
10 |
| and trade secret law and may not be provided or otherwise made | |
|
11 |
| available without proper authorization. | |
|
12 |
| | |
|
13 |
| Unpublished -- rights reserved under the Copyright Laws of the | |
|
14 |
| United States. | |
|
15 |
| | |
|
16 |
| Intergraph Corporation | |
|
17 |
| Huntsville, Alabama 35894-0001 | |
|
18 |
| | |
|
19 |
\+---------------------------------------------------------------------*/ |
|
20 |
|
|
21 |
using System; |
|
22 |
|
|
23 |
namespace Converter.SPPID.Wrapper |
|
24 |
{ |
|
25 |
/// <summary> |
|
26 |
/// This command class is the mechanism by which the Intergraph application |
|
27 |
/// communicates with the command. |
|
28 |
/// </summary> |
|
29 |
public class SPPIDConverter_Wrapper : IDisposable |
|
30 |
{ |
|
31 |
|
|
32 |
/// <remark> |
|
33 |
/// Declare the form as member data of this class such that each new |
|
34 |
/// instance of the command gets its own form. |
|
35 |
/// </remark> |
|
36 |
private SPPIDConverterWrapper sPPIDConverterDialogBarWrapper; |
|
37 |
|
|
38 |
/// <summary> |
|
39 |
|
|
40 |
/// Initialize the class and use the member form such that each new |
|
41 |
/// instance of the command gets it own form. |
|
42 |
/// </summary> |
|
43 |
public SPPIDConverter_Wrapper() |
|
44 |
{ |
|
45 |
sPPIDConverterDialogBarWrapper = new SPPIDConverterWrapper(); |
|
46 |
} |
|
47 |
|
|
48 |
/// <summary> |
|
49 |
/// This function lets the Intergraph application communicate with |
|
50 |
/// the command. |
|
51 |
/// </summary> |
|
52 |
/// <param name="basicCommand">The basic command</param> |
|
53 |
public void Command_Initialize(ref object basicCommand) |
|
54 |
{ |
|
55 |
sPPIDConverterDialogBarWrapper.commandControl.Command = basicCommand; |
|
56 |
} |
|
57 |
|
|
58 |
/// <summary> |
|
59 |
/// Gets the description. |
|
60 |
/// </summary> |
|
61 |
/// <value> |
|
62 |
/// The description of the command as assigned in the resources file. |
|
63 |
/// </value> |
|
64 |
public string Description |
|
65 |
{ |
|
66 |
get |
|
67 |
{ |
|
68 |
return Properties.Resources.ResourceManager.GetString("Description", System.Globalization.CultureInfo.CurrentCulture); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
/// <summary> |
|
73 |
/// Gets the tooltip of the command. |
|
74 |
/// </summary> |
|
75 |
/// <value> |
|
76 |
/// The tooltip of the command as assigned in the resources file. |
|
77 |
/// </value> |
|
78 |
public string GetTooltip |
|
79 |
{ |
|
80 |
get |
|
81 |
{ |
|
82 |
return Properties.Resources.ResourceManager.GetString("Tooltip", System.Globalization.CultureInfo.CurrentCulture); |
|
83 |
} |
|
84 |
} |
|
85 |
|
|
86 |
/// <summary> |
|
87 |
/// Gets the toolbar image. |
|
88 |
/// </summary> |
|
89 |
/// <value> |
|
90 |
/// The toolbar image of the command as assigned in the resources file. |
|
91 |
/// </value> |
|
92 |
public System.Drawing.Image ToolbarImage |
|
93 |
{ |
|
94 |
get |
|
95 |
{ |
|
96 |
return (System.Drawing.Image)Properties.Resources.ResourceManager.GetObject("ToolbarImage", System.Globalization.CultureInfo.CurrentCulture); |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
/// <summary> |
|
101 |
/// All Macro classes should implement IDisposable and call the dispose over the |
|
102 |
/// Form on which our RADNetCommandControl lives(i.e Main Form) |
|
103 |
/// </summary> |
|
104 |
void IDisposable.Dispose() |
|
105 |
{ |
|
106 |
/* http://stackoverflow.com/questions/3097364/c-sharp-form-close-vs-form-dispose |
|
107 |
* http://www.alwaysgetbetter.com/blog/2008/04/04/c-formclose-vs-formdispose/ |
|
108 |
* From the above thread in case of Modal forms we need to explicitly dispose |
|
109 |
* the form. Don't call Close here. Form should only be closed when user |
|
110 |
* explicitly does it either via Code or Interactively. Using Close will cause |
|
111 |
* re-entrance in the form's close event handlers when the form is closed |
|
112 |
* explicitly and Done property is set to True. In all the other cases where |
|
113 |
* Macro is Terminated this method is called by RADNetLoader. |
|
114 |
*/ |
|
115 |
sPPIDConverterDialogBarWrapper.Dispose(); // This helps in the destruction of underlying COM Command. |
|
116 |
} |
|
117 |
} |
|
118 |
} |
내보내기 Unified diff