예제 #1
0
 public static string Serialize(Skin skin)
 {
     if (!skin.isValid)
     {
         return(string.Empty);
     }
     try
     {
         skin.Properties = GZip.Compress(skin.Properties);
         SkinImpl      si = (SkinImpl)skin;
         XmlSerializer xs = new XmlSerializer(typeof(SkinImpl));
         StringWriter  sw = new StringWriter();
         xs.Serialize(sw, si);
         sw.Close();
         return(sw.GetStringBuilder().ToString());
     }
     catch (Exception) { }
     return(string.Empty);
 }
예제 #2
0
 public static string Serialize(Skin skin, DebugDelegate deb)
 {
     if (!skin.isValid)
     {
         return(string.Empty);
     }
     try
     {
         skin.Properties = skin.Properties;
         SkinImpl      si = (SkinImpl)skin;
         XmlSerializer xs = new XmlSerializer(typeof(SkinImpl));
         StringWriter  sw = new StringWriter();
         xs.Serialize(sw, si);
         sw.Close();
         return(sw.GetStringBuilder().ToString());
     }
     catch (Exception ex)
     {
         debug(deb, "Error saving skin: " + ex.Message + ex.StackTrace);
     }
     return(string.Empty);
 }
예제 #3
0
        void loadskin(string fn)
        {
            // load skin
            SkinImpl skn = new SkinImpl();
            bool ok = Util.FromFile<SkinImpl>(fn,ref skn,debug);
            // load tickfiles from skin
            foreach (string file in skn.TickFiles)
                loadfile(file);

            // load response
            myres = (Response)SkinImpl.DeskinFile(fn, debug);

        }