//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); ((CPictureCollectionAtt)(Attributs)).PictureURLList = new List <PictureList>(); foreach (XmlNode n in xml.SelectNodes("//uri")) { PictureList p = new PictureList(); string strTemp = n.InnerText; if (strTemp != "(none)") { p.PictureURL = path + strTemp; } else { p.PictureURL = "(none)"; } ((CPictureCollectionAtt)(Attributs)).PictureURLList.Add(p); } try { System.Drawing.Bitmap img = new System.Drawing.Bitmap(((CPictureCollectionAtt)Attributs).PictureURLList[0].PictureURL); this.ImgBackground = img; this.Ctrl.BackgroundImage = ImgBackground; } catch { }; Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); string strTemp = xml.SelectSingleNode("//uri").InnerText; if (strTemp != "(none)") { ((CPictureAtt)(Attributs)).PictureURL = path + strTemp; } else { ((CPictureAtt)(Attributs)).PictureURL = "(none)"; } Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); try { Bitmap img = new Bitmap(((CPictureAtt)Attributs).PictureURL); this.ImgBackground = img; this.Ctrl.BackgroundImage = ImgBackground; } catch { }; }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); XmlNodeList n = xml.SelectNodes("//uri"); string strTemp = n[0].InnerText; if (strTemp != "(none)") { ((C3DObjectAtt)(Attributs)).Md2URL = path + strTemp; } else { ((C3DObjectAtt)(Attributs)).Md2URL = "(none)"; } strTemp = n[1].InnerText; if (strTemp != "(none") { ((C3DObjectAtt)(Attributs)).TextureURL = path + strTemp; } else { ((C3DObjectAtt)(Attributs)).TextureURL = "(none)"; } Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); }