hytos / DTI_PID / SPPIDConverter / Wrapper / SPPIDConverter_Wrapper.cs @ 0adeae22
이력 | 보기 | 이력해설 | 다운로드 (4.93 KB)
1 | 2cae7d1f | gaqhf | /*---------------------------------------------------------------------+\ |
---|---|---|---|
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 | 0a24b232 | gaqhf | namespace Converter.SPPID.Wrapper |
24 | 2cae7d1f | gaqhf | { |
25 | /// <summary> |
||
26 | /// This command class is the mechanism by which the Intergraph application |
||
27 | /// communicates with the command. |
||
28 | /// </summary> |
||
29 | 2f0955d4 | gaqhf | public class SPPIDConverter_Wrapper : IDisposable |
30 | 2cae7d1f | gaqhf | { |
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 | 2f0955d4 | gaqhf | private SPPIDConverterWrapper sPPIDConverterDialogBarWrapper; |
37 | 2cae7d1f | gaqhf | |
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 | 2f0955d4 | gaqhf | public SPPIDConverter_Wrapper() |
44 | 2cae7d1f | gaqhf | { |
45 | 2f0955d4 | gaqhf | sPPIDConverterDialogBarWrapper = new SPPIDConverterWrapper(); |
46 | 2cae7d1f | gaqhf | } |
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 | } |