예제 #1
0
        private void LoadFirst()
        {
            // Проверка авторизации
            Properties.Settings settings = Properties.Settings.Default;
            Registered = Data.Authorization(settings.CopyOwner, settings.CopyKey);
            Bonus      = !Registered;

            string configfilename = Application.StartupPath + "\\config.ini";

            if (File.Exists(configfilename))
            {
                MemIniFile mif     = new MemIniFile(configfilename);
                string     section = "Application";
                mif.WriteInteger(section, "Station", Properties.Settings.Default.Station);
                mif.WriteString(section, "StartupPath", Application.StartupPath);
                mif.WriteBool(section, "Registered", Registered);
                mif.WriteBool(section, "Bonus", Bonus);
                string[] channels = Properties.Settings.Default.Channels.Split('\t');

                // Загрузка плагина точек KR500
                PointPlugin.LoadPlugin(Application.StartupPath + "\\Points.KR500.dll");

                FetchKR500Functions.StartFetch(
                    new Tuple <int, string[], string, exitApp, int>(
                        Properties.Settings.Default.Station,
                        channels, mif.ToString(), closeServer,
                        Properties.Settings.Default.TimeOut));
            }
        }
예제 #2
0
 protected virtual void SaveConfiguration()
 {
     try
     {
         MemIniFile iniFile = new MemIniFile(settingFileName);
         iniFile.Load();
         iniFile.WriteInteger("Settings", "Left", Left);
         iniFile.WriteInteger("Settings", "Top", Top);
         iniFile.WriteBool("Toy", "Enabled", ToyEnabled);
         OnSaveSettings(new IniFileAccessArgs(iniFile));
         iniFile.Save();
         iniFile.Dispose();
     }
     catch
     {
     }
 }
예제 #3
0
 public virtual void SaveConfiguration(MemIniFile ini)
 {
     if (!IsVirtual)
     {
         try
         {
             ini.WriteInteger(this.stoneID, "RunCount", RunCount);
             ini.WriteInteger(this.stoneID, "Rating", Rating);
             ini.WriteInteger(this.stoneID, "RunLevel", RunLevel);
             if (!string.IsNullOrEmpty(translationId))
             {
                 ini.WriteString(this.stoneID, "TranslationId", translationId);
             }
         }
         catch (Exception ex)
         {
             throw new StoneSettingsException(SR.WriteSettingsError, ex);
         }
     }
 }
예제 #4
0
        private void saveCustomReportProps()
        {
            //Data.SetReportProps(printReport.ReportName, printReport.PrintAuto,
            //    printReport.PrintTime, printReport.PrintPeriod);
            MemIniFile mif = new MemIniFile(String.Empty);

            mif.FromString(Properties.Settings.Default.ReportsConfig);
            mif.WriteString(internalname, "ReportName", printReport.ReportName);
            mif.WriteBool(internalname, "PrintAuto", printReport.PrintAuto);
            mif.WriteDate(internalname, "PrintTime", printReport.PrintTime);
            mif.WriteInteger(internalname, "PrintPeriod", printReport.PrintPeriod);
            //mif.UpdateFile();
            Properties.Settings settings = Properties.Settings.Default;
            settings.ReportsConfig = mif.ToString();
            settings.Save();
        }
예제 #5
0
        private void LoadFirst()
        {
            // Проверка авторизации
            Properties.Settings settings = Properties.Settings.Default;
            Registered = Data.Authorization(settings.CopyOwner, settings.CopyKey);
            Bonus      = !Registered;

            string configfilename = Application.StartupPath + "\\config.ini";

            if (File.Exists(configfilename))
            {
                MemIniFile mif     = new MemIniFile(configfilename);
                string     section = "Application";
                mif.WriteInteger(section, "Station", Properties.Settings.Default.Station);
                mif.WriteString(section, "StartupPath", Application.StartupPath);
                mif.WriteBool(section, "Registered", Registered);
                mif.WriteBool(section, "Bonus", Bonus);
                FetchVirtualFunctions.StartFetch(new Tuple <int, string, exitApp>(
                                                     Properties.Settings.Default.Station, mif.ToString(), closeServer));
            }
        }