コード例 #1
0
ファイル: myApps.cs プロジェクト: hjgode/todayPlugins
 public static void serialize(myApps myapps, string sXMLfile)
 {
     XmlSerializer xs = new XmlSerializer(typeof(myApps));
     //omit xmlns:xsi from xml output
     //Create our own namespaces for the output
     XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
     //Add an empty namespace and empty value
     ns.Add("", "");
     //StreamWriter sw = new StreamWriter("./SystemHealth.out.xml");
     StreamWriter sw = new StreamWriter(sXMLfile);
     xs.Serialize(sw, myapps, ns);
 }
コード例 #2
0
ファイル: myApps.cs プロジェクト: hjgode/todayPlugins
        private void readFile(String filename)
        {
            try
            {
                myApps mApps = new myApps();
                mApps = mApps.ReadFile(filename);

                foreach (myApps.myApp app in mApps._myApps)
                    myAppList.Add(app);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Exception in deserialize: " + ex.Message);
            }
        }