void IReflectorPersistance.Save(XmlWriter w) { if (gs != null) { gs.Save(w); } w.WriteStartElement("PSI_Button"); if (NextPage != null) { w.WriteAttributeString("page", NextPage); } w.WriteAttributeString("text", Text); if (decal_name != null) { w.WriteAttributeString("decal", decal_name); w.WriteAttributeString("decal_Scale", DecalScale.ToString()); } //if( _FontTracker != null ) // w.WriteAttributeString( "font", _FontTracker.Name ); foreach (String system in AllowShow) { w.WriteElementString("allow", system); } foreach (String system in DisallowShow) { w.WriteElementString("disallow", system); } foreach (Object o in security_tags) { w.WriteStartElement("security"); w.WriteAttributeString("type", o.ToString()); IReflectorPersistance p = o as IReflectorPersistance; if (p != null) { p.Save(w); } w.WriteEndElement(); w.WriteRaw("\r\n"); } w.WriteEndElement(); w.WriteRaw("\r\n"); }
void IReflectorPersistance.Save(XmlWriter w) { w.WriteStartElement("Macro"); //w.WriteAttributeString( "Text", (Text!=null)?Text:"" ); foreach (osalot.AssemblyObject button in buttons) { w.WriteStartElement("Element"); w.WriteAttributeString("Assembly", core_common.GetRelativePath(button.t.Assembly.Location)); w.WriteAttributeString("Type", button.t.FullName); IReflectorPersistance persis = button.o as IReflectorPersistance; if (persis != null) { persis.Save(w); } w.WriteEndElement(); w.WriteRaw("\r\n"); } w.WriteEndElement(); w.WriteRaw("\r\n"); }
internal static void Save(XmlWriter w) { // but if read comes in from a certain place // then why doesn't write? // how is it on one side we have an object // and the other side we're creating objects... foreach (GlareSetData gsd in glaresets) { gsd.Save(w); } foreach (GlareSetAttributes gsa in glare_attribs) { gsa.Save(w); } foreach (object plugin in persistant_plugins) { // for all plugins that were loaded, if they have peristance // allow them to load... GlareSetData gsd = plugin as GlareSetData; if (gsd != null) // skip glare set:plugin save. { continue; } IReflectorPersistance persis = plugin as IReflectorPersistance; if (persis != null) { try { persis.Save(w); } catch { // might be 'not implemented' } } } foreach (String system in systems) { w.WriteElementString("systemname", system); } }
internal void save(XmlWriter w) { w.WriteStartElement("page"); w.WriteAttributeString("background", background_name); w.WriteAttributeString("title", Name); w.WriteAttributeString("color", background_color.ToArgb().ToString()); w.WriteAttributeString("x", this.partsX.ToString()); w.WriteAttributeString("y", this.partsY.ToString()); w.WriteRaw("\r\n"); foreach (ControlTracker c in this) { w.WriteStartElement("control"); w.WriteAttributeString("X", Convert.ToString(c.grid_rect.X)); w.WriteAttributeString("Y", Convert.ToString(c.grid_rect.Y)); w.WriteAttributeString("width", Convert.ToString(c.grid_rect.Width)); w.WriteAttributeString("height", Convert.ToString(c.grid_rect.Height)); String s; if (String.Compare(s = c.Type.Assembly.FullName, Assembly.GetCallingAssembly().FullName) == 0) { w.WriteAttributeString("assembly", ""); } else { w.WriteAttributeString("assembly", core.core_common.GetRelativePath(c.Type.Assembly.Location)); } w.WriteAttributeString("type", c.Type.FullName); font_tracker ft = FontEditor.GetFontTracker(c.c.Font); if (ft != null) { w.WriteAttributeString("font", ft.ToString()); } else { w.WriteAttributeString("font", "default"); } if (c.i != null) { string s2 = c.i.FullName; w.WriteAttributeString("interface", s2); } w.WriteRaw("\r\n"); IReflectorPersistance persis = c.o as IReflectorPersistance; if (persis != null) { persis.Save(w); } if (!c.real) { persis = c.c as IReflectorPersistance; if (persis != null) { persis.Save(w); } } w.WriteEndElement(); w.WriteRaw("\r\n"); } foreach (IReflectorSecurity s in this.security_tags) { IReflectorPersistance p = s as IReflectorPersistance; if (p != null) { w.WriteStartElement("Security"); p.Save(w); w.WriteEndElement(); } } w.WriteEndElement(); w.WriteRaw("\r\n"); }