static void OnLocationChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            StorageLocationPicker p = o as StorageLocationPicker;

            if (p != null)
            {
                PropertyStorageLocations location = (PropertyStorageLocations)e.NewValue;
                p.IsUserFile = (location & PropertyStorageLocations.UserFile) == PropertyStorageLocations.UserFile;
                switch (location & PropertyStorageLocations.ConfigurationAndPlatformSpecific)
                {
                case PropertyStorageLocations.ConfigurationSpecific:
                    p.EllipseBackground = Brushes.Blue;
                    break;

                case PropertyStorageLocations.PlatformSpecific:
                    p.EllipseBackground = Brushes.Red;
                    break;

                case PropertyStorageLocations.ConfigurationAndPlatformSpecific:
                    p.EllipseBackground = Brushes.Violet;
                    break;

                default:
                    p.EllipseBackground = Brushes.Black;
                    break;
                }
                if (p.contextMenu != null)
                {
                    p.SetIsCheckedOnMenu(location);
                }
            }
        }
示例#2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.location = ((ICSharpCode.SharpDevelop.Gui.OptionPanels.StorageLocationPicker)(target));
                return;

            case 2:
                this.editor = ((ICSharpCode.SharpDevelop.Gui.StringListEditor)(target));
                return;
            }
            this._contentLoaded = true;
        }