프로젝트

일반

사용자정보

개정판 30d2cfcc

ID30d2cfcc1b954acc72b9a0cc85dbfb9fafb15146
상위 1421f1d6
하위 17d9dc0d

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : edit read xml and ChildSymbol 설정 추가

Change-Id: Iba7d86dc217eb2903c71ca9af44e65fb7de68927

차이점 보기:

DTI_PID/BaseModel/Model/Document.cs
61 61
                Symbol symbol = new Symbol()
62 62
                {
63 63
                    UID = item.Element("UID").Value,
64
                    DBUID = item.Element("DBUID").Value,
64 65
                    NAME = item.Element("NAME").Value,
65 66
                    TYPE = item.Element("TYPE").Value,
66 67
                    OWNER = item.Element("OWNER").Value,
......
80 81
                SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT);
81 82
                SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES);
82 83
                SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES);
83

  
84
                //// Child
85
                //if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
86
                //{
87
                //    string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
88
                //    for (int i = 0; i < array.Length; i++)
89
                //    {
90
                //        string[] arrConn = array[i].Split(new char[] { ',' });
91
                //        symbol.CONNECTORS[i].INDEX = Convert.ToInt32(arrConn[3]);
92
                //    }
93
                //}
84
                SetChildSymbol(symbol);
94 85

  
95 86
                SYMBOLS.Add(symbol);
96 87
            }
......
107 98
                    STARTPOINT = item.Element("STARTPOINT").Value,
108 99
                    ENDPOINT = item.Element("ENDPOINT").Value,
109 100
                    TYPE = item.Element("TYPE").Value,
101
                    TYPEUID = item.Element("TYPE").Attribute("TYPEUID").Value,
110 102
                    AREA = item.Element("AREA").Value,
111 103
                    THICKNESS = item.Element("THICKNESS").Value,
112 104
                };
......
224 216
        {
225 217
            foreach (XElement item in node.Elements("PROPERTY"))
226 218
            {
227
                try
228
                {
229
                    properties.Add(new Property()
230
                    {
231
                        UID = item.Attribute("UID").Value,
232
                        LENGTH = item.Attribute("Length").Value,
233
                        EXPRESSION = item.Attribute("Expression").Value,
234
                        DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
235
                        ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
236
                        ATTRIBUTE = item.Attribute("Attribute").Value,
237
                        VALUE = item.Value
238
                    });
239
                }
240
                catch (Exception ex)
219
                properties.Add(new Property()
241 220
                {
242

  
243
                }
221
                    UID = item.Attribute("UID").Value,
222
                    LENGTH = item.Attribute("Length").Value,
223
                    EXPRESSION = item.Attribute("Expression").Value,
224
                    DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
225
                    ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
226
                    ATTRIBUTE = item.Attribute("Attribute").Value,
227
                    VALUE = item.Value
228
                });
244 229
            }
245 230
        }
246 231

  
247 232
        private void SetAttributes(XElement node, List<Attribute> attributes)
248 233
        {
249
            foreach (XElement item in node.Elements("PROPERTY"))
234
            foreach (XElement item in node.Elements("ATTRIBUTE"))
250 235
            {
251 236
                attributes.Add(new Attribute()
252 237
                {
......
256 241
                    DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
257 242
                    ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
258 243
                    ATTRIBUTE = item.Attribute("Attribute").Value,
244
                    ATTRAT = item.Attribute("AttrAt").Value,
259 245
                    VALUE = item.Value
260 246
                });
261 247
            }
......
284 270
                lineNumberRuns.Add(run);
285 271
            }
286 272
        }
273

  
274
        private void SetChildSymbol(Symbol symbol)
275
        {
276
            List<ChildSymbol> childList = new List<ChildSymbol>();
277
            if (!string.IsNullOrEmpty(symbol.CHILD) && symbol.CHILD != "None")
278
            {
279
                string[] childArray = symbol.CHILD.Split(new char[] { '/' });
280
                foreach (string sChild in childArray)
281
                {
282
                    string[] sChildInfo = sChild.Split(new char[] { ',' });
283
                    childList.Add(new ChildSymbol()
284
                    {
285
                        ParentAt = Convert.ToInt32(sChildInfo[0]),
286
                        Direction = sChildInfo[1],
287
                        NAME = sChildInfo[2]
288
                    });
289
                }
290

  
291
                foreach (ChildSymbol child in childList)
292
                {
293
                    if (child.ParentAt == 0)
294
                        symbol.ChildSymbols.Add(child);
295
                    else
296
                        childList[child.ParentAt - 1].ChildSymbols.Add(child);
297
                }
298
            }
299
            if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
300
            {
301
                string[] connectionArray = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
302
                string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
303
                for (int i = 0; i < array.Length; i++)
304
                {
305
                    string[] arrConn = array[i].Split(new char[] { ',' });
306
                    int connIndex = Convert.ToInt32(arrConn[3]);
307
                    if (connIndex != 0)
308
                        childList[connIndex - 1].Connectors.Add(symbol.CONNECTORS[i]);
309
                }
310
            }
311
        }
287 312
        #endregion
288 313

  
289 314
        public Symbol GetSymbolByUID(string uid)

내보내기 Unified diff

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