프로젝트

일반

사용자정보

개정판 022cae08

ID022cae08a203ed12b5a7ea757ccc5d620c76ab70
상위 1ac48030
하위 98fc753d

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

build issue #000: remove sppidConverter project

차이점 보기:

DTI_PID/SPPIDConverter_CustomCommand/ConverterForm.cs
21 21
using System;
22 22
using System.Windows.Forms;
23 23
using Ingr.RAD2D;
24
using System.Runtime.InteropServices;
25
using System.Drawing;
24 26
using SPPID.Modeling;
25 27
using SPPID.Utill;
26 28
using SPPID.Model;
......
99 101
        /// <param name="e">Arguments passed during event</param>
100 102
        private void commandControl_Initialize(object sender, EventArgs e)
101 103
        {
102

  
104
            
103 105
        }
104 106

  
105 107
        /// <summary>
......
127 129
            commandControl.Done = true;
128 130
            e.Cancel = true; //Do not let C# close out the form ... Let RAD close it.
129 131
        }
132
        #endregion
133

  
134

  
135

  
136

  
137

  
138

  
139

  
140

  
141

  
142

  
143

  
144

  
130 145

  
131 146
        private void button1_Click(object sender, EventArgs e)
132 147
        {
......
141 156
                auto.Run();
142 157
            }
143 158
        }
159

  
160
        #region ?? CustomCommand Source ????
161

  
162
        private void openDocumentsToolStripMenuItem_Click(object sender, EventArgs e)
163
        {
164
            OpenFileDialog dia = new OpenFileDialog();
165
            dia.Multiselect = true;
166
            dia.Filter = "Xml(*.xml)|*.xml";
167
            if (dia.ShowDialog() == DialogResult.OK)
168
            {
169
                foreach (string fileName in dia.FileNames)
170
                {
171
                    SetDrawingTreeNode(fileName);
172
                }
173
                treeViewDrawing.Nodes[0].Expand();
174
            }
175
        }
176

  
177
        private void itemMappingToolStripMenuItem_Click(object sender, EventArgs e)
178
        {
179

  
180
        }
181

  
182
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
183
        {
184

  
185
        }
186
        private void convertToolStripMenuItem_Click(object sender, EventArgs e)
187
        {
188

  
189
        }
190

  
191
        private void stopToolStripMenuItem_Click(object sender, EventArgs e)
192
        {
193

  
194
        }
195

  
196

  
197
        #region TreeNode
198
        #region Hide TreeNode CheckBox
199
        private const int TVIF_STATE = 0x8;
200
        private const int TVIS_STATEIMAGEMASK = 0xF000;
201
        private const int TV_FIRST = 0x1100;
202
        private const int TVM_SETITEM = TV_FIRST + 63;
203

  
204
        [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
205
        private struct TVITEM
206
        {
207
            public int mask;
208
            public IntPtr hItem;
209
            public int state;
210
            public int stateMask;
211
            [MarshalAs(UnmanagedType.LPTStr)]
212
            public string lpszText;
213
            public int cchTextMax;
214
            public int iImage;
215
            public int iSelectedImage;
216
            public int cChildren;
217
            public IntPtr lParam;
218
        }
219

  
220
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
221
        private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam,
222
                                                 ref TVITEM lParam);
223

  
224
        /// <summary>
225
        /// Hides the checkbox for the specified node on a TreeView control.
226
        /// </summary>
227
        private void HideCheckBox(TreeView tvw, TreeNode node)
228
        {
229
            TVITEM tvi = new TVITEM();
230
            tvi.hItem = node.Handle;
231
            tvi.mask = TVIF_STATE;
232
            tvi.stateMask = TVIS_STATEIMAGEMASK;
233
            tvi.state = 0;
234
            SendMessage(tvw.Handle, TVM_SETITEM, IntPtr.Zero, ref tvi);
235
        }
236
        #endregion
237

  
238
        private void SetDrawingTreeNode(string fileName)
239
        {
240
            SPPID.Model.Document document = SPPID.Model.Document.Load(fileName);
241
            TreeNode drawingNode = new TreeNode();
242
            if (document == null)
243
            {
244
                drawingNode.Text = fileName;
245
                drawingNode.Name = fileName;
246
                drawingNode.ForeColor = Color.Red;
247
                treeViewDrawing.Nodes[0].Nodes.Add(drawingNode);
248
            }
249
            else
250
            {
251
                drawingNode.Text = document.DWGNAME;
252
                drawingNode.Name = document.DWGNAME;
253
                drawingNode.Tag = document;
254
                treeViewDrawing.Nodes[0].Nodes.Add(drawingNode);
255
            }
256

  
257
            SetItemTreeNode(drawingNode);
258
        }
259

  
260
        private void SetItemTreeNode(TreeNode drawingNode)
261
        {
262
            SPPID.Model.Document document = drawingNode.Tag as SPPID.Model.Document;
263
            if (document != null)
264
            {
265
                foreach (LineNumber item in document.LINENUMBERS)
266
                {
267
                    TreeNode node = new TreeNode();
268
                    node.Name = item.UID;
269
                    node.Text = item.TEXT;
270
                    if (string.IsNullOrEmpty(item.SPPIDMAPPINGNAME))
271
                        node.ForeColor = Color.Red;
272
                    else
273
                        node.ForeColor = Color.Gray;
274
                    drawingNode.Nodes.Add(node);
275
                    HideCheckBox(treeViewDrawing, node);
276
                }
277

  
278
                foreach (Symbol item in document.SYMBOLS)
279
                {
280
                    TreeNode node = new TreeNode();
281
                    node.Name = item.UID;
282
                    node.Text = item.NAME;
283
                    if (string.IsNullOrEmpty(item.SPPIDMAPPINGNAME))
284
                        node.ForeColor = Color.Red;
285
                    else
286
                        node.ForeColor = Color.Gray;
287
                    drawingNode.Nodes.Add(node);
288
                    HideCheckBox(treeViewDrawing, node);
289
                }
290

  
291
                foreach (Line item in document.LINES)
292
                {
293
                    TreeNode node = new TreeNode();
294
                    node.Name = item.UID;
295
                    node.Text = item.TYPE;
296
                    if (string.IsNullOrEmpty(item.SPPIDMAPPINGNAME))
297
                        node.ForeColor = Color.Red;
298
                    else
299
                        node.ForeColor = Color.Gray;
300
                    drawingNode.Nodes.Add(node);
301
                    HideCheckBox(treeViewDrawing, node);
302
                }
303

  
304
                foreach (Text item in document.TEXTS)
305
                {
306
                    TreeNode node = new TreeNode();
307
                    node.Name = item.UID;
308
                    node.Text = item.NAME;
309
                    if (string.IsNullOrEmpty(item.SPPIDMAPPINGNAME))
310
                        node.ForeColor = Color.Red;
311
                    else
312
                        node.ForeColor = Color.Gray;
313
                    drawingNode.Nodes.Add(node);
314
                    HideCheckBox(treeViewDrawing, node);
315
                }
316
            }
317
        }
318

  
319
        private bool DrawingValidationCheck(SPPID.Model.Document document)
320
        {
321
            bool result = false;
322

  
323

  
324

  
325
            return result;
326
        }
327

  
328

  
329
        #endregion
330

  
144 331
        #endregion
332

  
145 333
    }
146 334
}

내보내기 Unified diff