コード例 #1
0
 private void SaveState()
 {
     if (ExternalColourEditorInformationProvider != null)
     {
         ExternalColourEditorInformationProvider.SavePerUserPerWorkstationValue(StoreID + @".SchemesComboBox.SelectedIndex", schemesComboBox.SelectedIndex.ToString());
     }
 }
 /// <summary>
 /// Handles the FormClosing event of the <see cref="ColourEditorForm"/> control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Forms.FormClosingEventArgs"/>
 /// instance containing the event data.</param>
 private void ColourEditorForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (ExternalColourEditorInformationProvider != null)
     {
         ExternalColourEditorInformationProvider.SavePerUserPerWorkstationValue(
             StoreID + @".Width",
             Width.ToString());
         ExternalColourEditorInformationProvider.SavePerUserPerWorkstationValue(
             StoreID + @".Height",
             Height.ToString());
     }
 }
コード例 #3
0
        private void TabControl_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ExternalColourEditorInformationProvider != null)
            {
                ExternalColourEditorInformationProvider.SavePerUserPerWorkstationValue(
                    StoreID + @".TabControl.SelectedIndex",
                    tabControl.SelectedIndex.ToString());
            }

            if (NeedUpdateUI != null)
            {
                NeedUpdateUI(this, EventArgs.Empty);
            }
        }
コード例 #4
0
        /// <summary>
        /// Handles the Load event of the <see cref="ColourEditorUserControl"/> control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ColourEditorUserControl_Load(
            object sender,
            EventArgs e)
        {
            if (ExternalColourEditorInformationProvider != null && !_tabSet)
            {
                tabControl.SelectedIndex = Convert.ToInt32(
                    ExternalColourEditorInformationProvider.RestorePerUserPerWorkstationValue(
                        StoreID + @".TabControl.SelectedIndex",
                        tabControl.SelectedIndex.ToString()));
            }

            if (!AllowColourSchemes)
            {
                tabControl.TabPages.Remove(schemeColoursTabPage);
            }
        }
        /// <summary>
        /// Handles the Load event of the <see cref="ColourEditorForm"/> control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance
        /// containing the event data.</param>
        private void ColourEditorForm_Load(object sender, EventArgs e)
        {
            if (ExternalColourEditorInformationProvider != null)
            {
                Width = Convert.ToInt32(
                    ExternalColourEditorInformationProvider.RestorePerUserPerWorkstationValue(
                        StoreID + @".Width",
                        Width.ToString()));
                Height = Convert.ToInt32(
                    ExternalColourEditorInformationProvider.RestorePerUserPerWorkstationValue(
                        StoreID + @".Height",
                        Height.ToString()));
            }
            CenterToParent();

            buttonNoColour.Visible = ExternalColourEditorInformationProvider == null || ExternalColourEditorInformationProvider.AllowNoColourSelectable;
        }
コード例 #6
0
        private void SchemesColoUrEditorUserControl_Load(object sender, EventArgs e)
        {
            CheckEnsureFilled();

            if (_needEnsureVisibleListViewItem != null)
            {
                DoSelectItem(_needEnsureVisibleListViewItem);
            }
            else
            {
                // None selected, restore saved selected index.

                if (ExternalColourEditorInformationProvider != null)
                {
                    schemesComboBox.SelectedIndex = Convert.ToInt32(ExternalColourEditorInformationProvider.RestorePerUserPerWorkstationValue(StoreID + @".SchemesComboBox.SelectedIndex", schemesComboBox.SelectedIndex.ToString()));
                }
            }

            SaveState();
            _ignoreComboBoxChanges = false;

            ColoursListView_SizeChanged(null, null);
        }
コード例 #7
0
        /// <summary>
        /// Tries to set correct tab page.
        /// </summary>
        private void TryToSetCorrectTabPage(Color colour)
        {
            TabPage tabPage = null;

            if (colour == Color.Empty)
            {
                colour = Color.Transparent;
            }


            if (colour == Color.Transparent)
            {
                if (webColourEditorControl.ContainsColor(colour))
                {
                    tabPage = webColoursTabPage;
                }
            }
            else
            {
                var lookupOrder = new List <ColourLookupElement>(_defaultLookupOrder);

                if (ExternalColourEditorInformationProvider != null)
                {
                    ExternalColourEditorInformationProvider.AdjustColourSettingLookupOrder(
                        lookupOrder);

                    // Add again to be safe if the call should have removed some.
                    lookupOrder.AddRange(_defaultLookupOrder);
                }

                // --

                foreach (var element in lookupOrder)
                {
                    switch (element)
                    {
                    case ColourLookupElement.BROWSERSAFECOLOURS:
                        if (browserSafeColourEditorControl.ContainsColour(colour))
                        {
                            tabPage = browserSafeColoursTabPage;
                        }
                        break;

                    default:
                        tabPage = customColoursTabPage;
                        break;

                    case ColourLookupElement.SCHEMECOLOURS:
                        if (AllowColourSchemes &&
                            schemesColourEditorControl.ContainsColour(colour))
                        {
                            tabPage = schemeColoursTabPage;
                        }
                        break;

                    case ColourLookupElement.SYSTEMCOLOURS:
                        if (systemColourEditorControl.ContainsColour(colour))
                        {
                            tabPage = systemColoursTabPage;
                        }
                        break;

                    case ColourLookupElement.WEBCOLOURS:
                        if (webColourEditorControl.ContainsColor(colour))
                        {
                            tabPage = webColoursTabPage;
                        }
                        break;
                    }

                    if (tabPage != null)
                    {
                        break;
                    }
                }
            }

            if (tabPage == null)
            {
                tabPage = customColoursTabPage;
            }


            tabControl.SelectedTab = tabPage;
            _tabSet = true;
        }