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 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("keycode", ref s); this.KeyCode.SetKeyCodeString(s); s = "false"; xml.get_attribute("capseffect", ref s); this.CapsEffect = bool.Parse(s); return(true); }
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); }