Exemple #1
0
        /// <summary>
        /// Creates a new ManagementList.
        /// </summary>
        /// <param name="outputMode">Output mode of the out-gridview</param>
        /// <returns>A new ManagementList</returns>
        private ManagementList CreateManagementList(string outputMode)
        {
            ManagementList newList = new ManagementList();

            newList.ViewSaverUserActionState   = UserActionState.Hidden;
            newList.ViewManagerUserActionState = UserActionState.Hidden;
            newList.List.VerticalAlignment     = VerticalAlignment.Stretch;
            newList.List.SetValue(Grid.RowProperty, 0);
            newList.List.SelectionMode = (outputMode == "Single") ? SelectionMode.Single : SelectionMode.Extended;

            return(newList);
        }
Exemple #2
0
        static private void ViewSaverUserActionStateProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnViewSaverUserActionStateChanged(new PropertyChangedEventArgs <UserActionState>((UserActionState)e.OldValue, (UserActionState)e.NewValue));
        }
Exemple #3
0
        static private void SearchBoxProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnSearchBoxChanged(new PropertyChangedEventArgs <SearchBox>((SearchBox)e.OldValue, (SearchBox)e.NewValue));
        }
Exemple #4
0
        static private void ClearFilterCommand_CommandExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            ManagementList obj = (ManagementList)sender;

            obj.OnClearFilterExecuted(e);
        }
Exemple #5
0
        static private void ListProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnListChanged(new PropertyChangedEventArgs <InnerList>((InnerList)e.OldValue, (InnerList)e.NewValue));
        }
Exemple #6
0
        static private void IsSearchShownProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnIsSearchShownChanged(new PropertyChangedEventArgs <bool>((bool)e.OldValue, (bool)e.NewValue));
        }
Exemple #7
0
        static private void FilterRulePanelProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnFilterRulePanelChanged(new PropertyChangedEventArgs <FilterRulePanel>((FilterRulePanel)e.OldValue, (FilterRulePanel)e.NewValue));
        }
Exemple #8
0
        static private void EvaluatorProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnEvaluatorChanged(new PropertyChangedEventArgs <ItemsControlFilterEvaluator>((ItemsControlFilterEvaluator)e.OldValue, (ItemsControlFilterEvaluator)e.NewValue));
        }
Exemple #9
0
        static private void CurrentViewProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnCurrentViewChanged(new PropertyChangedEventArgs <StateDescriptor <ManagementList> >((StateDescriptor <ManagementList>)e.OldValue, (StateDescriptor <ManagementList>)e.NewValue));
        }
Exemple #10
0
        static private void AddFilterRulePickerProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ManagementList obj = (ManagementList)o;

            obj.OnAddFilterRulePickerChanged(new PropertyChangedEventArgs <AddFilterRulePicker>((AddFilterRulePicker)e.OldValue, (AddFilterRulePicker)e.NewValue));
        }
Exemple #11
0
        static private void StopFilterCommand_CommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            ManagementList obj = (ManagementList)sender;

            obj.OnStopFilterCanExecute(e);
        }
Exemple #12
0
        static private void SaveViewCommand_CommandExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            ManagementList obj = (ManagementList)sender;

            obj.OnSaveViewExecuted(e);
        }
Exemple #13
0
        private void StartWindow(string invocation, string outputModeOptions, AutoResetEvent closedEvent)
        {
            this.closedEvent          = closedEvent;
            this.gridViewWindowLoaded = new AutoResetEvent(false);

            ParameterizedThreadStart threadStart = new ParameterizedThreadStart(
                new ThreadDelegate(delegate
            {
                try
                {
                    this.gridViewWindow         = new Window();
                    this.managementList         = CreateManagementList(outputModeOptions);
                    this.gridViewWindow.Loaded += new RoutedEventHandler(this.GridViewWindowLoaded);
                    this.gridViewWindow.Content = CreateMainGrid(outputModeOptions);
                    this.gridViewWindow.Title   = invocation;
                    this.gridViewWindow.Closed += new EventHandler(this.GridViewWindowClosed);

                    RoutedCommand plusSettings = new RoutedCommand();
                    KeyGestureConverter keyGestureConverter = new KeyGestureConverter();

                    try
                    {
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn1Shortcut));
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn2Shortcut));
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn3Shortcut));
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn4Shortcut));
                        this.gridViewWindow.CommandBindings.Add(new CommandBinding(plusSettings, ZoomEventHandlerPlus));
                    }
                    catch (NotSupportedException)
                    {
                        //localized has a problematic string - going to default
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Add"));
                        plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Plus"));
                        this.gridViewWindow.CommandBindings.Add(new CommandBinding(plusSettings, ZoomEventHandlerPlus));
                    };

                    RoutedCommand minusSettings = new RoutedCommand();
                    try
                    {
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut1Shortcut));
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut2Shortcut));
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut3Shortcut));
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut4Shortcut));

                        this.gridViewWindow.CommandBindings.Add(new CommandBinding(minusSettings, ZoomEventHandlerMinus));
                    }
                    catch (NotSupportedException)
                    {
                        //localized has a problematic string - going to default
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Subtract"));
                        minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Minus"));
                        this.gridViewWindow.CommandBindings.Add(new CommandBinding(minusSettings, ZoomEventHandlerMinus));
                    }

                    this.gridViewWindow.ShowDialog();
                }
                catch (Exception e)
                {
                    // Store the exception in a local variable that will be checked later.
                    if (e.InnerException != null)
                    {
                        this.exception = e.InnerException;
                    }
                    else
                    {
                        this.exception = e;
                    }
                }
            }));

            guiThread = new Thread(threadStart);
            guiThread.SetApartmentState(ApartmentState.STA);

            guiThread.Start();
        }
Exemple #14
0
 /// <summary>
 /// Creates a new ManagementList.
 /// </summary>
 /// <param name="outputMode">Output mode of the out-gridview</param>
 /// <returns>A new ManagementList</returns>
 private ManagementList CreateManagementList(string outputMode)
 {
     ManagementList newList = new ManagementList();
     
     newList.ViewSaverUserActionState = UserActionState.Hidden;
     newList.ViewManagerUserActionState = UserActionState.Hidden;
     newList.List.VerticalAlignment = VerticalAlignment.Stretch;
     newList.List.SetValue(Grid.RowProperty, 0);
     newList.List.SelectionMode = (outputMode == "Single") ? SelectionMode.Single : SelectionMode.Extended;
     
     return newList;
 }
Exemple #15
0
        private void StartWindow(string invocation, string outputModeOptions, AutoResetEvent closedEvent)
        {
            this.closedEvent = closedEvent;
            this.gridViewWindowLoaded = new AutoResetEvent(false);

            ParameterizedThreadStart threadStart = new ParameterizedThreadStart(
               new ThreadDelegate(delegate
               {
                   try
                   {
                       this.gridViewWindow = new Window();
                       this.managementList = CreateManagementList(outputModeOptions);
                       this.gridViewWindow.Loaded += new RoutedEventHandler(this.GridViewWindowLoaded);
                       this.gridViewWindow.Content = CreateMainGrid(outputModeOptions);
                       this.gridViewWindow.Title = invocation;
                       this.gridViewWindow.Closed += new EventHandler(this.GridViewWindowClosed);

                       RoutedCommand plusSettings = new RoutedCommand();
                       KeyGestureConverter keyGestureConverter = new KeyGestureConverter();

                       try
                       {
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn1Shortcut));
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn2Shortcut));
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn3Shortcut));
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomIn4Shortcut));
                           this.gridViewWindow.CommandBindings.Add(new CommandBinding(plusSettings, ZoomEventHandlerPlus));
                       }
                       catch (NotSupportedException)
                       {
                           //localized has a problematic string - going to default
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Add"));
                           plusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Plus"));
                           this.gridViewWindow.CommandBindings.Add(new CommandBinding(plusSettings, ZoomEventHandlerPlus));
                       };

                       RoutedCommand minusSettings = new RoutedCommand();
                       try
                       {
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut1Shortcut));
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut2Shortcut));
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut3Shortcut));
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString(UICultureResources.ZoomOut4Shortcut));

                           this.gridViewWindow.CommandBindings.Add(new CommandBinding(minusSettings, ZoomEventHandlerMinus));
                       }
                       catch (NotSupportedException)
                       {
                           //localized has a problematic string - going to default
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Subtract"));
                           minusSettings.InputGestures.Add((KeyGesture)keyGestureConverter.ConvertFromString("Ctrl+Minus"));
                           this.gridViewWindow.CommandBindings.Add(new CommandBinding(minusSettings, ZoomEventHandlerMinus));
                       }

                       this.gridViewWindow.ShowDialog();
                   }
                   catch (Exception e)
                   {
                       // Store the exception in a local variable that will be checked later.
                       if (e.InnerException != null)
                       {
                           this.exception = e.InnerException;
                       }
                       else
                       {
                           this.exception = e;
                       }
                   }
               }));

            guiThread = new Thread(threadStart);
            guiThread.SetApartmentState(ApartmentState.STA);

            guiThread.Start();
        }