コード例 #1
0
        private void saveData(string configfile)
        {
            GWSettings settingsManager = new GWSettings();
            string     configFile      = settingsManager.GetSetting(configfile, "connectionInfo", "");
            string     xmloutput       = dataTable.toXml();

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(configFile))
            {
                file.WriteLine(xmloutput);
            }
        }
コード例 #2
0
        private void loadData(string configfile)
        {
            GWSettings settingsManager = new GWSettings();
            string     configFile      = settingsManager.GetSetting(configfile, "connectionInfo", "");

            if (File.Exists(configFile))
            {
                string xmlData = File.ReadAllText(configFile);
                dataTable = new GWDataTable("", "root", defaultObj);
                dataTable.loadXml(xmlData);
            }
            return;
        }
コード例 #3
0
        public GWDataIOInterface getInstance(string configfile)
        {
            GWSettings settingsManger = new GWSettings();
            string     objType        = settingsManger.GetSetting(configfile, "IOTYPE", "test", "");

            try
            {
                Type t = Type.GetType(objType);
                GWDataIOInterface retval = (GWDataIOInterface)Activator.CreateInstance(t, configfile, defaultObj);
                return(retval);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
            return(null);
        }