Exemple #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CardsEnabledCheckbox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 2:
                this.GcpEnabledCheckbox = ((System.Windows.Controls.CheckBox)(target));
                return;

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

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

            case 5:
                this.DelaysBounds = ((MahApps.Metro.Controls.RangeSlider)(target));
                return;

            case 6:
                this.InventoryCurrencyGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 7:

            #line 839 "..\..\..\..\EXtensions\Gui.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.InventoryCurrencyAdd);

            #line default
            #line hidden
                return;

            case 8:

            #line 840 "..\..\..\..\EXtensions\Gui.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.InventoryCurrencyDelete);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemple #2
0
        private static void OnRangeSliderPreviewMouseWheel(object sender, MouseWheelEventArgs e)
        {
            if (sender is RangeSlider rangeSlider && (rangeSlider.IsFocused || MouseWheelState.MouseHover.Equals(rangeSlider.GetValue(EnableMouseWheelProperty))))
            {
                var changeType = (MouseWheelChange)rangeSlider.GetValue(ChangeValueByProperty);
                var difference = changeType == MouseWheelChange.LargeChange ? rangeSlider.LargeChange : rangeSlider.SmallChange;

                if (e.Delta > 0)
                {
                    rangeSlider.SetCurrentValue(RangeSlider.UpperValueProperty, RangeSlider.CoerceUpperValue(rangeSlider, rangeSlider.UpperValue + difference));
                    rangeSlider.SetCurrentValue(RangeSlider.LowerValueProperty, RangeSlider.CoerceLowerValue(rangeSlider, rangeSlider.LowerValue + difference));
                }
                else
                {
                    rangeSlider.SetCurrentValue(RangeSlider.LowerValueProperty, RangeSlider.CoerceLowerValue(rangeSlider, rangeSlider.LowerValue - difference));
                    rangeSlider.SetCurrentValue(RangeSlider.UpperValueProperty, RangeSlider.CoerceUpperValue(rangeSlider, rangeSlider.UpperValue - difference));
                }

                e.Handled = true;
            }
        }
Exemple #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tabControl = ((System.Windows.Controls.TabControl)(target));
                return;

            case 2:
                this.isAutoJavaToggle = ((MahApps.Metro.Controls.ToggleSwitch)(target));
                return;

            case 3:
                this.javaPathComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 49 "..\..\..\Windows\SettingWindow.xaml"
                this.javaPathComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.javaPathComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.javaInfoLabel = ((System.Windows.Controls.Label)(target));
                return;

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

            #line 53 "..\..\..\Windows\SettingWindow.xaml"
                this.chooseJavaButton.Click += new System.Windows.RoutedEventHandler(this.chooseJavaButton_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.dir_customRadio = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 7:
                this.gamedirPathTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

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

            #line 86 "..\..\..\Windows\SettingWindow.xaml"
                this.gamedirChooseButton.Click += new System.Windows.RoutedEventHandler(this.gamedirChooseButton_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.memorySlider = ((MahApps.Metro.Controls.RangeSlider)(target));

            #line 102 "..\..\..\Windows\SettingWindow.xaml"
                this.memorySlider.UpperValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.memorySlider_UpperValueChanged);

            #line default
            #line hidden

            #line 103 "..\..\..\Windows\SettingWindow.xaml"
                this.memorySlider.LowerValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.memorySlider_LowerValueChanged);

            #line default
            #line hidden
                return;

            case 10:
                this.minMemoryTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 109 "..\..\..\Windows\SettingWindow.xaml"
                this.minMemoryTextBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 11:
                this.maxMemoryTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 116 "..\..\..\Windows\SettingWindow.xaml"
                this.maxMemoryTextBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 12:

            #line 126 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 13:

            #line 132 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 14:
                this.downloadGrid = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 15:

            #line 212 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 16:

            #line 223 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 17:
                this.label6 = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.VersionsComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 247 "..\..\..\Windows\SettingWindow.xaml"
                this.VersionsComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.VersionsComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 19:
                this.groupBox7 = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 20:
                this.versionOptionsGrid = ((System.Windows.Controls.DataGrid)(target));

            #line 250 "..\..\..\Windows\SettingWindow.xaml"
                this.versionOptionsGrid.CellEditEnding += new System.EventHandler <System.Windows.Controls.DataGridCellEditEndingEventArgs>(this.VersionOptionsGrid_CellEditEnding);

            #line default
            #line hidden
                return;

            case 21:
                this.refreshVersionsButton = ((System.Windows.Controls.Button)(target));

            #line 260 "..\..\..\Windows\SettingWindow.xaml"
                this.refreshVersionsButton.Click += new System.Windows.RoutedEventHandler(this.refreshVersionsButton_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.userGrid = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 23:
                this.addAuthModuleExpander = ((System.Windows.Controls.Expander)(target));
                return;

            case 24:
                this.authModuleCombobox = ((System.Windows.Controls.ComboBox)(target));

            #line 280 "..\..\..\Windows\SettingWindow.xaml"
                this.authModuleCombobox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.AuthModuleCombobox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 25:
                this.clearAuthselectButton = ((System.Windows.Controls.Button)(target));

            #line 282 "..\..\..\Windows\SettingWindow.xaml"
                this.clearAuthselectButton.Click += new System.Windows.RoutedEventHandler(this.ClearAuthselectButton_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.authmoduleControl = ((MineRealmsLauncher.Controls.AuthModuleControl)(target));
                return;

            case 27:
                this.userComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 28:

            #line 296 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.forgetUserButton_Click);

            #line default
            #line hidden
                return;

            case 29:

            #line 297 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.clearUserButton_Click);

            #line default
            #line hidden
                return;

            case 30:

            #line 298 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.delUserButton_Click);

            #line default
            #line hidden
                return;

            case 31:
                this.lockauthCombobox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 32:

            #line 308 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.clearAllauthButton_Click);

            #line default
            #line hidden
                return;

            case 33:

            #line 311 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.delAllAuthnodeButton_Click);

            #line default
            #line hidden
                return;

            case 34:

            #line 312 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.delAllUserButton_Click);

            #line default
            #line hidden
                return;

            case 35:
                this.customGrid = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 36:
                this.AccentColorComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 360 "..\..\..\Windows\SettingWindow.xaml"
                this.AccentColorComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.AccentColorComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 37:
                this.appThmeComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 363 "..\..\..\Windows\SettingWindow.xaml"
                this.appThmeComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.appThmeComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 38:
                this.checkBox1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 39:
                this.checkBox2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 40:

            #line 405 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.textBox1_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 41:

            #line 421 "..\..\..\Windows\SettingWindow.xaml"
                ((System.Windows.Documents.Hyperlink)(target)).Click += new System.Windows.RoutedEventHandler(this.Hyperlink_Click);

            #line default
            #line hidden
                return;

            case 42:
                this.saveButton = ((System.Windows.Controls.Button)(target));

            #line 433 "..\..\..\Windows\SettingWindow.xaml"
                this.saveButton.Click += new System.Windows.RoutedEventHandler(this.saveButton_Click);

            #line default
            #line hidden
                return;

            case 43:
                this.cancelButton = ((System.Windows.Controls.Button)(target));

            #line 435 "..\..\..\Windows\SettingWindow.xaml"
                this.cancelButton.Click += new System.Windows.RoutedEventHandler(this.cancelButton_Click);

            #line default
            #line hidden
                return;

            case 44:
                this.versionTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.horizSlider = ((System.Windows.Controls.Slider)(target));
     return;
     case 2:
     this.RangeSlider = ((MahApps.Metro.Controls.RangeSlider)(target));
     
     #line 94 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider.LowerValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnLowerValueChanged);
     
     #line default
     #line hidden
     
     #line 95 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider.UpperValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnUpperValueChanged);
     
     #line default
     #line hidden
     
     #line 96 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider.CentralThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnCentralThumbDragStarted);
     
     #line default
     #line hidden
     
     #line 97 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider.CentralThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnCentralThumbDragCompleted);
     
     #line default
     #line hidden
     return;
     case 3:
     this.RangeSlider1 = ((MahApps.Metro.Controls.RangeSlider)(target));
     
     #line 119 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.LowerValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnLowerValueChanged);
     
     #line default
     #line hidden
     
     #line 120 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.UpperValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnUpperValueChanged);
     
     #line default
     #line hidden
     
     #line 121 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.CentralThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnCentralThumbDragStarted);
     
     #line default
     #line hidden
     
     #line 122 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.CentralThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnCentralThumbDragCompleted);
     
     #line default
     #line hidden
     
     #line 123 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.LowerThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnLowerThumbDragDelta);
     
     #line default
     #line hidden
     
     #line 124 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.UpperThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnUpperThumbDragDelta);
     
     #line default
     #line hidden
     
     #line 125 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.CentralThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnCentralThumbDragDelta);
     
     #line default
     #line hidden
     
     #line 126 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.LowerThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnLowerThumbDragStarted);
     
     #line default
     #line hidden
     
     #line 127 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.LowerThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnLowerThumbDragCompleted);
     
     #line default
     #line hidden
     
     #line 128 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.UpperThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnUpperThumbDragStarted);
     
     #line default
     #line hidden
     
     #line 129 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
     this.RangeSlider1.UpperThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnUpperThumbDragCompleted);
     
     #line default
     #line hidden
     return;
     case 4:
     this.RangeSlider2 = ((MahApps.Metro.Controls.RangeSlider)(target));
     return;
     case 5:
     this.IsIndeterminatePB = ((MahApps.Metro.Controls.MetroProgressBar)(target));
     return;
     }
     this._contentLoaded = true;
 }
        void RemoveEvents(UIElement u)
        {
            switch (u.GetType().ToString())
            {
            case "System.Windows.Controls.Slider":
                Slider s = u as Slider;
                s.ValueChanged -= ExpireThis;
                return;

            case "System.Windows.Controls.Button":
                Button b = u as Button;
                b.PreviewMouseDown -= ExpireThis;
                b.PreviewMouseUp   -= ExpireThis;
                return;

            case "System.Windows.Controls.DataGrid":
                DataGrid datagrid = u as DataGrid;
                datagrid.SelectedCellsChanged -= ExpireThis;
                return;

            case "HumanUI.TrueOnlyButton":
                TrueOnlyButton tob = u as TrueOnlyButton;
                tob.PreviewMouseDown -= ExpireThis;
                return;

            case "HumanUI.HUI_RhPickButton":
                HUI_RhPickButton rpb = u as HUI_RhPickButton;
                rpb.PickCompleted -= ExpireThis;
                return;

            case "HumanUI.MDSliderElement":
                MDSliderElement mds = u as MDSliderElement;
                mds.PropertyChanged -= ExpireThis;
                return;

            case "HumanUI.GraphMapperElement":
                GraphMapperElement gme = u as GraphMapperElement;
                gme.PropertyChanged -= ExpireThis;
                return;

            case "HumanUI.HUI_GradientEditor":
                HUI_GradientEditor hge = u as HUI_GradientEditor;
                hge.PropertyChanged -= ExpireThis;
                return;

            case "HumanUI.FilePicker":
                FilePicker fp = u as FilePicker;
                fp.PropertyChanged -= ExpireThis;
                return;

            case "HumanUI.ClickableShapeGrid":
                ClickableShapeGrid csg = u as ClickableShapeGrid;
                switch (csg.clickMode)
                {
                case ClickableShapeGrid.ClickMode.ButtonMode:
                    csg.MouseUp   -= ExpireThis;
                    csg.MouseDown -= ExpireThis;
                    return;

                case ClickableShapeGrid.ClickMode.PickerMode:
                case ClickableShapeGrid.ClickMode.ToggleMode:
                    csg.MouseUp -= ExpireThis;
                    return;

                case ClickableShapeGrid.ClickMode.None:
                default:
                    return;
                }

            case "System.Windows.Controls.Label":
                Label l = u as Label;
                return;

            case "System.Windows.Controls.ListBox":
                ListBox lb = u as ListBox;
                lb.SelectionChanged -= ExpireThis;
                return;

            case "System.Windows.Controls.ScrollViewer":
                ScrollViewer sv = u as ScrollViewer;
                ItemsControl ic = sv.Content as ItemsControl;
                ((INotifyCollectionChanged)ic.Items).CollectionChanged -= ExpireThis;
                List <bool> checkeds = new List <bool>();
                var         cbs      = from cbx in ic.Items.OfType <CheckBox>() select cbx;
                foreach (CheckBox chex in cbs)
                {
                    chex.Checked   -= ExpireThis;
                    chex.Unchecked -= ExpireThis;
                }
                return;

            case "System.Windows.Controls.ComboBox":
                ComboBox cb = u as ComboBox;
                cb.SelectionChanged -= ExpireThis;
                return;

            case "System.Windows.Controls.TextBox":
                TextBox       tb   = u as TextBox;
                Panel         p    = tb.Parent as Panel;
                List <Button> btns = p.Children.OfType <Button>().ToList <Button>();

                foreach (Button btn0 in btns)
                {
                    btn0.Click -= ExpireThis;
                }
                tb.TextChanged -= ExpireThis;
                return;

            case "Xceed.Wpf.Toolkit.ColorPicker":
                ColorPicker cp = u as ColorPicker;
                cp.SelectedColorChanged -= ExpireThis;
                return;

            case "System.Windows.Controls.CheckBox":
                CheckBox chb = u as CheckBox;
                chb.Checked   -= ExpireThis;
                chb.Unchecked -= ExpireThis;
                return;

            case "System.Windows.Controls.RadioButton":
                RadioButton rb = u as RadioButton;
                rb.Checked   -= ExpireThis;
                rb.Unchecked -= ExpireThis;
                return;

            case "System.Windows.Controls.Image":
                return;

            case "System.Windows.Controls.Expander":
                Expander exp = u as Expander;
                exp.Expanded  -= ExpireThis;
                exp.Collapsed -= ExpireThis;
                return;

            case "System.Windows.Controls.TabControl":
                TabControl tc = u as TabControl;
                tc.SelectionChanged -= ExpireThis;
                return;

            case "MahApps.Metro.Controls.ToggleSwitch":
                ToggleSwitch ts = u as ToggleSwitch;
                ts.IsCheckedChanged -= ExpireThis;
                return;

            case "MahApps.Metro.Controls.RangeSlider":
                RangeSlider rs = u as RangeSlider;
                rs.RangeSelectionChanged -= ExpireThis;
                return;

            case "De.TorstenMandelkow.MetroChart.ChartBase":
            case "De.TorstenMandelkow.MetroChart.PieChart":
            case "De.TorstenMandelkow.MetroChart.ClusteredBarChart":
            case "De.TorstenMandelkow.MetroChart.ClusteredColumnChart":
            case "De.TorstenMandelkow.MetroChart.DoughnutChart":
            case "De.TorstenMandelkow.MetroChart.RadialGaugeChart":
            case "De.TorstenMandelkow.MetroChart.StackedBarChart":
            case "De.TorstenMandelkow.MetroChart.StackedColumnChart":
                ChartBase chart = u as ChartBase;
                chart.MouseUp -= ExpireThis;
                return;

            default:
                return;
            }
        }
Exemple #6
0
        static public object GetElementValue(UIElement u)
        {
            switch (u.GetType().ToString())
            {
            case "System.Windows.Controls.Slider":
                Slider s = u as Slider;
                return(s.Value);

            case "System.Windows.Controls.Button":
                Button b = u as Button;
                return((System.Windows.Input.Mouse.LeftButton == System.Windows.Input.MouseButtonState.Pressed) && b.IsMouseOver);

            case "HumanUI.TrueOnlyButton":
                TrueOnlyButton tob = u as TrueOnlyButton;
                return((System.Windows.Input.Mouse.LeftButton == System.Windows.Input.MouseButtonState.Pressed) && tob.IsMouseOver);

            case "HumanUI.HUI_RhPickButton":
                HUI_RhPickButton rpb = u as HUI_RhPickButton;
                return(rpb.objIDs);

            case "System.Windows.Controls.Label":
                Label l = u as Label;
                return(l.Content);

            case "System.Windows.Controls.ListBox":
                ListBox   lb  = u as ListBox;
                TextBlock lab = lb.SelectedItem as TextBlock;
                if (lab != null)
                {
                    return(lab.Text);
                }
                else
                {
                    return(null);
                }

            case "System.Windows.Controls.ScrollViewer":
                ScrollViewer sv       = u as ScrollViewer;
                ItemsControl ic       = sv.Content as ItemsControl;
                List <bool>  checkeds = new List <bool>();
                var          cbs      = from cbx in ic.Items.OfType <CheckBox>() select cbx;
                foreach (CheckBox chex in cbs)
                {
                    checkeds.Add(chex.IsChecked == true);
                }


                return(checkeds);

            case "System.Windows.Controls.TextBox":
                TextBox tb = u as TextBox;
                return(tb.Text);

            case "System.Windows.Controls.ComboBox":
                ComboBox  cb  = u as ComboBox;
                TextBlock cbi = cb.SelectedItem as TextBlock;
                if (cbi != null)
                {
                    return(cbi.Text);
                }
                else
                {
                    return(null);
                }

            case "Xceed.Wpf.Toolkit.ColorPicker":
                ColorPicker colP = u as ColorPicker;

                //return cbi.Content;
                return(HUI_Util.ToSysColor(colP.SelectedColor));

            case "System.Windows.Controls.ListView":
                ListView      v           = u as ListView;
                var           cbxs        = from cbx in v.Items.OfType <CheckBox>() select cbx;
                List <string> checkedVals = new List <string>();
                foreach (CheckBox chex in cbxs)
                {
                    if (chex.IsChecked == true)
                    {
                        checkedVals.Add(chex.Content.ToString());
                    }
                }

                return(String.Join(",", checkedVals));

            case "System.Windows.Controls.CheckBox":
                CheckBox chb = u as CheckBox;
                return(chb.IsChecked);

            case "System.Windows.Controls.RadioButton":
                RadioButton rb = u as RadioButton;
                return(rb.IsChecked);

            case "System.Windows.Controls.Image":
                Image img = u as Image;

                return(img.Source.ToString());

            case "System.Windows.Controls.Expander":
                Expander exp = u as Expander;
                return(exp.IsExpanded);

            case "System.Windows.Controls.TabControl":
                TabControl tc = u as TabControl;
                TabItem    ti = tc.SelectedItem as TabItem;
                if (ti == null)
                {
                    ti = tc.Items[0] as TabItem;
                }
                return(ti.Header.ToString());

            case "MahApps.Metro.Controls.ToggleSwitch":
                ToggleSwitch ts = u as ToggleSwitch;

                return(ts.IsChecked);

            case "MahApps.Metro.Controls.RangeSlider":
                RangeSlider rs = u as RangeSlider;

                return(new Interval(rs.LowerValue, rs.UpperValue));

            case "De.TorstenMandelkow.MetroChart.ChartBase":
            case "De.TorstenMandelkow.MetroChart.PieChart":
            case "De.TorstenMandelkow.MetroChart.ClusteredBarChart":
            case "De.TorstenMandelkow.MetroChart.ClusteredColumnChart":
            case "De.TorstenMandelkow.MetroChart.DoughnutChart":
            case "De.TorstenMandelkow.MetroChart.RadialGaugeChart":
            case "De.TorstenMandelkow.MetroChart.StackedBarChart":
            case "De.TorstenMandelkow.MetroChart.StackedColumnChart":
                ChartBase chart        = u as ChartBase;
                ChartItem selectedItem = chart.SelectedItem as ChartItem;

                if (selectedItem != null)
                {
                    string response = "";
                    if (!String.IsNullOrEmpty(selectedItem.ClusterCategory))
                    {
                        response += selectedItem.ClusterCategory + ": ";
                    }
                    response += selectedItem.Category;
                    return(response);
                }
                else
                {
                    return(null);
                }

            case "System.Windows.Controls.DataGrid":
                DataGrid datagrid     = u as DataGrid;
                var      SelectedItem = datagrid.SelectedItem;
                //System.Data.DataView dv = datagrid.ItemsSource as System.Data.DataView;
                List <string> result = new List <string>();
                try
                {
                    System.Data.DataRowView drv = SelectedItem as System.Data.DataRowView;
                    result = drv.Row.ItemArray.Cast <string>().ToList();
                    result.RemoveAt(0);
                }
                catch
                {
                }

                return(result);

            case "HumanUI.MDSliderElement":
                MDSliderElement mds = u as MDSliderElement;

                return(mds.SliderPoint);

            case "HumanUI.GraphMapperElement":
                GraphMapperElement gme = u as GraphMapperElement;
                return(gme.GetCurve().ToNurbsCurve());

            case "HumanUI.HUI_GradientEditor":
                HUI_GradientEditor hge = u as HUI_GradientEditor;
                return(hge.Gradient.ToString());

            case "HumanUI.FilePicker":
                FilePicker fp = u as FilePicker;
                return(fp.Path);

            case "HumanUI.ClickableShapeGrid":
                ClickableShapeGrid csg = u as ClickableShapeGrid;
                return(csg.SelectedStates);

            default:
                return(null);
            }
        }
Exemple #7
0
        static public void TrySetElementValue(UIElement u, object o)
        {
            try
            {
                switch (u.GetType().ToString())
                {
                case "System.Windows.Controls.Slider":
                    Slider s = u as Slider;
                    //System.Windows.Forms.MessageBox.Show(o.GetType().ToString());

                    s.Value = (double)o;
                    return;

                case "System.Windows.Controls.ListBox":
                    ListBox lb = u as ListBox;
                    lb.SelectedIndex = getSelectedItemIndex(lb, (string)o);
                    return;

                case "System.Windows.Controls.TextBox":
                    TextBox tb = u as TextBox;
                    tb.Text = (string)o;
                    return;

                case "System.Windows.Controls.ComboBox":
                    ComboBox cb = u as ComboBox;
                    cb.SelectedIndex = getSelectedItemIndex(cb, (string)o);
                    return;

                case "Xceed.Wpf.Toolkit.ColorPicker":
                    ColorPicker          colP   = u as ColorPicker;
                    System.Drawing.Color sysCol = (System.Drawing.Color)o;
                    colP.SelectedColor = HUI_Util.ToMediaColor(sysCol);
                    return;

                case "System.Windows.Controls.ScrollViewer":
                    //it's a checklist
                    ScrollViewer sv        = u as ScrollViewer;
                    List <bool>  valueList = (List <bool>)o;
                    ItemsControl ic        = sv.Content as ItemsControl;
                    var          cbs       = from cbx in ic.Items.OfType <CheckBox>() select cbx;
                    int          i         = 0;
                    foreach (CheckBox chex in cbs)
                    {
                        chex.IsChecked = valueList[i];
                        i++;
                    }

                    return;

                case "System.Windows.Controls.CheckBox":
                    CheckBox chb = u as CheckBox;
                    chb.IsChecked = (bool)o;
                    return;

                case "MahApps.Metro.Controls.ToggleSwitch":
                    ToggleSwitch ts = u as ToggleSwitch;
                    ts.IsChecked = (bool)o;
                    return;

                case "MahApps.Metro.Controls.RangeSlider":
                    RangeSlider rs         = u as RangeSlider;
                    var         valueRange = (Interval)o;
                    rs.UpperValue = valueRange.Max;
                    rs.LowerValue = valueRange.Min;
                    return;

                case "System.Windows.Controls.RadioButton":
                    RadioButton rb = u as RadioButton;
                    rb.IsChecked = (bool)o;
                    return;

                case "System.Windows.Controls.DataGrid":
                    DataGrid      datagrid            = u as DataGrid;
                    List <string> selectedRowContents = (List <string>)o;
                    try
                    {
                        DataView dv = datagrid.ItemsSource as DataView;
                        foreach (DataRowView drv in dv)
                        {
                            var items = drv.Row.ItemArray.Cast <string>().ToList();
                            items.RemoveAt(0);     //get rid of hidden index column
                            bool selectRow = true;
                            for (int counter = 0; counter < items.Count; counter++)
                            {
                                if (selectedRowContents[counter] != items[counter])
                                {
                                    selectRow = false;
                                    break;
                                }
                            }
                            if (selectRow)
                            {
                                datagrid.SelectedItem = drv;
                            }
                        }
                    }
                    catch
                    {
                    }
                    return;

                case "HumanUI.MDSliderElement":
                    MDSliderElement mds = u as MDSliderElement;
                    mds.SliderPoint = (Rhino.Geometry.Point3d)o;
                    return;

                case "HumanUI.GraphMapperElement":
                    GraphMapperElement gme = u as GraphMapperElement;

                    gme.SetByCurve((Rhino.Geometry.NurbsCurve)o);
                    return;

                case "HumanUI.HUI_GradientEditor":
                    HUI_GradientEditor hge      = u as HUI_GradientEditor;
                    HUI_Gradient       gradient = HUI_Gradient.FromString((string)o);
                    hge.Gradient = gradient;
                    return;

                case "HumanUI.FilePicker":
                    FilePicker fp = u as FilePicker;
                    fp.Path = (string)o;
                    return;

                default:
                    return;
                }
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.ToString());
            }
        }
Exemple #8
0
 internal RangeSelectionChangedEventArgs(RangeSlider slider)
     : this(slider.RangeStartSelected, slider.RangeStopSelected)
 {
 }
Exemple #9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.horizSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 2:
                this.RangeSlider = ((MahApps.Metro.Controls.RangeSlider)(target));

            #line 94 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider.LowerValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnLowerValueChanged);

            #line default
            #line hidden

            #line 95 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider.UpperValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnUpperValueChanged);

            #line default
            #line hidden

            #line 96 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider.CentralThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnCentralThumbDragStarted);

            #line default
            #line hidden

            #line 97 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider.CentralThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnCentralThumbDragCompleted);

            #line default
            #line hidden
                return;

            case 3:
                this.RangeSlider1 = ((MahApps.Metro.Controls.RangeSlider)(target));

            #line 119 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.LowerValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnLowerValueChanged);

            #line default
            #line hidden

            #line 120 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.UpperValueChanged += new MahApps.Metro.Controls.RangeParameterChangedEventHandler(this.RangeSlider_OnUpperValueChanged);

            #line default
            #line hidden

            #line 121 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.CentralThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnCentralThumbDragStarted);

            #line default
            #line hidden

            #line 122 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.CentralThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnCentralThumbDragCompleted);

            #line default
            #line hidden

            #line 123 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.LowerThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnLowerThumbDragDelta);

            #line default
            #line hidden

            #line 124 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.UpperThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnUpperThumbDragDelta);

            #line default
            #line hidden

            #line 125 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.CentralThumbDragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(this.RangeSlider_OnCentralThumbDragDelta);

            #line default
            #line hidden

            #line 126 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.LowerThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnLowerThumbDragStarted);

            #line default
            #line hidden

            #line 127 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.LowerThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnLowerThumbDragCompleted);

            #line default
            #line hidden

            #line 128 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.UpperThumbDragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(this.RangeSlider_OnUpperThumbDragStarted);

            #line default
            #line hidden

            #line 129 "..\..\..\..\ExampleViews\SliderProgressExamples.xaml"
                this.RangeSlider1.UpperThumbDragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(this.RangeSlider_OnUpperThumbDragCompleted);

            #line default
            #line hidden
                return;

            case 4:
                this.RangeSlider2 = ((MahApps.Metro.Controls.RangeSlider)(target));
                return;

            case 5:
                this.IsIndeterminatePB = ((MahApps.Metro.Controls.MetroProgressBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemple #10
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string        ID      = this.Attributes.InstanceGuid.ToString();
            string        name    = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            List <string> newKeys = new List <string>();

            string type, format;
            GH_Structure <IGH_Goo> El;
            GH_Structure <IGH_Goo> OutPut = new GH_Structure <IGH_Goo>();

            if (!DA.GetDataTree(0, out El))
            {
                return;
            }

            for (int i = 0; i < El.Paths.Count; i++)
            {
                GH_Path Q = El.get_Path(i);
                GH_Path P = El.get_Path(i);
                P.AppendElement(0);
                for (int k = 0; k < El.get_Branch(Q).Count; k++)
                {
                    IGH_Goo X = El.get_DataItem(Q, k);


                    wObject W;
                    X.CastTo(out W);

                    format = W.Type;

                    if (format == "Parrot")
                    {
                        pElement E;
                        E = (pElement)W.Element;

                        type = E.Type;
                        newKeys.Add(E.Element.Name);

                        switch (type)
                        {
                        case ("Button"):
                            Button C0 = (Button)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C0.PreviewMouseDown -= (o, e) => { ExpireSolution(true); };
                                C0.PreviewMouseDown += (o, e) => { ExpireSolution(true); };

                                C0.PreviewMouseUp -= (o, e) => { ExpireSolution(true); };
                                C0.PreviewMouseUp += (o, e) => { ExpireSolution(true); };
                            }

                            OutPut.Append(new GH_ObjectWrapper((Mouse.LeftButton == MouseButtonState.Pressed) & C0.IsMouseOver), P);
                            break;

                        case ("Calculator"):
                            Calculator C1 = (Calculator)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C1.ValueChanged -= (o, e) => { ExpireSolution(true); };
                                C1.ValueChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C1.Value), P);
                            break;

                        case ("Calendar"):
                            Calendar C2 = (Calendar)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C2.SelectedDatesChanged -= (o, e) => { ExpireSolution(true); };
                                C2.SelectedDatesChanged += (o, e) => { ExpireSolution(true); };
                            }
                            List <IGH_Goo> Dates = new List <IGH_Goo>();

                            for (int j = 0; j < C2.SelectedDates.Count; j++)
                            {
                                OutPut.Append(new GH_ObjectWrapper(C2.SelectedDates[j]), P);
                            }
                            break;

                        case ("Clock"):
                            Clock C23 = (Clock)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C23.LayoutUpdated -= (o, e) => { ExpireSolution(true); };
                                C23.LayoutUpdated += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C23.Time), P);
                            break;

                        case ("CheckBox"):
                            CheckBox C19 = (CheckBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C19.Click -= (o, e) => { ExpireSolution(true); };
                                C19.Click += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C19.IsChecked), P);
                            break;

                        case ("CheckListBox"):
                            CheckListBox C3 = (CheckListBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C3.ItemSelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C3.ItemSelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            for (int j = 0; j < C3.SelectedItems.Count; j++)
                            {
                                OutPut.Append(new GH_ObjectWrapper(C3.SelectedItems[j]), P);
                            }
                            break;

                        case ("ColorCanvas"):
                            ColorCanvas C4 = (ColorCanvas)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C4.SelectedColorChanged -= (o, e) => { ExpireSolution(true); };
                                C4.SelectedColorChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(new wColor((System.Windows.Media.Color)C4.SelectedColor).ToDrawingColor()), P);
                            OutPut.Append(new GH_ObjectWrapper(C4.SelectedColor), P);
                            break;

                        case ("ColorPicker"):
                            ColorPicker C5 = (ColorPicker)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C5.SelectedColorChanged -= (o, e) => { ExpireSolution(true); };
                                C5.SelectedColorChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(new wColor((System.Windows.Media.Color)C5.SelectedColor).ToDrawingColor()), P);
                            break;

                        case ("CheckComboBox"):
                            CheckComboBox C6 = (CheckComboBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C6.ItemSelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C6.ItemSelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            for (int j = 0; j < C6.SelectedItems.Count; j++)
                            {
                                OutPut.Append(new GH_ObjectWrapper(C6.SelectedItems[j]), P);
                            }
                            break;

                        case ("RangeSlider"):
                            MahApps.Metro.Controls.RangeSlider C7 = (MahApps.Metro.Controls.RangeSlider)E.Layout.Children[0];
                            if (!keys.Contains(E.Element.Name))
                            {
                                C7.UpperValueChanged -= (o, e) => { ExpireSolution(true); };
                                C7.UpperValueChanged += (o, e) => { ExpireSolution(true); };
                                C7.LowerValueChanged -= (o, e) => { ExpireSolution(true); };
                                C7.LowerValueChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(new Interval(C7.LowerValue, C7.UpperValue)), P);
                            break;

                        case ("Slider"):
                            Slider C8 = (Slider)E.Layout.Children[0];
                            if (!keys.Contains(E.Element.Name))
                            {
                                C8.ValueChanged -= (o, e) => { ExpireSolution(true); };
                                C8.ValueChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C8.Value), P);
                            break;

                        case ("RadioButton"):
                            RadioButton C9 = (RadioButton)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C9.Checked -= (o, e) => { ExpireSolution(true); };
                                C9.Checked += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C9.IsChecked), P);
                            break;

                        case ("TimePicker"):
                            MaterialDesignThemes.Wpf.TimePicker C10 = (MaterialDesignThemes.Wpf.TimePicker)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C10.MouseUp       -= (o, e) => { ExpireSolution(true); };
                                C10.MouseUp       += (o, e) => { ExpireSolution(true); };
                                C10.LayoutUpdated -= (o, e) => { ExpireSolution(true); };
                                C10.LayoutUpdated += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C10.SelectedTime), P);
                            break;

                        case ("PickDate"):
                            DatePicker C11 = (DatePicker)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C11.SelectedDateChanged -= (o, e) => { ExpireSolution(true); };
                                C11.SelectedDateChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C11.SelectedDate), P);
                            break;

                        case ("PickDateTime"):
                            DateTimePicker C12 = (DateTimePicker)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C12.ValueChanged -= (o, e) => { ExpireSolution(true); };
                                C12.ValueChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C12.Value), P);
                            break;

                        case ("ListView"):
                            ListView C13 = (ListView)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C13.SelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C13.SelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            for (int j = 0; j < C13.Items.Count; j++)
                            {
                                Label tbox = (Label)C13.Items[j];

                                OutPut.Append(new GH_ObjectWrapper(tbox.ToolTip.ToString()), P);
                            }
                            break;

                        case ("ListBox"):
                            ListBox C14 = (ListBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C14.SelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C14.SelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            for (int j = 0; j < C14.SelectedItems.Count; j++)
                            {
                                OutPut.Append(new GH_ObjectWrapper(C14.SelectedItems[j]), P);
                            }
                            break;

                        case ("ComboBox"):
                            ComboBox C15 = (ComboBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C15.SelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C15.SelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C15.SelectedValue), P);
                            break;

                        case ("ScrollValue"):
                            ButtonSpinner C16 = (ButtonSpinner)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C16.Spin -= (o, e) => { ExpireSolution(true); };
                                C16.Spin += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C16.Content), P);
                            break;

                        case ("ScrollNumber"):
                            NumericUpDown C17 = (NumericUpDown)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C17.ValueChanged -= (o, e) => { ExpireSolution(true); };
                                C17.ValueChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C17.Value), P);
                            break;

                        case ("TextBox"):
                            TextBox C18 = (TextBox)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C18.TextChanged -= (o, e) => { ExpireSolution(true); };
                                C18.TextChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C18.Text), P);
                            break;

                        case ("TreeView"):
                            TreeView C20 = (TreeView)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C20.SelectedItemChanged -= (o, e) => { ExpireSolution(true); };
                                C20.SelectedItemChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C20.SelectedValue), P);
                            break;

                        case ("GridView"):
                            ListView C21 = (ListView)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C21.SelectionChanged -= (o, e) => { ExpireSolution(true); };
                                C21.SelectionChanged += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C21.Items), P);
                            break;

                        case ("Toggle"):
                            ToggleButton C22 = (ToggleButton)E.Element;
                            if (!keys.Contains(E.Element.Name))
                            {
                                C22.Click -= (o, e) => { ExpireSolution(true); };
                                C22.Click += (o, e) => { ExpireSolution(true); };
                            }
                            OutPut.Append(new GH_ObjectWrapper(C22.IsChecked), P);
                            break;
                        }
                    }
                }
            }

            keys = newKeys;

            DA.SetDataTree(0, OutPut);
            DA.SetDataList(1, keys);
        }
Exemple #11
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\MainWindow.xaml"
                ((WpfApp1.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.ClosingApp);

            #line default
            #line hidden
                return;

            case 2:
                this.FullNameTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.NationalityComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.BirthdateTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.TeamComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 6:
                this.PositionComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 7:
                this.ActivePlayerCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 8:
                this.HeightSlider = ((MahApps.Metro.Controls.RangeSlider)(target));
                return;

            case 9:
                this.WeightSlider = ((MahApps.Metro.Controls.RangeSlider)(target));
                return;

            case 10:
                this.MVPCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 11:
                this.AllStarCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 12:
                this.DPOYCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

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

            #line 88 "..\..\MainWindow.xaml"
                this.ClearFiltersButton.Click += new System.Windows.RoutedEventHandler(this.ClearFilters);

            #line default
            #line hidden
                return;

            case 14:
                this.SearchButton = ((System.Windows.Controls.Button)(target));

            #line 89 "..\..\MainWindow.xaml"
                this.SearchButton.Click += new System.Windows.RoutedEventHandler(this.SearchResults);

            #line default
            #line hidden
                return;

            case 15:
                this.ResultsPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 16:
                this.NoResults = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 17:
                this.ResultsListBox = ((System.Windows.Controls.ListBox)(target));
                return;

            case 18:
                this.PreviousBtn = ((System.Windows.Controls.Button)(target));

            #line 97 "..\..\MainWindow.xaml"
                this.PreviousBtn.Click += new System.Windows.RoutedEventHandler(this.PreviousPage);

            #line default
            #line hidden
                return;

            case 19:
                this.CurrentPageTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 20:
                this.NextBtn = ((System.Windows.Controls.Button)(target));

            #line 99 "..\..\MainWindow.xaml"
                this.NextBtn.Click += new System.Windows.RoutedEventHandler(this.NextPage);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }