Esempio n. 1
0
        // : this(owner, category.GetGroupName())  //!!! dmh - switch to displayAttribute & use GetGroupName so it will use resource string if present
        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryItem"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="category">The category.</param>
        public CategoryItem(PropertyGrid owner, DisplayAttribute category)
        {
            Owner = owner;
            if (!string.IsNullOrEmpty(category.GroupName))
            {
                if (category.ResourceType != null)
                {
                    try		{ Name = category.GetGroupName(); }
                    catch	{ Name = category.GroupName; }
                }
                else Name = category.GroupName;
            }
            Attribute = category;

            // !!! dmh - be sure to get order from the display attribute for category as well.
            /* do not use order from display attribute for category! use CategoryOrderAttribute
            try
            {
                int? orderAttempt = category.GetOrder();
                if (orderAttempt.HasValue)
                    order = orderAttempt.Value;
            }
            catch { }
            */
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.console = ((PythonConsoleControl.IronPythonConsoleControl)(target));
                return;

            case 2:

            #line 36 "..\..\IronPythonControl.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.openFileClick);

            #line default
            #line hidden
                return;

            case 3:

            #line 39 "..\..\IronPythonControl.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.saveFileClick);

            #line default
            #line hidden
                return;

            case 4:

            #line 73 "..\..\IronPythonControl.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.runClick);

            #line default
            #line hidden
                return;

            case 5:
                this.textEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target));
                return;

            case 6:
                this.expander = ((System.Windows.Controls.Expander)(target));
                return;

            case 7:
                this.propertyGridComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 90 "..\..\IronPythonControl.xaml"
                this.propertyGridComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.propertyGridComboBoxSelectionChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.propertyGrid = ((System.Windows.Controls.WpfPropertyGrid.PropertyGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryItem"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="name">The name.</param>
        public CategoryItem(PropertyGrid owner, string name)
        {
            if (owner == null) throw new ArgumentNullException("owner");
              if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name");

              Owner = owner;
              Name = name;
        }
Esempio n. 4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.objectPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 2:
                this.btnTest = ((System.Windows.Controls.Button)(target));

            #line 26 "..\..\Window1.xaml"
                this.btnTest.Click += new System.Windows.RoutedEventHandler(this.btnTest_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.toggleGrid = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 4:
                this.toggleSearchBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 5:
                this.btnSwitchObjects = ((System.Windows.Controls.Button)(target));

            #line 29 "..\..\Window1.xaml"
                this.btnSwitchObjects.Click += new System.Windows.RoutedEventHandler(this.btnSwitchObjects_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.btnSelectMultiple = ((System.Windows.Controls.Button)(target));

            #line 30 "..\..\Window1.xaml"
                this.btnSelectMultiple.Click += new System.Windows.RoutedEventHandler(this.btnSelectMultiple_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.propertyGrid = ((System.Windows.Controls.WpfPropertyGrid.PropertyGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.objectPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 2:
                this.propertyGrid = ((System.Windows.Controls.WpfPropertyGrid.PropertyGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryItem"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="category">The category.</param>
 public CategoryItem(PropertyGrid owner, CategoryAttribute category)
     : this(owner, category.Category)
 {
     Attribute = category;
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\..\Properties\SpreadTraderWindow.xaml"
                ((Zweistein.SpreadTraderWindow)(target)).LocationChanged += new System.EventHandler(this.Window_LocationChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.btnGoLong = ((System.Windows.Controls.Button)(target));
                return;

            case 3:
                this.btnReverse = ((System.Windows.Controls.Button)(target));
                return;

            case 4:
                this.btnGoShort = ((System.Windows.Controls.Button)(target));
                return;

            case 5:
                this.btnClose = ((System.Windows.Controls.Button)(target));
                return;

            case 6:
                this.btnPosition = ((System.Windows.Controls.Button)(target));
                return;

            case 7:
                this.btnValue = ((System.Windows.Controls.Button)(target));
                return;

            case 8:
                this.unrealizedPNL = ((System.Windows.Controls.Button)(target));
                return;

            case 9:
                this.realizedPNL = ((System.Windows.Controls.RichTextBox)(target));
                return;

            case 10:
                this.opentickets = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 12:
                this.txtTicket = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.btnAddTicket = ((System.Windows.Controls.Button)(target));

            #line 44 "..\..\..\Properties\SpreadTraderWindow.xaml"
                this.btnAddTicket.Click += new System.Windows.RoutedEventHandler(this.btnAddTicket_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.pgScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 15:
                this.Parameters = ((System.Windows.Controls.WpfPropertyGrid.PropertyGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 8
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.console = ((PythonConsoleControl.IronPythonConsoleControl)(target));
     return;
     case 2:
     
     #line 36 "..\..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.openFileClick);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 39 "..\..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.saveFileClick);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 73 "..\..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.runClick);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 77 "..\..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.APIHelp_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.textEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target));
     return;
     case 7:
     this.expander = ((System.Windows.Controls.Expander)(target));
     return;
     case 8:
     this.propertyGridComboBox = ((System.Windows.Controls.ComboBox)(target));
     
     #line 94 "..\..\..\MainWindow.xaml"
     this.propertyGridComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.propertyGridComboBoxSelectionChanged);
     
     #line default
     #line hidden
     return;
     case 9:
     this.propertyGrid = ((System.Windows.Controls.WpfPropertyGrid.PropertyGrid)(target));
     return;
     }
     this._contentLoaded = true;
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryItem"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="category">The category.</param>
 public CategoryItem(PropertyGrid owner, CategoryAttribute category)
     : this(owner, category.Category)
 {
     Attribute = category;
 }
Esempio n. 10
0
        /// <summary> Load the model and the editor </summary>
        public void Initialize(Object model, PropertyGrid editor)
        {
            Model = model;
            Editor = editor;

            Editor.SelectedObjectsChanged += Editor_SelectedObjectsChanged;
            Editor.PropertyValueChanged += Editor_PropertyValueChanged;

            LoadEditors(model.GetType());
            Editor.SelectedObject = this;
        }
Esempio n. 11
0
        public void ShouldInitiliasePropertiesWithConstructor()
        {
            PropertyGrid owner = new PropertyGrid();
              BusinessObject component = new BusinessObject();
              PropertyDescriptor descriptor = BusinessObject.ExtractProperty("Name");

              PropertyItem property = new PropertyItem(owner, component, descriptor);

              Assert.AreEqual<PropertyGrid>(owner, property.Owner);
              Assert.AreEqual<string>("Name", property.Name);
              Assert.AreEqual(component, property.Component);
              Assert.IsFalse(property.IsBrowsable);
              Assert.AreEqual<string>("Profile name", property.Description);
              Assert.AreEqual<string>("Profile", property.CategoryName);
              Assert.IsTrue(property.IsLocalizable);
              Assert.AreEqual<string>("Login", property.DisplayName);

              Assert.IsTrue(property.Attributes.Count >= 5);
        }