프로젝트

일반

사용자정보

개정판 2f0955d4

ID2f0955d4a481bdb89f1aead2a4eb1f7e90e0eed3
상위 4d066231
하위 be8b0b13, 0f3948e2, 96a2080c

gaqhf 이(가) 약 6년 전에 추가함

dev issue #000 : edit project

Change-Id: I7809aa4fba967221ec348b8f1a5232beb45eafd5

차이점 보기:

DTI_PID/DTI_PID.sln
7 7
EndProject
8 8
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDF_TO_IMAGE", "PDF_TO_IMAGE\PDF_TO_IMAGE.csproj", "{B7B8B0AE-9F03-4543-BC05-813A25E9D584}"
9 9
EndProject
10
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter_CustomCommand", "SPPIDConverter_CustomCommand\SPPIDConverter_CustomCommand.csproj", "{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}"
11
EndProject
12 10
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter_Wrapper", "SPPIDConverter_DialogBarWrapper\SPPIDConverter_Wrapper.csproj", "{50BEB77D-9842-4C35-8369-0B5BD5C69EFA}"
13 11
EndProject
14 12
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter_AutoModeling", "SPPIDConverter_AutoModeling\SPPIDConverter_AutoModeling.csproj", "{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}"
......
35 33
		{B7B8B0AE-9F03-4543-BC05-813A25E9D584}.Release|Any CPU.Build.0 = Release|Any CPU
36 34
		{B7B8B0AE-9F03-4543-BC05-813A25E9D584}.Release|x64.ActiveCfg = Release|x64
37 35
		{B7B8B0AE-9F03-4543-BC05-813A25E9D584}.Release|x64.Build.0 = Release|x64
38
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
40
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|x64.ActiveCfg = Debug|Any CPU
41
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|x64.Build.0 = Debug|Any CPU
42
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
43
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|Any CPU.Build.0 = Release|Any CPU
44
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|x64.ActiveCfg = Release|Any CPU
45
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|x64.Build.0 = Release|Any CPU
46 36
		{50BEB77D-9842-4C35-8369-0B5BD5C69EFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 37
		{50BEB77D-9842-4C35-8369-0B5BD5C69EFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 38
		{50BEB77D-9842-4C35-8369-0B5BD5C69EFA}.Debug|x64.ActiveCfg = Debug|Any CPU
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterDialogBarWrapper.Designer.cs
1
namespace Converter.SPPID.Wrapper
2
{
3
    partial class SPPIDConverterDialogBarWrapper
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(SPPIDConverterDialogBarWrapper));
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_DialogBarWrapper/SPPIDConverterDialogBarWrapper.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 SPPIDConverterDialogBarWrapper : Form
47
    {
48
        const string DialogBarName = "Auto Converter";
49

  
50
        /// <summary>
51
        /// Constructor for the form.
52
        /// </summary>
53
        public SPPIDConverterDialogBarWrapper()
54
        {
55
            InitializeComponent();
56
        }
57

  
58
        /// <summary>
59
        /// Gets the tooltip of the command.
60
        /// </summary>
61
        /// <value>
62
        /// The tooltip of the command as assigned in the resources file.
63
        /// </value>
64
        public string GetTooltip
65
        {
66
            get
67
            {
68
                return Properties.Resources.ResourceManager.GetString("Tooltip", System.Globalization.CultureInfo.CurrentCulture);
69
            }
70
        }
71

  
72
        /// <summary>
73
        /// Gets the toolbar image.
74
        /// </summary>
75
        /// <value>
76
        /// The toolbar image of the command as assigned in the resources file.
77
        /// </value>
78
        public System.Drawing.Image ToolbarImage
79
        {
80
            get
81
            {
82
                return (System.Drawing.Image)Properties.Resources.ResourceManager.GetObject("ToolbarImage", System.Globalization.CultureInfo.CurrentCulture);
83
            }
84
        }
85

  
86
        /// <summary>
87
        /// The Activate Event is where the command should show its form
88
        /// if it should be displayed.
89
        /// </summary>
90
        /// <param name="sender">The sender of the event</param>
91
        /// <param name="e">The event's arguments</param>
92
        private void commandControl_Activate(object sender, EventArgs e)
93
        {
94

  
95
        }
96

  
97
        /* The Deactivate event is where the command should hide its form if it
98
         * was displayed.  The command should not unload the form here.
99
         * The command's form should be unloaded in the Class Module Terminate event.
100
         */
101
        /// <summary>
102
        /// 
103
        /// </summary>
104
        /// <param name="sender">The sender of the event</param>
105
        /// <param name="e">The event's arguments</param>
106
        private void commandControl_Deactivate(object sender, EventArgs e)
107
        {
108

  
109
        }
110

  
111
        /// <summary>
112
        /// The Initialize event is where the command should perform 1 time 
113
        /// initialization, for example it might save a reference to the 
114
        /// active document in private global data.
115
        /// </summary>
116
        /// <param name="sender">The sender of the event</param>
117
        /// <param name="e">The event's arguments</param>
118
        private void commandControl_Initialize(object sender, EventArgs e)
119
        {
120
            Ingr.RAD2D.Application application = commandControl.Application.RADApplication;
121

  
122
            try
123
            {
124
                RegistryKey key = Registry.LocalMachine;
125
                RegistryKey software = key.OpenSubKey("SOFTWARE");
126
                RegistryKey DOFTECH = software.OpenSubKey("DOFTECH");
127
                if (DOFTECH != null)
128
                {
129
                    RegistryKey ID2 = DOFTECH.OpenSubKey("ID2");
130
                    if (ID2 != null)
131
                    {
132
                        //string wrapperDllPath = ID2.GetValue("Path").ToString() + @"Converter\SPPIDConverter_Wrapper.dll";
133
                        //string wrapperDllPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
134
                        string wrapperDllPath = @"Z:\HanKyouHo\Source\DTIPID\DTI_PID\SPPIDConverterDll\SPPIDConverter_Wrapper.dll";
135

  
136
                        #region DialogBar Setting
137
                        try
138
                        {
139
                            bool bExist = false;
140
                            foreach (DialogBar dialogBar in application.DialogBars)
141
                            {
142
                                if (dialogBar.Name == DialogBarName)
143
                                {
144
                                    bExist = true;
145
                                    dialogBar.Delete();
146
                                    break;
147
                                }
148
                            }
149
                            if (!bExist)
150
                            {
151
                                DialogBar dlgBar = application.DialogBars.Add(DialogBarName, DockingFlagsConstants.igDockableOnLeft, DockingLocationConstants.igDockOnLeft,
152
                                    DialogBarStyleConstants.igDialogBarStyleShowCaption | DialogBarStyleConstants.igDialogBarStyleStretchToFitHorizontal | DialogBarStyleConstants.igDialogBarStyleStretchToFitVertical | DialogBarStyleConstants.igDialogBarStyleNoBorder , 0, 0);
153
                                //DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(wrapperDllPath, "SPPIDConverter_AutoModeling.MainControl", 733, 900);
154
                                //DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(wrapperDllPath, "Converter.SPPID.DialogBarWrapper.EmptyControl", 0, 0);
155

  
156
                                //dynamic userControl = dialogBarControl_UserControl.ControlDispatch;
157
                                //Control control = userControl as Control;
158
                            }
159
                        }
160
                        catch (Exception ex)
161
                        {
162

  
163
                        }
164
                        #endregion
165

  
166
                        #region Set ToolBar and Menu
167
                        ToolBars toolBars = application.ToolBars;
168

  
169
                        bool find = true;
170
                        while (find)
171
                        {
172
                            find = false;
173
                            foreach (Ingr.RAD2D.ToolBar toolBar in toolBars)
174
                            {
175
                                if (toolBar.Name == "Main")
176
                                {
177
                                    foreach (ToolbarControl item in toolBars["Main"].Controls)
178
                                    {
179
                                        if (item.DLLName.Contains("SPPIDConverter_"))
180
                                        {
181
                                            item.Delete();
182
                                            find = true;
183
                                            break;
184
                                        }
185
                                    }
186
                                    break;
187
                                }
188
                            }
189

  
190
                        }
191
                        foreach (Ingr.RAD2D.ToolBar toolBar in toolBars)
192
                        {
193
                            if (toolBar.Name == "Main")
194
                            {
195
                                ToolbarControl toolBarControl = toolBars["Main"].Controls.AppendMacroCommand(wrapperDllPath);
196
                                toolBarControl.ToolTipText = GetTooltip;
197
                                toolBarControl.Picture = ToolbarImage;
198
                                break;
199
                            }
200
                        }
201

  
202
                        Menus menus = application.Menus;
203
                        find = true;
204
                        while (find)
205
                        {
206
                            find = false;
207
                            foreach (Ingr.RAD2D.Menu menu in menus)
208
                            {
209
                                if (menu.Name == "&Tools")
210
                                {
211
                                    foreach (MenuControl item in menus["&Tools"].Controls)
212
                                    {
213
                                        if (item.Caption == GetTooltip)
214
                                        {
215
                                            item.Delete();
216
                                            find = true;
217
                                            break;
218
                                        }
219
                                    }
220
                                    break;
221
                                }
222
                            }
223

  
224
                        }
225
                        foreach (Ingr.RAD2D.Menu menu in menus)
226
                        {
227
                            if (menu.Name == "&Tools")
228
                            {
229
                                MenuControl menuControl = application.Menus["&Tools"].Controls.AppendMacroCommand(GetTooltip, wrapperDllPath);
230
                                menuControl.ToolTipText = GetTooltip;
231
                            }
232
                        }
233

  
234
                        #endregion
235
                    }
236
                }
237
                else
238
                {
239
                    MessageBox.Show("Please SetUp ID2", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
240
                }
241
            }
242
            catch (Exception ex)
243
            {
244
                MessageBox.Show(ex.Message);
245
            }
246
            finally
247
            {
248
                commandControl.Application.RADApplication.Interactive = true;
249
                this.Hide();
250
                commandControl.Done = true;
251
            }
252

  
253
        }
254

  
255
        /// <summary>
256
        /// The Terminate event is where the command can clean up any command
257
        /// specific allocated resources.
258
        /// </summary>
259
        /// <param name="sender">The sender of the event</param>
260
        /// <param name="e">The event's arguments</param>
261
        public void commandControl_Terminate(object sender, EventArgs e)
262
        {
263

  
264
        }
265

  
266
        /// <summary>
267
        /// The primary form should not simply be unloaded.  You should set 
268
        /// the Intergraph Command Control Done property to True when you 
269
        /// want the form to be unloaded.  Then unload the form in the
270
        /// dispose method.
271
        /// </summary>
272
        /// <param name="sender">The sender of the event</param>
273
        /// <param name="e">The event's arguments</param>
274
        private void SPPIDConverterDialogBarWrapper_FormClosing(object sender, FormClosingEventArgs e)
275
        {
276
            commandControl.Application.RADApplication.Interactive = true;
277
            commandControl.Done = true;
278
        }
279

  
280
    }
281
}
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterDialogBarWrapper.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_DialogBarWrapper/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_DialogBarWrapper/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 : Form
47
    {
48
        const string DialogBarName = "Auto Converter";
49

  
50
        /// <summary>
51
        /// Constructor for the form.
52
        /// </summary>
53
        public SPPIDConverterWrapper()
54
        {
55
            InitializeComponent();
56
        }
57

  
58
        /// <summary>
59
        /// Gets the tooltip of the command.
60
        /// </summary>
61
        /// <value>
62
        /// The tooltip of the command as assigned in the resources file.
63
        /// </value>
64
        public string GetTooltip
65
        {
66
            get
67
            {
68
                return Properties.Resources.ResourceManager.GetString("Tooltip", System.Globalization.CultureInfo.CurrentCulture);
69
            }
70
        }
71

  
72
        /// <summary>
73
        /// Gets the toolbar image.
74
        /// </summary>
75
        /// <value>
76
        /// The toolbar image of the command as assigned in the resources file.
77
        /// </value>
78
        public System.Drawing.Image ToolbarImage
79
        {
80
            get
81
            {
82
                return (System.Drawing.Image)Properties.Resources.ResourceManager.GetObject("ToolbarImage", System.Globalization.CultureInfo.CurrentCulture);
83
            }
84
        }
85

  
86
        /// <summary>
87
        /// The Activate Event is where the command should show its form
88
        /// if it should be displayed.
89
        /// </summary>
90
        /// <param name="sender">The sender of the event</param>
91
        /// <param name="e">The event's arguments</param>
92
        private void commandControl_Activate(object sender, EventArgs e)
93
        {
94

  
95
        }
96

  
97
        /* The Deactivate event is where the command should hide its form if it
98
         * was displayed.  The command should not unload the form here.
99
         * The command's form should be unloaded in the Class Module Terminate event.
100
         */
101
        /// <summary>
102
        /// 
103
        /// </summary>
104
        /// <param name="sender">The sender of the event</param>
105
        /// <param name="e">The event's arguments</param>
106
        private void commandControl_Deactivate(object sender, EventArgs e)
107
        {
108

  
109
        }
110

  
111
        /// <summary>
112
        /// The Initialize event is where the command should perform 1 time 
113
        /// initialization, for example it might save a reference to the 
114
        /// active document in private global data.
115
        /// </summary>
116
        /// <param name="sender">The sender of the event</param>
117
        /// <param name="e">The event's arguments</param>
118
        private void commandControl_Initialize(object sender, EventArgs e)
119
        {
120
            Ingr.RAD2D.Application application = commandControl.Application.RADApplication;
121

  
122
            try
123
            {
124
                RegistryKey key = Registry.LocalMachine;
125
                RegistryKey software = key.OpenSubKey("SOFTWARE");
126
                RegistryKey DOFTECH = software.OpenSubKey("DOFTECH");
127
                if (DOFTECH != null)
128
                {
129
                    RegistryKey ID2 = DOFTECH.OpenSubKey("ID2");
130
                    if (ID2 != null)
131
                    {
132
                        //string wrapperDllPath = ID2.GetValue("Path").ToString() + @"Converter\SPPIDConverter_Wrapper.dll";
133
                        //string wrapperDllPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
134
                        string wrapperDllPath = @"Z:\HanKyouHo\Source\DTIPID\DTI_PID\SPPIDConverterDll\SPPIDConverter_Wrapper.dll";
135

  
136
                        #region DialogBar Setting
137
                        try
138
                        {
139
                            bool bExist = false;
140
                            foreach (DialogBar dialogBar in application.DialogBars)
141
                            {
142
                                if (dialogBar.Name == DialogBarName)
143
                                {
144
                                    bExist = true;
145
                                    dialogBar.Delete();
146
                                    break;
147
                                }
148
                            }
149
                            if (!bExist)
150
                            {
151
                                DialogBar dlgBar = application.DialogBars.Add(DialogBarName, DockingFlagsConstants.igDockableOnLeft, DockingLocationConstants.igDockOnLeft,
152
                                    DialogBarStyleConstants.igDialogBarStyleShowCaption | DialogBarStyleConstants.igDialogBarStyleStretchToFitHorizontal | DialogBarStyleConstants.igDialogBarStyleStretchToFitVertical | DialogBarStyleConstants.igDialogBarStyleNoBorder , 0, 0);
153
                                //DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(wrapperDllPath, "SPPIDConverter_AutoModeling.MainControl", 733, 900);
154
                                //DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(wrapperDllPath, "Converter.SPPID.DialogBarWrapper.EmptyControl", 0, 0);
155

  
156
                                //dynamic userControl = dialogBarControl_UserControl.ControlDispatch;
157
                                //Control control = userControl as Control;
158
                            }
159
                        }
160
                        catch (Exception ex)
161
                        {
162

  
163
                        }
164
                        #endregion
165

  
166
                        #region Set ToolBar and Menu
167
                        ToolBars toolBars = application.ToolBars;
168

  
169
                        bool find = true;
170
                        while (find)
171
                        {
172
                            find = false;
173
                            foreach (Ingr.RAD2D.ToolBar toolBar in toolBars)
174
                            {
175
                                if (toolBar.Name == "Main")
176
                                {
177
                                    foreach (ToolbarControl item in toolBars["Main"].Controls)
178
                                    {
179
                                        if (item.DLLName.Contains("SPPIDConverter_"))
180
                                        {
181
                                            item.Delete();
182
                                            find = true;
183
                                            break;
184
                                        }
185
                                    }
186
                                    break;
187
                                }
188
                            }
189

  
190
                        }
191
                        foreach (Ingr.RAD2D.ToolBar toolBar in toolBars)
192
                        {
193
                            if (toolBar.Name == "Main")
194
                            {
195
                                ToolbarControl toolBarControl = toolBars["Main"].Controls.AppendMacroCommand(wrapperDllPath);
196
                                toolBarControl.ToolTipText = GetTooltip;
197
                                toolBarControl.Picture = ToolbarImage;
198
                                break;
199
                            }
200
                        }
201

  
202
                        Menus menus = application.Menus;
203
                        find = true;
204
                        while (find)
205
                        {
206
                            find = false;
207
                            foreach (Ingr.RAD2D.Menu menu in menus)
208
                            {
209
                                if (menu.Name == "&Tools")
210
                                {
211
                                    foreach (MenuControl item in menus["&Tools"].Controls)
212
                                    {
213
                                        if (item.Caption == GetTooltip)
214
                                        {
215
                                            item.Delete();
216
                                            find = true;
217
                                            break;
218
                                        }
219
                                    }
220
                                    break;
221
                                }
222
                            }
223

  
224
                        }
225
                        foreach (Ingr.RAD2D.Menu menu in menus)
226
                        {
227
                            if (menu.Name == "&Tools")
228
                            {
229
                                MenuControl menuControl = application.Menus["&Tools"].Controls.AppendMacroCommand(GetTooltip, wrapperDllPath);
230
                                menuControl.ToolTipText = GetTooltip;
231
                            }
232
                        }
233

  
234
                        #endregion
235
                    }
236
                }
237
                else
238
                {
239
                    MessageBox.Show("Please SetUp ID2", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
240
                }
241
            }
242
            catch (Exception ex)
243
            {
244
                MessageBox.Show(ex.Message);
245
            }
246
            finally
247
            {
248
                commandControl.Application.RADApplication.Interactive = true;
249
                this.Hide();
250
                commandControl.Done = true;
251
            }
252

  
253
        }
254

  
255
        /// <summary>
256
        /// The Terminate event is where the command can clean up any command
257
        /// specific allocated resources.
258
        /// </summary>
259
        /// <param name="sender">The sender of the event</param>
260
        /// <param name="e">The event's arguments</param>
261
        public void commandControl_Terminate(object sender, EventArgs e)
262
        {
263

  
264
        }
265

  
266
        /// <summary>
267
        /// The primary form should not simply be unloaded.  You should set 
268
        /// the Intergraph Command Control Done property to True when you 
269
        /// want the form to be unloaded.  Then unload the form in the
270
        /// dispose method.
271
        /// </summary>
272
        /// <param name="sender">The sender of the event</param>
273
        /// <param name="e">The event's arguments</param>
274
        private void SPPIDConverterDialogBarWrapper_FormClosing(object sender, FormClosingEventArgs e)
275
        {
276
            commandControl.Application.RADApplication.Interactive = true;
277
            commandControl.Done = true;
278
        }
279

  
280
    }
281
}
DTI_PID/SPPIDConverter_DialogBarWrapper/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_DialogBarWrapper/SPPIDConverter_DialogBarWrapper.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_DialogBarWrapper : 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 SPPIDConverterDialogBarWrapper 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_DialogBarWrapper()
44
        {
45
            sPPIDConverterDialogBarWrapper = new SPPIDConverterDialogBarWrapper();
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
}
DTI_PID/SPPIDConverter_DialogBarWrapper/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
}
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverter_Wrapper.csproj
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
  <PropertyGroup>
5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
    <ProjectGuid>{50BEB77D-9842-4C35-8369-0B5BD5C69EFA}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>Converter.SPPID.Wrapper</RootNamespace>
11
    <AssemblyName>SPPIDConverter_Wrapper</AssemblyName>
12
    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
  </PropertyGroup>
15
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
    <DebugSymbols>true</DebugSymbols>
17
    <DebugType>full</DebugType>
18
    <Optimize>false</Optimize>
19
    <OutputPath>..\SPPIDConverterDll\</OutputPath>
20
    <DefineConstants>DEBUG;TRACE</DefineConstants>
21
    <ErrorReport>prompt</ErrorReport>
22
    <WarningLevel>4</WarningLevel>
23
  </PropertyGroup>
24
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25
    <DebugType>pdbonly</DebugType>
26
    <Optimize>true</Optimize>
27
    <OutputPath>bin\Release\</OutputPath>
28
    <DefineConstants>TRACE</DefineConstants>
29
    <ErrorReport>prompt</ErrorReport>
30
    <WarningLevel>4</WarningLevel>
31
  </PropertyGroup>
32
  <ItemGroup>
33
    <Reference Include="Interop.RAD2D">
34
      <HintPath>C:\Program Files (x86)\SmartPlant\P&amp;ID Workstation\bin\Interop.RAD2D.dll</HintPath>
35
      <EmbedInteropTypes>True</EmbedInteropTypes>
36
    </Reference>
37
    <Reference Include="RadNetAutomation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f600089cf0eaec9, processorArchitecture=MSIL">
38
      <SpecificVersion>False</SpecificVersion>
39
      <HintPath>C:\Program Files (x86)\SmartPlant\P&amp;ID Workstation\bin\RadNetAutomation.dll</HintPath>
40
    </Reference>
41
    <Reference Include="RadNetCmdCtrl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f600089cf0eaec9, processorArchitecture=MSIL">
42
      <SpecificVersion>False</SpecificVersion>
43
      <HintPath>C:\Program Files (x86)\SmartPlant\P&amp;ID Workstation\bin\RadNetCmdCtrl.dll</HintPath>
44
    </Reference>
45
    <Reference Include="System">
46
      <Private>False</Private>
47
    </Reference>
48
    <Reference Include="System.Core">
49
      <Private>False</Private>
50
    </Reference>
51
    <Reference Include="System.Drawing">
52
      <Private>False</Private>
53
    </Reference>
54
    <Reference Include="System.Windows.Forms">
55
      <Private>False</Private>
56
    </Reference>
57
    <Reference Include="Microsoft.CSharp">
58
      <Private>False</Private>
59
    </Reference>
60
    <Reference Include="System.Data">
61
      <Private>False</Private>
62
    </Reference>
63
    <Reference Include="System.Xml">
64
      <Private>False</Private>
65
    </Reference>
66
  </ItemGroup>
67
  <ItemGroup>
68
    <Compile Include="SPPIDConverter_Wrapper.cs" />
69
    <Compile Include="SPPIDConverterWrapper.cs">
70
      <SubType>Form</SubType>
71
    </Compile>
72
    <Compile Include="SPPIDConverterWrapper.Designer.cs">
73
      <DependentUpon>SPPIDConverterWrapper.cs</DependentUpon>
74
    </Compile>
75
    <Compile Include="Properties\AssemblyInfo.cs" />
76
    <Compile Include="Properties\Resources.Designer.cs">
77
      <AutoGen>True</AutoGen>
78
      <DesignTime>True</DesignTime>
79
      <DependentUpon>Resources.resx</DependentUpon>
80
    </Compile>
81
  </ItemGroup>
82
  <ItemGroup>
83
    <EmbeddedResource Include="SPPIDConverterWrapper.resx">
84
      <DependentUpon>SPPIDConverterWrapper.cs</DependentUpon>
85
      <SubType>Designer</SubType>
86
    </EmbeddedResource>
87
    <EmbeddedResource Include="Properties\Resources.resx">
88
      <Generator>ResXFileCodeGenerator</Generator>
89
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
90
    </EmbeddedResource>
91
  </ItemGroup>
92
  <ItemGroup>
93
    <None Include="Resources\ToolbarImage.png" />
94
  </ItemGroup>
95
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
96
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
97
       Other similar extension points exist, see Microsoft.Common.targets.
98
  <Target Name="BeforeBuild">
99
  </Target>
100
  <Target Name="AfterBuild">
101
  </Target>
102
  -->
103
</Project>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)