Пример #1
0
        private void Reload()
        {
            string[] fontSizes = { "8",  "9",  "10", "11", "12", "14", "16", "18",
                                   "20", "22", "24", "26", "28", "30", "36", "48", "72" };

            FontFamily[] fontFamilies = new InstalledFontCollection().Families;
            fontFamiltyCB.Items.Clear();
            fontFamiltyCB.Items.AddRange(fontFamilies.Select(o => o.Name).ToArray());
            fontFamiltyCB.SelectedText = Runtime.MessageEditor.FontFamily.Name;

            fontSizeCB.Items.Clear();
            fontSizeCB.Items.AddRange(fontSizes);
            fontSizeCB.SelectedText = Runtime.MessageEditor.FontSize.ToString();
        }
Пример #2
0
        // Loading
        private void LoadForm()
        {
            // Fonts
            string[]     fontSizes    = new string[] { "8", "9", "10", "11", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30", "36", "48", "72" };
            FontFamily[] fontFamilies = new InstalledFontCollection().Families;

            scbFontFamily.SelectedIndexChanged -= new EventHandler(scbFontFamily_SelectedIndexChanged);
            scbFontFamily.TextChanged          -= new EventHandler(scbFontFamily_TextChanged);

            scbFontFamily.Items.Clear();
            scbFontFamily.Items.AddRange(fontFamilies.Select(o => o.Name).ToArray());
            scbFontFamily.Text = Settings.Default.FontFamily;

            scbFontFamily.SelectedIndexChanged += new EventHandler(scbFontFamily_SelectedIndexChanged);
            scbFontFamily.TextChanged          += new EventHandler(scbFontFamily_TextChanged);

            scbFontSize.SelectedIndexChanged -= new EventHandler(scbFontSize_SelectedIndexChanged);
            scbFontSize.TextChanged          -= new EventHandler(scbFontSize_TextChanged);

            scbFontSize.Items.Clear();
            scbFontSize.Items.AddRange(fontSizes);
            scbFontSize.Text = Settings.Default.FontSize;

            scbFontSize.SelectedIndexChanged += new EventHandler(scbFontSize_SelectedIndexChanged);
            scbFontSize.TextChanged          += new EventHandler(scbFontSize_TextChanged);

            SetFont();

            // Tools
            UI.CompressionTools.LoadCompressionTools(compressionToolStripMenuItem);

            // Extensions
            if (_extensions.Count > 0)
            {
                extensionsToolStripMenuItem.DropDownItems.Clear();

                foreach (IExtension extension in _extensions)
                {
                    ToolStripMenuItem tsiExtension = new ToolStripMenuItem(extension.Name, extension.Icon, extensionsToolStripMenuItems_Click);
                    tsiExtension.Tag = extension;
                    extensionsToolStripMenuItem.DropDownItems.Add(tsiExtension);
                }
            }
        }