コード例 #1
0
ファイル: SettingsControl.cs プロジェクト: sillsdev/wesay
        ///*something left over from this class's predaccesor, which may be useful*/
        ////seems to help with some, not with others
        //private void TryToFixScaling(Control c)
        //{
        //    //this is part of dealing with .net not adjusting stuff well for different dpis
        //    c.Dock = DockStyle.None;
        //    c.Size = new Size(Width, Height - 25);
        //    // c.BackColor = System.Drawing.Color.Crimson;
        //}
        private void OnAreaButton_Click(object sender, EventArgs e)
        {
            ToolStripButton currentItem = null;

            foreach (ToolStripButton item in _areasToolStrip.Items)
            {
                if (item.Checked)
                {
                    currentItem = item;
                }
                item.Checked = false;
            }
            ToolStripButton button = (ToolStripButton)sender;

            button.Checked = true;

            if (currentItem != null)
            {
                _areaPanel.Controls.Remove((Control)(currentItem.Tag));
            }
            ConfigurationControlBase c = button.Tag as ConfigurationControlBase;

            if (c != null)
            {
                _areaPanel.Controls.Add(c);
                c.Location = new Point(10, _areaHeader.Height + 20);
                c.Width    = _areaPanel.Width - 20;
                c.Height   = _areaPanel.Height - (15 + c.Top);
                c.SetOtherStuff();

                _areaHeader.Text = "";
                _areaHeader.Font = new Font("Tahoma", 10F, FontStyle.Bold);
                _areaHeader.AppendText(button.Text + ": ");
                _areaHeader.SelectionFont = new Font("Tahoma", 10F, FontStyle.Regular);
                _areaHeader.AppendText(c.Header);
                FieldsControl fc = button.Tag as FieldsControl;
                if (fc != null)
                {
                    fc.RefreshFieldDisplayNames();
                }
                c.Focus();

                UsageReporter.SendNavigationNotice("settings/" + c.NameForUsageReporting);
            }
        }
コード例 #2
0
ファイル: SettingsControl.cs プロジェクト: sillsdev/wesay
        private void DisposeConfigurationControl(object controlToDispose)
        {
            ConfigurationControlBase control = controlToDispose as ConfigurationControlBase;

            control.Dispose();
        }