Example #1
0
        public DatePickerEx()
        {
            m_Waiting      = new BusyControl();
            m_Waiting.Text = Localization.Loading;

            this.Loaded += new RoutedEventHandler(DatePickerEx_Loaded);
        }
Example #2
0
        private static void OnBusyStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var element = d as FrameworkElement;

            if (element != null)
            {
                var isBusy = (bool)e.NewValue;

                if (isBusy)
                {
                    var     busyCtrl = new BusyControl();
                    Adorner adorner  = new ControlAdorner(element, busyCtrl);
                    AdornerLayer.GetAdornerLayer(element).Add(adorner);

                    element.SetValue(AdornerProperty, adorner);
                }
                else
                {
                    var adorner = element.GetValue(AdornerProperty) as Adorner;
                    if (adorner != null)
                    {
                        AdornerLayer.GetAdornerLayer(element).Remove(adorner);
                        element.SetValue(AdornerProperty, null);
                    }
                }
            }
        }
        public DateChoiceCtrl()
        {
            Grid LayoutRoot = new Grid();

            m_Calendar = new System.Windows.Controls.Calendar();
            m_Calendar.SelectionMode         = CalendarSelectionMode.SingleDate;
            m_Calendar.DisplayDate           = DateTime.Today;
            m_Calendar.DisplayDateChanged   += new EventHandler <CalendarDateChangedEventArgs>(m_Calendar_DisplayDateChanged);
            m_Calendar.SelectedDatesChanged += new EventHandler <SelectionChangedEventArgs>(m_Calendar_SelectedDatesChanged);

            LayoutRoot.Children.Add(m_Calendar);

            m_Waiting      = new BusyControl();
            m_Waiting.Text = Localization.Loading;
            LayoutRoot.Children.Add(m_Waiting);
            Grid.SetRow(m_Waiting, 1);

            IsBusy = false;

            this.Content = LayoutRoot;

            resDoubleClickTimer            = new Storyboard();
            resDoubleClickTimer.Duration   = new Duration(new TimeSpan(0, 0, 0, 0, 250));
            resDoubleClickTimer.Completed += new EventHandler(Storyboard_Completed);
            LayoutRoot.Resources.Add("resDoubleClickTimer", resDoubleClickTimer);

            m_Calendar.MouseLeftButtonDown += new MouseButtonEventHandler(Calendar_MouseLeftButtonDown);
        }
Example #4
0
        public SlicerCtrl()
        {
            Grid LayoutRoot = new Grid();

            m_DataGrid = new Grid();
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                MaxWidth = 20
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                MaxHeight = 20
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            m_Panel             = new StackPanel();
            m_Panel.Orientation = Orientation.Horizontal;
            RanetHotButton m_Clear = new RanetHotButton();

            m_Clear.Width   = 20;
            m_Clear.Height  = 20;
            m_Clear.Content = "C";
            m_Clear.Click  += new RoutedEventHandler(m_Clear_Click);
            LayoutRoot.Children.Add(m_Clear);
            Grid.SetRow(m_Clear, 0);
            Grid.SetColumn(m_Clear, 1);
            LayoutRoot.Children.Add(m_Panel);
            Grid.SetRow(m_Panel, 1);
            Grid.SetColumn(m_Panel, 0);
            LayoutRoot.Children.Add(m_DataGrid);
            Grid.SetColumn(m_DataGrid, 0);
            Grid.SetRow(m_DataGrid, 2);

            m_Waiting      = new BusyControl();
            m_Waiting.Text = Localization.Loading;
            //LayoutRoot.Children.Add(m_Waiting);
            //Grid.SetRow(m_Waiting, 1);

            IsBusy = false;

            this.Content = LayoutRoot;
            //this.SlicerHeight = 9;
            //this.SlicerWidth = 9;
            //this.m_DataGrid.MouseLeftButtonDown += new MouseButtonEventHandler(m_DataGrid_MouseLeftButtonDown);
            //this.m_DataGrid.MouseLeftButtonUp += new MouseButtonEventHandler(m_DataGrid_MouseLeftButtonUp);
            this.DirectionChanged += new EventHandler <ChangedDirectionEventArgs>(SlicerCtrl_DirectionChanged);
            //this.m_Panel.MouseMove += new MouseEventHandler(m_Panel_MouseMove);
            //this.Content = m_DataGrid;
        }
Example #5
0
        public SlicerCtrl()
        {
            viewer = new ScrollViewer();
            viewer.BorderThickness = new Thickness(0);
            viewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            viewer.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            Grid LayoutRoot = new Grid();

            m_DataGrid = new Grid();
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                MaxWidth = 20
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                MaxHeight = 20
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            m_Panel             = new StackPanel();
            m_Panel.Orientation = Orientation.Horizontal;
            m_Clear             = new RanetHotButton();
            m_Clear.Width       = 20;
            m_Clear.Height      = 20;
            m_Clear.Content     = "C";
            m_Clear.Click      += new RoutedEventHandler(m_Clear_Click);
            m_Clear.Visibility  = System.Windows.Visibility.Collapsed;
            LayoutRoot.Children.Add(m_Clear);
            Grid.SetRow(m_Clear, 0);
            Grid.SetColumn(m_Clear, 1);
            LayoutRoot.Children.Add(m_Panel);
            Grid.SetRow(m_Panel, 1);
            Grid.SetColumn(m_Panel, 0);
            LayoutRoot.Children.Add(m_DataGrid);
            Grid.SetColumn(m_DataGrid, 0);
            Grid.SetRow(m_DataGrid, 2);

            grdIsWaiting = new Grid()
            {
                Background = new SolidColorBrush(Color.FromArgb(125, 0xFF, 0xFF, 0xFF))
            };
            grdIsWaiting.Visibility = Visibility.Collapsed;
            m_Waiting      = new BusyControl();
            m_Waiting.Text = Localization.Loading;
            grdIsWaiting.Children.Add(m_Waiting);
            LayoutRoot.Children.Add(grdIsWaiting);
            Grid.SetColumnSpan(grdIsWaiting, LayoutRoot.ColumnDefinitions.Count > 0 ? LayoutRoot.ColumnDefinitions.Count : 1);
            Grid.SetRowSpan(grdIsWaiting, LayoutRoot.RowDefinitions.Count > 0 ? LayoutRoot.RowDefinitions.Count : 1);

            viewer.Content    = LayoutRoot;
            this.Content      = viewer;
            this.SlicerHeight = 10;
            this.SlicerWidth  = 10;
            //this.m_DataGrid.MouseLeftButtonDown += new MouseButtonEventHandler(m_DataGrid_MouseLeftButtonDown);
            //this.m_DataGrid.MouseLeftButtonUp += new MouseButtonEventHandler(m_DataGrid_MouseLeftButtonUp);
            this.DirectionChanged += new EventHandler <ChangedDirectionEventArgs>(SlicerCtrl_DirectionChanged);

            //this.m_Panel.MouseMove += new MouseEventHandler(m_Panel_MouseMove);
            //this.Content = m_DataGrid;
        }
        public ValueCopyControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            Grid Row0_LayoutRoot = new Grid();

            Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            //Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });

            // Тип копирования
            TextBlock Label_CopyType = new TextBlock()
            {
                Text = Localization.ValueCopyControl_TypeOfCopying, Margin = new Thickness(0)
            };

            Row0_LayoutRoot.Children.Add(Label_CopyType);
            Grid.SetRow(Label_CopyType, 0);
            Grid.SetColumnSpan(Label_CopyType, 2);
            m_CopyType        = new ComboBoxEx();
            m_CopyType.Margin = new Thickness(0, 5, 0, 0);

            ItemControlBase ctrl;

            ctrl      = new ItemControlBase(false);
            ctrl.Text = Localization.ValueCopyControl_CopyValueFromSource;
            ctrl.Tag  = ValueCopyTypes.CopyValueFromSource;
            m_CopyType.Combo.Items.Add(ctrl);
            ctrl      = new ItemControlBase(false);
            ctrl.Text = Localization.ValueCopyControl_DeliveryValuePropotrionalSource;
            ctrl.Tag  = ValueCopyTypes.DeliveryValuePropotrionalSource;
            m_CopyType.Combo.Items.Add(ctrl);
            Row0_LayoutRoot.Children.Add(m_CopyType);
            Grid.SetRow(m_CopyType, 1);
            Grid.SetColumnSpan(m_CopyType, 2);

            // Коэффициент
            TextBlock Label_Coefficient = new TextBlock()
            {
                Text = Localization.ValueCopyControl_Сoefficient, Margin = new Thickness(0, 5, 0, 0)
            };

            Row0_LayoutRoot.Children.Add(Label_Coefficient);
            Grid.SetRow(Label_Coefficient, 2);
            m_Coefficient = new RichTextBox()
            {
                Text = "1", Margin = new Thickness(0, 5, 0, 0)
            };
            Row0_LayoutRoot.Children.Add(m_Coefficient);
            Grid.SetRow(m_Coefficient, 3);

            // Значение
            TextBlock Label_Value = new TextBlock()
            {
                Text = Localization.ValueCopyControl_Value, Margin = new Thickness(5, 5, 0, 0)
            };

            Row0_LayoutRoot.Children.Add(Label_Value);
            Grid.SetRow(Label_Value, 2);
            Grid.SetColumn(Label_Value, 1);
            m_Value = new RichTextBox()
            {
                Text = "0", Margin = new Thickness(5, 5, 0, 0)
            };
            Row0_LayoutRoot.Children.Add(m_Value);
            Grid.SetRow(m_Value, 3);
            Grid.SetColumn(m_Value, 1);

            m_CopyType.SelectionChanged   += new SelectionChangedEventHandler(m_CopyType_SelectionChanged);
            m_CopyType.Combo.SelectedIndex = 0;
            LayoutRoot.Children.Add(Row0_LayoutRoot);
            Grid.SetRow(Row0_LayoutRoot, 1);

            Grid Row1_LayoutRoot = new Grid();

            Row1_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            Row1_LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Координаты
            TextBlock Label_Coordinates = new TextBlock()
            {
                Text = Localization.ValueCopyControl_Coordinates, Margin = new Thickness(0, 5, 0, 0)
            };

            Row1_LayoutRoot.Children.Add(Label_Coordinates);
            Grid.SetRow(Label_Coordinates, 0);
            m_Coordinates = new CoordinatesControl();
            m_Coordinates.GetOlapDataLoader += new EventHandler <GetIDataLoaderArgs>(m_Coordinates_GetOlapDataLoader);
            m_Coordinates.Margin             = new Thickness(5);

            Border coordinates_Border = new Border()
            {
                Margin = new Thickness(0, 5, 0, 0), BorderBrush = new SolidColorBrush(Colors.DarkGray), BorderThickness = new Thickness(1)
            };

            coordinates_Border.Child = m_Coordinates;
            Row1_LayoutRoot.Children.Add(coordinates_Border);
            Grid.SetRow(coordinates_Border, 1);

            LayoutRoot.Children.Add(Row1_LayoutRoot);
            Grid.SetRow(Row1_LayoutRoot, 2);

            // Ожидание загрузки
            m_Waiting      = new BusyControl();
            m_Waiting.Text = Localization.Loading;
            Row1_LayoutRoot.Children.Add(m_Waiting);
            Grid.SetRow(m_Waiting, 2);

            // ТУЛБАР
            m_ToolBar        = new RanetToolBar();
            m_ToolBar.Margin = new Thickness(0, 0, 0, 4);
            LayoutRoot.Children.Add(m_ToolBar);
            Grid.SetRow(m_ToolBar, 0);
            UseToolbar = false;

            RanetToolBarButton m_ImportLayout = new RanetToolBarButton();

            m_ImportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16);
            m_ImportLayout.Click  += new RoutedEventHandler(m_ImportLayout_Click);
            ToolTipService.SetToolTip(m_ImportLayout, Localization.ValueCopyControl_ImportSettings_ToolTip);
            m_ToolBar.AddItem(m_ImportLayout);

            RanetToolBarButton m_ExportLayout = new RanetToolBarButton();

            m_ExportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16);
            m_ExportLayout.Click  += new RoutedEventHandler(m_ExportLayout_Click);
            ToolTipService.SetToolTip(m_ExportLayout, Localization.ValueCopyControl_ExportSettings_ToolTip);
            m_ToolBar.AddItem(m_ExportLayout);

            IsBusy       = false;
            this.Content = LayoutRoot;
        }
        public ValueCopyDesignerControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // ТУЛБАР
            m_ToolBar        = new RanetToolBar();
            m_ToolBar.Margin = new Thickness(0, 0, 0, 4);
            LayoutRoot.Children.Add(m_ToolBar);
            Grid.SetRow(m_ToolBar, 0);

            // Контрол копирования данных
            m_CopyControl             = new ValueCopyControl();
            m_CopyControl.IsAdminMode = true;
            LayoutRoot.Children.Add(m_CopyControl);
            Grid.SetRow(m_CopyControl, 1);

            RanetToolBarButton m_ImportLayout = new RanetToolBarButton();

            m_ImportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16);
            m_ImportLayout.Click  += new RoutedEventHandler(m_ImportLayout_Click);
            ToolTipService.SetToolTip(m_ImportLayout, Localization.ValueCopyControl_ImportSettings_ToolTip);
            m_ToolBar.AddItem(m_ImportLayout);

            RanetToolBarButton m_ExportLayout = new RanetToolBarButton();

            m_ExportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16);
            m_ExportLayout.Click  += new RoutedEventHandler(m_ExportLayout_Click);
            ToolTipService.SetToolTip(m_ExportLayout, Localization.ValueCopyControl_ExportSettings_ToolTip);
            m_ToolBar.AddItem(m_ExportLayout);

            m_ToolBar.AddItem(new RanetToolBarSplitter());

            RanetToolBarButton m_PreviewButton = new RanetToolBarButton();

            m_PreviewButton.Content = UiHelper.CreateIcon(UriResources.Images.Run16);
            m_PreviewButton.Click  += new RoutedEventHandler(m_PreviewButton_Click);
            ToolTipService.SetToolTip(m_PreviewButton, Localization.ValueCopyControl_RunCopyForm_Tooltip);
            m_ToolBar.AddItem(m_PreviewButton);

            m_OlapDataLoader = GetOlapDataLoader();
            m_StorageManager = GetStorageManager();

            m_StorageManager.InvokeCompleted += new EventHandler <DataLoaderEventArgs>(StorageManager_ActionCompleted);
            m_OlapDataLoader.DataLoaded      += new EventHandler <DataLoaderEventArgs>(OlapDataLoader_DataLoaded);

            grdIsWaiting = new Grid()
            {
                Background = new SolidColorBrush(Color.FromArgb(125, 0xFF, 0xFF, 0xFF))
            };
            grdIsWaiting.Visibility = Visibility.Collapsed;
            BusyControl m_Waiting = new BusyControl();

            m_Waiting.Text = Localization.Loading;
            grdIsWaiting.Children.Add(m_Waiting);

            LayoutRoot.Children.Add(grdIsWaiting);
            Grid.SetColumnSpan(grdIsWaiting, LayoutRoot.ColumnDefinitions.Count > 0 ? LayoutRoot.ColumnDefinitions.Count : 1);
            Grid.SetRowSpan(grdIsWaiting, LayoutRoot.RowDefinitions.Count > 0 ? LayoutRoot.RowDefinitions.Count : 1);

            this.Content = LayoutRoot;
        }
Example #8
0
 /// <summary>
 /// Method to manage the changed language event
 /// </summary>
 /// <param name="obj"></param>
 private void ManageChangedLanguage(ChangedLanguageEvent obj)
 {
     BusyControl.RefreshUI();
     MessageListControl.RefreshUI();
 }