示例#1
0
        public static FirstParameters CreateDefaultFirstParameters(string directoryToCurrentPluginInfo)
        {
            FirstParameters fp = new FirstParameters();
            RegistryKey     rk = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Explorer").OpenSubKey("Shell folders");

            fp.pathToViewParameters    = rk.GetValue("AppData").ToString() + @"\WinBalans\";
            fp.pathToCurrentPluginInfo = directoryToCurrentPluginInfo + "CyverAss.ini";
            fp.firstTimeStarted        = 0;
            return(fp);
        }
示例#2
0
        public General()
        {
            redr       = false;
            pluginlist = new ArrayList();
            tp         = new TempParameters();
            if ((FirstParameters.Load(tp.basedirectory)) != null)
            {
                fp = FirstParameters.Load(tp.basedirectory);
            }
            else
            {
                fp = FirstParameters.CreateDefaultFirstParameters(this.tp.basedirectory);
            }
            if (fp.firstTimeStarted == 1)
            {
                fp = FirstParameters.CreateDefaultFirstParameters(this.tp.basedirectory);
                pm = ViewParameters.CreateDefaultViewParameters();
                pi = PluginInfo.CreateDefaultPluginInfo();
            }
            else
            {
                try
                {
                    pm = ViewParameters.Load(fp.pathToViewParameters);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
                try
                {
                    pi = PluginInfo.Load(fp.pathToCurrentPluginInfo);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
            }

            Update_curas();
            InitializeComponent();
        }