//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); ((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); 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); }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); 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.setInstanceName(xml.SelectSingleNode("//name").InnerText); }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((CAudioAtt)(Attributs)).AudioURL = ((CAudioAtt)(control.getAttList())).AudioURL; /*try * { * Bitmap img = new Bitmap(((CAudioAtt)(Attributs)).AudioURL); * ImgBackground = img; * Ctrl.BackgroundImage = ImgBackground; * } * catch { };*/ }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((C3DObjectAtt)(Attributs)).Md2URL = ((C3DObjectAtt)(control.getAttList())).Md2URL; ((C3DObjectAtt)(Attributs)).TextureURL = ((C3DObjectAtt)(control.getAttList())).TextureURL; try { Bitmap img = new Bitmap(((C3DObjectAtt)(Attributs)).TextureURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { }; }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((CVideoAtt)(Attributs)).VideoURL = ((CVideoAtt)(control.getAttList())).VideoURL; try { Bitmap img = new Bitmap(((CVideoAtt)(Attributs)).VideoURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { loadBackgroundAndICO(); Ctrl.BackgroundImage = ImgBackground; }; }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); //((CMarkerAtt)(Attributs)).MarkerURL = ((CMarkerAtt)(control.getAttList())).MarkerURL; //try //{ // Bitmap img = new Bitmap(((CMarkerAtt)(Attributs)).MarkerURL); // ImgBackground = img; // Ctrl.BackgroundImage = ImgBackground; //} //catch { // loadBackgroundAndICO(); // Ctrl.BackgroundImage = ImgBackground; //}; }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); foreach (PictureList p in ((CPictureCollectionAtt)control.getAttList()).PictureURLList) { ((CPictureCollectionAtt)Attributs).PictureURLList.Add(p); } try { System.Drawing.Bitmap img = new System.Drawing.Bitmap(((CPictureCollectionAtt)Attributs).PictureURLList[0].PictureURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { loadBackgroundAndICO(); Ctrl.BackgroundImage = ImgBackground; }; }
public void updateAttributeValueBase(string strAttName, object objAttValue) { switch (strAttName) { case "YLocation": Attributs.setLocation(new Point(Attributs.getLocation().X, (int)objAttValue)); break; case "XLocation": Attributs.setLocation(new Point((int)objAttValue, Attributs.getLocation().Y)); break; case "Width": Attributs.setSize(new Size((int)objAttValue, Attributs.getSize().Height)); break; case "Height": Attributs.setSize(new Size(Attributs.getSize().Width, (int)objAttValue)); ctrl.Invalidate(); break; } }