public MemberPropertiesControl()
        {
            TabCtrl = new RanetTabControl();

            PropertiesCtrl = new PropertiesListControl();

            TabItem PropertiesTab = new TabItem();

            PropertiesTab.Header  = Localization.Properties;
            PropertiesTab.Style   = TabCtrl.Resources["TabControlOutputItem"] as Style;
            PropertiesTab.Content = PropertiesCtrl;
            TabCtrl.TabCtrl.Items.Add(PropertiesTab);

            PropertiesTab.Header = Localization.Properties;

            TabToolBar toolBar = TabCtrl.ToolBar;

            if (toolBar != null)
            {
                RanetToolBarButton copyBtn = new RanetToolBarButton();
                ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip);
                copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16);
                toolBar.Stack.Children.Add(copyBtn);
                copyBtn.Click += new RoutedEventHandler(CopyButton_Click);
            }

            this.Content = TabCtrl;
        }
Esempio n. 2
0
        public CalculationsEditor()
        {
            InitializeComponent();

            m_AddCalcMemberButton         = new RanetToolBarButton();
            m_AddCalcMemberButton.Content = UiHelper.CreateIcon(UriResources.Images.AddMeasure16);
            m_AddCalcMemberButton.Click  += new RoutedEventHandler(m_AddCalcMemberButton_Click);
            ToolTipService.SetToolTip(m_AddCalcMemberButton, Localization.CalcMemberEditor_AddMember);
            ToolBar.AddItem(m_AddCalcMemberButton);

            m_AddNamedSetButton         = new RanetToolBarButton();
            m_AddNamedSetButton.Content = UiHelper.CreateIcon(UriResources.Images.AddNamedSet16);
            m_AddNamedSetButton.Click  += new RoutedEventHandler(m_AddNamedSetButton_Click);
            ToolTipService.SetToolTip(m_AddNamedSetButton, Localization.CalcMemberEditor_AddNamedSet);
            ToolBar.AddItem(m_AddNamedSetButton);

            m_DeleteCalcMemberButton           = new RanetToolBarButton();
            m_DeleteCalcMemberButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveCross16);
            m_DeleteCalcMemberButton.Click    += new RoutedEventHandler(m_DeleteCalcMemberButton_Click);
            m_DeleteCalcMemberButton.IsEnabled = false;
            ToolTipService.SetToolTip(m_DeleteCalcMemberButton, Localization.CalcMemberEditor_DeleteMember);
            ToolBar.AddItem(m_DeleteCalcMemberButton);

            m_ClearButton           = new RanetToolBarButton();
            m_ClearButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16);
            m_ClearButton.Click    += new RoutedEventHandler(m_ClearButton_Click);
            m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
            ToolTipService.SetToolTip(m_ClearButton, Localization.CalcMemberEditor_Clear);
            ToolBar.AddItem(m_ClearButton);

            MembersList.SelectionChanged += new EventHandler <SelectionChangedEventArgs <CalculationInfoBase> >(MembersList_SelectionChanged);

            MemberCtrl.InnerEditStart += new EventHandler(MemberCtrl_InnerEditStart);
            MemberCtrl.InnerEditEnd   += new EventHandler(MemberCtrl_InnerEditEnd);
            MemberCtrl.EditEnd        += new EventHandler(MemberCtrl_EditEnd);

            SetCtrl.EditEnd += new EventHandler(MemberCtrl_EditEnd);

            FormatStrings.Add("#");
            FormatStrings.Add("#,#");
            FormatStrings.Add("#,#.00");
            FormatStrings.Add("$#,#;-$#,#;");
            FormatStrings.Add("$#,#.00;-$#,#.00;");
            FormatStrings.Add("Standard");
            FormatStrings.Add("Short Date");
            FormatStrings.Add("Short Time");
            FormatStrings.Add("Percent");

            CubeBrowser.DragNodes      = true;
            CubeBrowser.DragStarted   += new EventHandler <DragNodeArgs <DragStartedEventArgs> >(CubeBrowser_DragStarted);
            CubeBrowser.DragDelta     += new EventHandler <DragNodeArgs <DragDeltaEventArgs> >(CubeBrowser_DragDelta);
            CubeBrowser.DragCompleted += new EventHandler <DragNodeArgs <DragCompletedEventArgs> >(CubeBrowser_DragCompleted);
        }
        public CustomCellConditionsEditor()
        {
            InitializeComponent();

            lblStyleDetails.Text = Localization.StyleDetails_Label;
            lblStyles.Text       = Localization.Styles_Label;

            DescriptorsList.SelectionChanged += new EventHandler <SelectionChangedEventArgs <CellConditionsDescriptor> >(DescriptorsList_SelectionChanged);
            DescriptorDetails.EditEnd        += new EventHandler(DescriptorDetails_EditEnd);

            AddButton         = new RanetToolBarButton();
            AddButton.Content = UiHelper.CreateIcon(UriResources.Images.New16);
            AddButton.Click  += new RoutedEventHandler(m_AddButton_Click);
            ToolTipService.SetToolTip(AddButton, Localization.Toolbar_NewButton_ToolTip);
            ToolBar.AddItem(AddButton);

            DeleteButton           = new RanetToolBarButton();
            DeleteButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveCross16);
            DeleteButton.Click    += new RoutedEventHandler(m_DeleteButton_Click);
            DeleteButton.IsEnabled = false;
            ToolTipService.SetToolTip(DeleteButton, Localization.Toolbar_DeleteButton_ToolTip);
            ToolBar.AddItem(DeleteButton);

            DeleteAllButton           = new RanetToolBarButton();
            DeleteAllButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16);
            DeleteAllButton.Click    += new RoutedEventHandler(m_DeleteAllButton_Click);
            DeleteAllButton.IsEnabled = false;
            ToolTipService.SetToolTip(DeleteAllButton, Localization.Toolbar_DeleteAllButton_ToolTip);
            ToolBar.AddItem(DeleteAllButton);

            m_ImportButton         = new RanetToolBarButton();
            m_ImportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16);
            m_ImportButton.Click  += new RoutedEventHandler(m_ImportButton_Click);
            ToolTipService.SetToolTip(m_ImportButton, Localization.LoadSettings_ToolTip);
            ToolBar.AddItem(m_ImportButton);

            m_ExportButton         = new RanetToolBarButton();
            m_ExportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16);
            m_ExportButton.Click  += new RoutedEventHandler(m_ExportButton_Click);
            ToolTipService.SetToolTip(m_ExportButton, Localization.SaveSettings_ToolTip);
            ToolBar.AddItem(m_ExportButton);

            DescriptorsList.DeleteAllButton_IsEnabledChanged += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteAllButton_IsEnabledChanged);
            DescriptorsList.DeleteButton_IsEnabledChanged    += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteButton_IsEnabledChanged);
        }
        public CellPropertiesControl()
        {
            InitializeComponent();

            PropertiesCtrl = new PropertiesListControl();
            TupleCtrl      = new CellTupleControl();

            TabItem PropertiesTab = new TabItem();

            PropertiesTab.Header  = Localization.Properties;
            PropertiesTab.Style   = TabCtrl.Resources["TabControlOutputItem"] as Style;
            PropertiesTab.Content = PropertiesCtrl;

            TabItem TupleTab = new TabItem();

            TupleTab.Header  = Localization.Tuple;
            TupleTab.Style   = TabCtrl.Resources["TabControlOutputItem"] as Style;
            TupleTab.Content = TupleCtrl;

            TabCtrl.TabCtrl.Items.Add(PropertiesTab);
            TabCtrl.TabCtrl.Items.Add(TupleTab);

            TupleCtrl.HierarchyColumn.Width = PropertiesCtrl.PropertyColumnWidth;
            TupleCtrl.MemberColumn.Width    = PropertiesCtrl.ValueColumnWidth;

            PropertiesTab.Header = Localization.Properties;
            TupleTab.Header      = Localization.Tuple;

            TabToolBar toolBar = TabCtrl.ToolBar;

            if (toolBar != null)
            {
                RanetToolBarButton copyBtn = new RanetToolBarButton();
                ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip);
                copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16);
                toolBar.Stack.Children.Add(copyBtn);
                copyBtn.Click += new RoutedEventHandler(CopyButton_Click);
            }
        }
        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;
        }
        public DataSourceInfoControl()
        {
            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());
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });

            // Строка соединения
            TextBlock connectionString_Label = new TextBlock()
            {
                Text = Localization.Connection + ":"
            };

            LayoutRoot.Children.Add(connectionString_Label);

            connectionString = new RichTextBox()
            {
                IsReadOnly = true
            };
            connectionString.Height = 22;
            connectionString.Margin = new Thickness(0, 5, 0, 0);
            LayoutRoot.Children.Add(connectionString);
            Grid.SetRow(connectionString, 1);
            //connectionString.Background = new SolidColorBrush(Colors.Transparent);

            // Запрос
            queryInfoTabControl        = new RanetTabControl();
            queryInfoTabControl.Margin = new Thickness(0, 5, 0, 0);
            LayoutRoot.Children.Add(queryInfoTabControl);
            Grid.SetRow(queryInfoTabControl, 2);

            // Закладка "MDX Query"
            TabItem queryTab = new TabItem();

            queryTab.Header = Localization.MDXQuery;
            queryTab.Style  = queryInfoTabControl.Resources["TabControlOutputItem"] as Style;
            queryInfoTabControl.TabCtrl.Items.Add(queryTab);

            Grid queryTabLayoutRoot = new Grid()
            {
                Margin = new Thickness(0, 0, 0, 0)
            };

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

            mdxQuery = new RichTextBox()
            {
                AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true
            };
            mdxQuery.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            mdxQuery.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            queryTabLayoutRoot.Children.Add(mdxQuery);
            Grid.SetRow(mdxQuery, 0);

            parseMdx = new CheckBox()
            {
                Margin = new Thickness(0, 5, 0, 0)
            };
            parseMdx.Content = Localization.DataSourceInfo_ShowParsedQuery;
            queryTabLayoutRoot.Children.Add(parseMdx);
            Grid.SetRow(parseMdx, 1);
            parseMdx.Checked   += new RoutedEventHandler(parseMdx_CheckedChanged);
            parseMdx.Unchecked += new RoutedEventHandler(parseMdx_CheckedChanged);

            queryTab.Content = queryTabLayoutRoot;

            // Закладка "Moved Axes"
            TabItem movedAxesTab = new TabItem();

            movedAxesTab.Header = Localization.DataSourceInfo_MovedAxes;
            movedAxesTab.Style  = queryInfoTabControl.Resources["TabControlOutputItem"] as Style;
            queryInfoTabControl.TabCtrl.Items.Add(movedAxesTab);

            Grid movedAxesTabLayoutRoot = new Grid()
            {
                Margin = new Thickness(0, 0, 0, 0)
            };

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

            movedAxes_MdxQuery = new RichTextBox()
            {
                AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true
            };
            movedAxes_MdxQuery.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            movedAxes_MdxQuery.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            movedAxesTabLayoutRoot.Children.Add(movedAxes_MdxQuery);
            Grid.SetRow(movedAxes_MdxQuery, 0);

            parseMovedAxesMdx = new CheckBox()
            {
                Margin = new Thickness(0, 5, 0, 0)
            };
            parseMovedAxesMdx.Content = Localization.DataSourceInfo_ShowParsedQuery;
            movedAxesTabLayoutRoot.Children.Add(parseMovedAxesMdx);
            Grid.SetRow(parseMovedAxesMdx, 1);
            parseMovedAxesMdx.Checked   += new RoutedEventHandler(parseMovedAxesMdx_CheckedChanged);
            parseMovedAxesMdx.Unchecked += new RoutedEventHandler(parseMovedAxesMdx_CheckedChanged);

            movedAxesTab.Content = movedAxesTabLayoutRoot;

            // Закладка "Update Script"
            scriptTab        = new TabItem();
            scriptTab.Header = Localization.UpdateScript;
            scriptTab.Style  = queryInfoTabControl.Resources["TabControlOutputItem"] as Style;
            queryInfoTabControl.TabCtrl.Items.Add(scriptTab);

            Grid scriptTabLayoutRoot = new Grid()
            {
                Margin = new Thickness(0, 0, 0, 0)
            };

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

            updateScript = new RichTextBox()
            {
                AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true
            };
            updateScript.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            updateScript.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            scriptTabLayoutRoot.Children.Add(updateScript);
            Grid.SetRow(updateScript, 0);

            parseUpdateScript = new CheckBox()
            {
                Margin = new Thickness(0, 5, 0, 0)
            };
            parseUpdateScript.Content = Localization.DataSourceInfo_ShowParsedScript;
            scriptTabLayoutRoot.Children.Add(parseUpdateScript);
            Grid.SetRow(parseUpdateScript, 1);
            parseUpdateScript.Checked   += new RoutedEventHandler(parseUpdateScript_CheckedChanged);
            parseUpdateScript.Unchecked += new RoutedEventHandler(parseUpdateScript_CheckedChanged);

            scriptTab.Content = scriptTabLayoutRoot;

            this.Content = LayoutRoot;

            TabToolBar toolBar = queryInfoTabControl.ToolBar;

            if (toolBar != null)
            {
                RanetToolBarButton copyBtn = new RanetToolBarButton();
                ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip);
                copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16);
                toolBar.Stack.Children.Add(copyBtn);
                copyBtn.Click += new RoutedEventHandler(CopyButton_Click);
            }
        }
Esempio n. 8
0
        public ObjectsListControlBase()
        {
            Grid LayoutRoot = new Grid();

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

            ToolBar = new RanetToolBar();
            LayoutRoot.Children.Add(ToolBar);

            AddButton         = new RanetToolBarButton();
            AddButton.Content = UiHelper.CreateIcon(UriResources.Images.New16);
            AddButton.Click  += new RoutedEventHandler(m_AddButton_Click);
            ToolTipService.SetToolTip(AddButton, Localization.Toolbar_NewButton_ToolTip);
            ToolBar.AddItem(AddButton);

            DeleteButton           = new RanetToolBarButton();
            DeleteButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveCross16);
            DeleteButton.Click    += new RoutedEventHandler(m_DeleteButton_Click);
            DeleteButton.IsEnabled = false;
            ToolTipService.SetToolTip(DeleteButton, Localization.Toolbar_DeleteButton_ToolTip);
            ToolBar.AddItem(DeleteButton);
            DeleteButton.IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnDeleteButton_IsEnabledChanged);

            DeleteAllButton           = new RanetToolBarButton();
            DeleteAllButton.Content   = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16);
            DeleteAllButton.Click    += new RoutedEventHandler(m_DeleteAllButton_Click);
            DeleteAllButton.IsEnabled = false;
            ToolTipService.SetToolTip(DeleteAllButton, Localization.Toolbar_DeleteAllButton_ToolTip);
            ToolBar.AddItem(DeleteAllButton);
            DeleteAllButton.IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnDeleteAllButton_IsEnabledChanged);

            Tree = new CustomTree()
            {
                BorderBrush = new SolidColorBrush(Colors.DarkGray)
            };
            Tree.SelectedItemChanged += new RoutedPropertyChangedEventHandler <object>(m_Tree_SelectedItemChanged);
            LayoutRoot.Children.Add(Tree);
            Grid.SetRow(Tree, 1);

            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;

            this.Loaded  += new RoutedEventHandler(ObjectsListControlBase_Loaded);
            Tree.KeyDown += new KeyEventHandler(m_Tree_KeyDown);
        }