コード例 #1
0
ファイル: MainForm.cs プロジェクト: donatazz/l2datencdec
        public void Config_Load()
        {
            // form and controls
            //Program.config.LoadFormState(this, "main_form");
            this.selectedDatVersion          = (DatVersion)Program.config.ChronicleSetting;
            this.DirectoryDialog.Description = Program.language.getMessage(MsgList.DirectoryDialog_Desc);

            // Check DatFile Directory
            if (!Directory.Exists(Program.config.LineAgeDirectory))
            {
                new MessageBox(Program.language.getMessage(MsgList.SystemDir_Error), true);

                Program.config.LoadLastFolder(this.DirectoryDialog, "DirectoryDialog");
                if (this.DirectoryDialog.ShowDialog() == DialogResult.OK)
                {
                    Program.config.SaveLastFolder(this.DirectoryDialog, "DirectoryDialog");
                    Program.config.LineAgeDirectory = this.DirectoryDialog.SelectedPath;
                }
            }

            if (!Directory.Exists(Program.config.LineAgeDirectory))
            {
                this.MenuL2encdecTools.Enabled = false;
            }
        }
コード例 #2
0
        public SelectDialog()
        {
            InitializeComponent();
            Array a = Enum.GetValues(typeof(DatVersion));

            int point = DIFF;

            for (int i = 0; i < a.Length; i++)
            {
                DatVersion f = (DatVersion)a.GetValue(i);

                JButton b = new JButton();
                b.DescriptionText  = "";
                b.Font             = new Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                b.HeaderText       = Enum.GetName(typeof(DatVersion), f).Replace("__", "/").Replace("_", " ");
                b.ImageScalingSize = new System.Drawing.Size(16, 16);

                b.Location = new System.Drawing.Point(DIFF, point);
                point     += HEIGHT_BUTTON + DIFF;
                b.Size     = new Size(WIDTH_BUTTON, HEIGHT_BUTTON);
                b.TabIndex = i;
                b.Tag      = f;
                b.Click   += new EventHandler(b_Click);
                Controls.Add(b);
            }
            point += DIFF * 2;

            Size = new Size(WIDTH_BUTTON + DIFF * 2, point);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: donatazz/l2datencdec
        private void MenuOption_Click(object sender, EventArgs e)
        {
            OptionForm dlg = new OptionForm();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                this.selectedDatVersion = (DatVersion)Program.config.ChronicleSetting;
                Program.language.Reload();
                this.Forms_Init(true);
                this.Forms_Update();
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: jalona/l2divine-script
        public void Config_Load()
        {
            // form and controls
            //Program.config.LoadFormState(this, "main_form");
            this.selectedDatVersion = (DatVersion)Program.config.ChronicleSetting;
            this.DirectoryDialog.Description = Program.language.getMessage(MsgList.DirectoryDialog_Desc);

            // Check DatFile Directory
            if (!Directory.Exists(Program.config.LineAgeDirectory))
            {
                new MessageBox(Program.language.getMessage(MsgList.SystemDir_Error), true);

                Program.config.LoadLastFolder(this.DirectoryDialog, "DirectoryDialog");
                if (this.DirectoryDialog.ShowDialog() == DialogResult.OK)
                {
                    Program.config.SaveLastFolder(this.DirectoryDialog, "DirectoryDialog");
                    Program.config.LineAgeDirectory = this.DirectoryDialog.SelectedPath;
                }
            }

            if (!Directory.Exists(Program.config.LineAgeDirectory))
                this.MenuL2encdecTools.Enabled = false;
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: jalona/l2divine-script
 private void MenuOption_Click(object sender, EventArgs e)
 {
     OptionForm dlg = new OptionForm();
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         this.selectedDatVersion = (DatVersion)Program.config.ChronicleSetting;
         Program.language.Reload();
         this.Forms_Init(true);
         this.Forms_Update();
     }
 }
コード例 #6
0
ファイル: RConfig.cs プロジェクト: VISTALL/path-editor
        public void load()
        {
            RegistryKey key = Registry.CurrentUser;
            key = key.OpenSubKey(KEY);
            if (key == null)
            {
                key = Registry.CurrentUser;
                key = key.CreateSubKey(KEY);
            }
            else
            {
                _textEncoding = (String) key.GetValue("TextEncoding", "UTF-8");
                _language = (String) key.GetValue("Language", "english.xml");
                _datVersion =  (DatVersion) Enum.Parse(typeof (DatVersion), (String) key.GetValue("DatVersion", "Interlude"));
                _useTray = Boolean.Parse((String) key.GetValue("UseTray", "false"));
                _miniOnStart = Boolean.Parse((String) key.GetValue("MinimizeOnStart", "false"));
                _lineageDirectory = (String) key.GetValue("LineageDirectory", "");
                _saveBakFile = Boolean.Parse((String) key.GetValue("SaveBakFile", "true"));
                _fileToRun = (String) key.GetValue("FileToRun", "");
                _colorEditor = Color.FromArgb(int.Parse((String) key.GetValue("ListR", "64")),
                                              int.Parse((String) key.GetValue("ListG", "64")),
                                              int.Parse((String) key.GetValue("ListB", "64")));

                RegistryKey sub = Registry.CurrentUser;
                sub = sub.OpenSubKey(KEY + "\\LastFolders");

                if (sub != null)
                {
                    foreach (String val in sub.GetValueNames())
                    {
                        String value = sub.GetValue(val) as String;

                        addLastFolder(value);
                    }
                }

                sub = Registry.CurrentUser;
                sub = sub.OpenSubKey(KEY + "\\ColumnSizes");

                if (sub != null)
                {
                    foreach (String subkey in sub.GetSubKeyNames())
                    {
                        if (subkey == null)
                            return;

                        sub = Registry.CurrentUser;
                        sub = sub.OpenSubKey(KEY + "\\ColumnSizes\\" + subkey);

                        if (sub != null)
                        {
                            if (!_columnSize.ContainsKey(subkey))
                            {
                                _columnSize[subkey] = new Dictionary<string, int>();
                            }

                            foreach (String value in sub.GetValueNames())
                            {
                                _columnSize[subkey].Add(value, (int)sub.GetValue(value, 0));
                            }
                        }
                    }
                }
            }
        }
コード例 #7
0
        public void load()
        {
            RegistryKey key = Registry.CurrentUser;

            key = key.OpenSubKey(KEY);
            if (key == null)
            {
                key = Registry.CurrentUser;
                key = key.CreateSubKey(KEY);
            }
            else
            {
                _textEncoding     = (String)key.GetValue("TextEncoding", "UTF-8");
                _language         = (String)key.GetValue("Language", "english.xml");
                _datVersion       = (DatVersion)Enum.Parse(typeof(DatVersion), (String)key.GetValue("DatVersion", "Interlude"));
                _useTray          = Boolean.Parse((String)key.GetValue("UseTray", "false"));
                _miniOnStart      = Boolean.Parse((String)key.GetValue("MinimizeOnStart", "false"));
                _lineageDirectory = (String)key.GetValue("LineageDirectory", "");
                _saveBakFile      = Boolean.Parse((String)key.GetValue("SaveBakFile", "true"));
                _fileToRun        = (String)key.GetValue("FileToRun", "");
                _colorEditor      = Color.FromArgb(int.Parse((String)key.GetValue("ListR", "64")),
                                                   int.Parse((String)key.GetValue("ListG", "64")),
                                                   int.Parse((String)key.GetValue("ListB", "64")));


                RegistryKey sub = Registry.CurrentUser;
                sub = sub.OpenSubKey(KEY + "\\LastFolders");

                if (sub != null)
                {
                    foreach (String val in sub.GetValueNames())
                    {
                        String value = sub.GetValue(val) as String;

                        addLastFolder(value);
                    }
                }

                sub = Registry.CurrentUser;
                sub = sub.OpenSubKey(KEY + "\\ColumnSizes");

                if (sub != null)
                {
                    foreach (String subkey in sub.GetSubKeyNames())
                    {
                        if (subkey == null)
                        {
                            return;
                        }

                        sub = Registry.CurrentUser;
                        sub = sub.OpenSubKey(KEY + "\\ColumnSizes\\" + subkey);

                        if (sub != null)
                        {
                            if (!_columnSize.ContainsKey(subkey))
                            {
                                _columnSize[subkey] = new Dictionary <string, int>();
                            }

                            foreach (String value in sub.GetValueNames())
                            {
                                _columnSize[subkey].Add(value, (int)sub.GetValue(value, 0));
                            }
                        }
                    }
                }
            }
        }