public override bool FromXml(CLCIXML xml) { if (!base.FromXml(xml)) { return(false); } string s = ""; xml.get_attribute("slideleft", ref s); this.SlideLeft.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("slidelefthold", ref s); this.SlideLeftHold.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("slideright", ref s); this.SlideRight.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("sliderighthold", ref s); this.SlideRightHold.SetKeyCodeString(s); return(true); }
public override bool FromXml(CLCIXML xml) { if (!base.FromXml(xml)) { return(false); } string s = ""; xml.get_attribute("slideup", ref s); this.SlideUp.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("slideuphold", ref s); this.SlideUpHold.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("slidedown", ref s); this.SlideDown.SetKeyCodeString(s); s = string.Empty; xml.get_attribute("slidedownhold", ref s); this.SlideDownHold.SetKeyCodeString(s); return(true); }
public override void Export(int nLayerIndex, CLCIXML xml) { base.Export(nLayerIndex, xml); xml.new_attribute("keycode", this.KeyCode.ToString()); xml.new_attribute("capseffect", this.CapsEffect.ToString()); xml.back_to_parent(); }
public override void Export(int nLayerIndex, CLCIXML xml) { base.Export(nLayerIndex, xml); xml.new_attribute("slideleft", this.SlideLeft.ToString()); xml.new_attribute("slidelefthold", this.SlideLeftHold.ToString()); xml.new_attribute("slideright", this.SlideRight.ToString()); xml.new_attribute("sliderighthold", this.SlideRightHold.ToString()); xml.back_to_parent(); }
public override void Export(int nLayerIndex, CLCIXML xml) { base.Export(nLayerIndex, xml); xml.new_attribute("slideup", this.SlideUp.ToString()); xml.new_attribute("slideuphold", this.SlideUpHold.ToString()); xml.new_attribute("slidedown", this.SlideDown.ToString()); xml.new_attribute("slidedownhold", this.SlideDownHold.ToString()); xml.back_to_parent(); }
public override bool FromXml(CLCIXML xml) { if (!base.FromXml(xml)) { return(false); } string s = ""; xml.get_attribute("keycode", ref s); this.KeyCode.SetKeyCodeString(s); s = "false"; xml.get_attribute("capseffect", ref s); this.CapsEffect = bool.Parse(s); return(true); }
/************************************************************************/ /* * export data to xml file. */ /************************************************************************/ public override void Export(int nLayerIndex, CLCIXML xml) { //create this matrix base.Export(nLayerIndex, xml); //export its entities xml.set_attribute("rows", this.Rows.ToString()); xml.set_attribute("rowspacing", this.RowSpacing.ToString()); xml.set_attribute("cols", this.Cols.ToString()); xml.set_attribute("colspacing", this.ColSpacing.ToString()); xml.set_attribute("count", this.Entities.Count.ToString()); for (int i = 0; i < this.Entities.Count; i++) { DiagramEntity entity = this.Entities[i]; entity.Export(i, xml); } xml.back_to_parent(); }
public override void ExportToXml(CLCIXML xml) /* ============================================================ * Function : ExportToXml * Description : Saves a string representation of the * container (normally the virtual size) and * all objects to "stra". * Access : Public * * Return : void * Parameters : CStringArray& stra - The array to fill * * Usage : Call to save the data of the editor to a * XML. * * ============================================================*/ { xml.new_group("screen", true); xml.new_attribute("image", DiagramKey.ImageToBase64(this.Image, ImageFormat.Png)); xml.new_attribute("bg", ColorTranslator.ToWin32(this.BackColor).ToString()); xml.new_attribute("borderbg", ColorTranslator.ToWin32(this.BorderColor).ToString()); xml.new_attribute("interchardelay", this.InterCharDelay.ToString()); xml.new_attribute("sensitivity", this.Sensitivity.ToString()); xml.new_attribute("touchdelay", this.TouchDelay.ToString()); xml.new_attribute("macro1", this.Macro1.ToString()); xml.new_attribute("macro2", this.Macro2.ToString()); xml.new_attribute("macro3", this.Macro3.ToString()); xml.new_attribute("macro4", this.Macro4.ToString()); xml.new_attribute("macro5", this.Macro5.ToString()); xml.new_attribute("count", m_objs.GetSize().ToString()); xml.back_to_parent(); m_objs.ExportToXml(xml); this.Modified = false;; // SetModified(FALSE); }
public override bool ImportFromXml(CLCIXML xml) /* ============================================================ * Function : ImportFromXml * Description : Load configuration from application self xml file. * Access : Public * * Return : bool - "true" if "str" is a * representation of a * 'paper'. * Parameters : const string& str - String representation. * * Usage : Call to set the size of the virtual paper * from a string. * * ============================================================*/ { //load background color xml.back_to_root(); if (!xml.get_first_group("screen")) { return(false); } string s = ""; xml.get_attribute("image", ref s); if (s.Length > 0) { this._Image = DiagramKey.Base64ToImage(s); } string strVal = string.Empty; xml.get_attribute("bg", ref strVal); //if (strVal == string.Empty) // strVal = "16777215"; Color c = System.Drawing.ColorTranslator.FromWin32(Util.string2int(strVal, 16777215)); this.BackColor = c; strVal = string.Empty; xml.get_attribute("borderbg", ref strVal); //if (strVal == string.Empty) // strVal = "16777215"; Color clr = System.Drawing.ColorTranslator.FromWin32(Util.string2int(strVal, 16777215)); this.BorderColor = clr; strVal = ""; xml.get_attribute("interchardelay", ref strVal); this.InterCharDelay = Util.string2int(strVal, 50);//.ToString()); strVal = ""; xml.get_attribute("sensitivity", ref strVal); this.Sensitivity = Util.string2int(strVal, 50);//.ToString()); strVal = ""; xml.get_attribute("touchdelay", ref strVal); this.TouchDelay = Util.string2int(strVal, 50);//.ToString()); strVal = ""; xml.get_attribute("macro1", ref strVal); this.Macro1.SetKeyCodeString(strVal); strVal = ""; xml.get_attribute("macro2", ref strVal); this.Macro2.SetKeyCodeString(strVal); strVal = ""; xml.get_attribute("macro3", ref strVal); this.Macro3.SetKeyCodeString(strVal); strVal = ""; xml.get_attribute("macro4", ref strVal); this.Macro4.SetKeyCodeString(strVal); strVal = ""; xml.get_attribute("macro5", ref strVal); this.Macro5.SetKeyCodeString(strVal); ////////////// xml.get_attribute("count", ref strVal); int nCount = int.Parse(strVal); xml.back_to_parent(); bool result = m_objs.ImportFromXml(xml, nCount); m_objs.ClearRedo(); m_objs.ClearUndo(); Refresh(); return(result); }
/// <summary> /// Load data from xml file. /// </summary> /// <param name="xml"></param> /// <returns></returns> public override bool FromXml(CLCIXML xml) { //load my entity properites if (!base.FromXml(xml)) { return(false); } //load sub entities string s = ""; xml.get_attribute("rows", ref s); this.Rows = Util.string2int(s, 0); xml.get_attribute("rowspacing", ref s); this.RowSpacing = Util.string2int(s, 0); xml.get_attribute("cols", ref s); this.Cols = Util.string2int(s, 0); xml.get_attribute("colspacing", ref s); this.ColSpacing = Util.string2int(s, 0); xml.get_attribute("count", ref s); int ncount = Util.string2int(s, 0); this.Entities.Clear(); for (int i = 0; i < ncount; i++) { s = "k" + i.ToString(); if (!xml.get_first_group(s)) { continue; } s = ""; xml.get_attribute("keytype", ref s); DiagramEntity k = null; switch (s) { case DiagramKey.KEY_BUTTON: // "BUTTON": { k = new DiagramKeyArea(); k.FromXml(xml); } break; case DiagramKey.KEY_SLIDEV: { k = new DiagramKeySlideV(); k.FromXml(xml); } break; case DiagramKey.KEY_SLIDEH: { k = new DiagramKeySlideH(); k.FromXml(xml); } break; default: continue; } xml.back_to_parent(); k.OnEntityPropertiesChanged += new EventEntityPropertiesChanged(OnSubEntityPropertiesChanged); k.OnEntityPropertiesBeforeChange += new DiagramEntity.EventEntityPropertiesBeforeChange(OnSubEntityPropertiesWillChange); this.Entities.Add(k); } return(true); }