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; }
public MemberChoiceControl() { try { m_Initializing = true; Grid LayoutRoot = new Grid(); LayoutRoot.RowDefinitions.Add(new RowDefinition()); // Строка для кнопок //OK LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(2, GridUnitType.Star), MinWidth = 50 }); // Колонка для свойств LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { MinWidth = 50 }); tabControl = new RanetTabControl(); tabControl.TabCtrl.SelectionChanged += new SelectionChangedEventHandler(TabControl_SelectionChanged); membersTab = new TabItem(); membersTab.Header = Localization.Members; membersTab.Style = tabControl.Resources["TabControlOutputItem"] as Style; findTab = new TabItem(); findTab.Header = Localization.Find; findTab.Style = tabControl.Resources["TabControlOutputItem"] as Style; mdxSetTab = new TabItem(); mdxSetTab.Header = Localization.MemberChoice_Selected; mdxSetTab.Style = tabControl.Resources["TabControlOutputItem"] as Style; tabControl.TabCtrl.Items.Add(membersTab); tabControl.TabCtrl.Items.Add(findTab); tabControl.TabCtrl.Items.Add(mdxSetTab); LayoutRoot.Children.Add(tabControl); //OK StackPanel buttonsPanel = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right }; //LayoutRoot.Children.Add(buttonsPanel); //Grid.SetRow(buttonsPanel, 1); //Border border = new Border() { BorderBrush = new SolidColorBrush(Colors.DarkGray), BorderThickness = new Thickness(1), Padding = new Thickness(5), Background = new SolidColorBrush(Colors.White) }; //border.Child = LayoutRoot; // Растягиваем дерево Grid.SetColumnSpan(tabControl, 2); // Закладка MEMBERS Grid membersTab_LayoutRoot = new Grid(); membersTab.Content = membersTab_LayoutRoot; membersTab_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); membersTab_LayoutRoot.RowDefinitions.Add(new RowDefinition()); membersTree = new CustomTree() { BorderBrush = new SolidColorBrush(Colors.DarkGray) }; membersTree.Margin = new Thickness(0, 3, 0, 0); membersTree.SelectedItemChanged += new RoutedPropertyChangedEventHandler<object>(membersTree_SelectedItemChanged); membersTab_LayoutRoot.Children.Add(membersTree); Grid.SetRow(membersTree, 1); GridSplitter splitter_Vert = new GridSplitter(); splitter_Vert.IsTabStop = false; LayoutRoot.Children.Add(splitter_Vert); Grid.SetColumn(splitter_Vert, 0); Grid.SetRow(splitter_Vert, 0); splitter_Vert.Background = new SolidColorBrush(Colors.Transparent); splitter_Vert.HorizontalAlignment = HorizontalAlignment.Right; splitter_Vert.VerticalAlignment = VerticalAlignment.Stretch; splitter_Vert.Width = 3; // Свойства элемента m_CurrentMemberControl = new PropertiesControl(); m_CurrentMemberControl.Background = new SolidColorBrush(Color.FromArgb(0x7F, 128, 128, 128)); m_CurrentMemberControl.PropertiesList.PropertyColumnWidth = new DataGridLength(100); m_PropertiesLayoutBorder = new Border() { BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x80, 0x80, 0x80)), BorderThickness = new Thickness(1) }; m_PropertiesLayoutBorder.Child = m_CurrentMemberControl; LayoutRoot.Children.Add(m_PropertiesLayoutBorder); Grid.SetRow(m_PropertiesLayoutBorder, 0); Grid.SetColumn(m_PropertiesLayoutBorder, 1); // Прячем свойства m_PropertiesLayoutBorder.Visibility = Visibility.Collapsed; StackPanel members_toolBar = new StackPanel(); members_toolBar.Orientation = Orientation.Horizontal; membersTab_LayoutRoot.Children.Add(members_toolBar); Grid.SetRow(members_toolBar, 0); Grid.SetColumnSpan(members_toolBar, 2); RanetToolBarButton Refresh_Button = new RanetToolBarButton(); Refresh_Button.Margin = new Thickness(0, 0, 0, 0); Refresh_Button.Click += new RoutedEventHandler(RefreshButton_Click); Refresh_Button.Content = UiHelper.CreateIcon(UriResources.Images.Refresh16); ToolTipService.SetToolTip(Refresh_Button, Localization.MemberChoice_Refresh_ToolTip); members_toolBar.Children.Add(Refresh_Button); Clear_Choice_Button = new RanetToolBarButton(); Clear_Choice_Button.Click += new RoutedEventHandler(Clear_Choice_Button_Click); Clear_Choice_Button.Content = UiHelper.CreateIcon(UriResources.Images.ClearChoice16); ToolTipService.SetToolTip(Clear_Choice_Button, Localization.MemberChoice_ClearSelection_ToolTip); members_toolBar.Children.Add(Clear_Choice_Button); Levels_ComboBox = new ComboBoxEx(); Levels_ComboBox.Margin = new Thickness(2, 0, 0, 0); Levels_ComboBox.Width = 150; members_toolBar.Children.Add(Levels_ComboBox); //OK buttonsPanel.Margin = new Thickness(0, 5, 0, 0); //Grid.SetColumnSpan(buttonsPanel, 2); //OkButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 10, 0) }; //OkButton.Content = Localization.DialogButton_Ok; //OkButton.Height = 22; //OkButton.Click += new RoutedEventHandler(OkButton_Click); //buttonsPanel.Children.Add(OkButton); //CancelButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 0, 0) }; //CancelButton.Content = Localization.DialogButton_Cancel; //CancelButton.Height = 22; //CancelButton.Click += new RoutedEventHandler(CancelButton_Click); //buttonsPanel.Children.Add(CancelButton); membersTree.Special_MouseDoubleClick += new EventHandler<CustomEventArgs<CustomTreeNode>>(node_SpecialNodeExpanded); // Закладка ПОИСК Grid findTab_LayoutRoot = new Grid(); findTab.Content = findTab_LayoutRoot; findTab_LayoutRoot.RowDefinitions.Add(new RowDefinition()); findTab_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); findTab_LayoutRoot.RowDefinitions.Add(new RowDefinition()); findTab_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(22) }); filterBuilder = new FilterBuilderControl(); filterBuilder.ApplyFilter += new EventHandler(filterBuilder_ApplyFilter); findTab_LayoutRoot.Children.Add(filterBuilder); RanetButton RunSearch_Button = new RanetButton(); RunSearch_Button.Height = 22; RunSearch_Button.Width = 75; RunSearch_Button.Margin = new Thickness(2, 5, 0, 0); RunSearch_Button.Content = Localization.Find; RunSearch_Button.HorizontalAlignment = HorizontalAlignment.Right; RunSearch_Button.Click += new RoutedEventHandler(RunSearch_Button_Click); findTab_LayoutRoot.Children.Add(RunSearch_Button); Grid.SetRow(RunSearch_Button, 1); // Дерево с результатом поиска findResultTree = new CustomTree() { BorderBrush = new SolidColorBrush(Colors.DarkGray) }; findResultTree.SelectedItemChanged += new RoutedPropertyChangedEventHandler<object>(tree_SelectedItemChanged); findResultTree.Margin = new Thickness(0, 5, 0, 0); findTab_LayoutRoot.Children.Add(findResultTree); Grid.SetRow(findResultTree, 2); // Количество найденных элементов Grid find_buttons_panel = new Grid(); find_buttons_panel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); find_buttons_panel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); TextBlock m_Find_Results = new TextBlock() { Text = Localization.MemberChoice_MembersFound }; m_Find_Results.VerticalAlignment = VerticalAlignment.Center; find_buttons_panel.Children.Add(m_Find_Results); m_Find_Count = new TextBlock() { Text = "0" }; m_Find_Count.VerticalAlignment = VerticalAlignment.Center; find_buttons_panel.Children.Add(m_Find_Count); Grid.SetColumn(m_Find_Count, 1); findTab_LayoutRoot.Children.Add(find_buttons_panel); Grid.SetRow(find_buttons_panel, 3); // Закладка ВЫБРАННЫЕ Grid mdxSetTab_LayoutRoot = new Grid(); mdxSetTab.Content = mdxSetTab_LayoutRoot; mdxSetTab_LayoutRoot.RowDefinitions.Add(new RowDefinition()); mdxSetTab_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(22) }); mdxSetTab_LayoutRoot.RowDefinitions.Add(new RowDefinition()); selectedList = new CustomTree() { BorderBrush = new SolidColorBrush(Colors.DarkGray) }; selectedList.SelectedItemChanged += new RoutedPropertyChangedEventHandler<object>(tree_SelectedItemChanged); mdxSetTab_LayoutRoot.Children.Add(selectedList); // Количество выбранных элементов Grid selected_buttons_panel = new Grid(); selected_buttons_panel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); selected_buttons_panel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); TextBlock m_Selected_Results = new TextBlock() { Text = Localization.MemberChoice_MembersSelected }; m_Selected_Results.Margin = new Thickness(0, 5, 0, 5); m_Selected_Results.VerticalAlignment = VerticalAlignment.Center; selected_buttons_panel.Children.Add(m_Selected_Results); m_Selected_Count = new TextBlock() { Text = "0" }; m_Selected_Count.VerticalAlignment = VerticalAlignment.Center; m_Selected_Count.Margin = new Thickness(0, 5, 0, 5); selected_buttons_panel.Children.Add(m_Selected_Count); Grid.SetColumn(m_Selected_Count, 1); mdxSetTab_LayoutRoot.Children.Add(selected_buttons_panel); Grid.SetRow(selected_buttons_panel, 1); mdxSetTextBox = new SimpleTextBox() { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true }; mdxSetTextBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; mdxSetTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; mdxSetTextBox.Margin = new Thickness(0, 0, 0, 0); mdxSetTextBox.BorderBrush = new SolidColorBrush(Colors.Black); mdxSetTab_LayoutRoot.Children.Add(mdxSetTextBox); Grid.SetRow(mdxSetTextBox, 2); SelectedItemChanged_Story = new Storyboard(); SelectedItemChanged_Story.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 500)); SelectedItemChanged_Story.Completed += new EventHandler(SelectedItemChanged_Story_Completed); membersTab_LayoutRoot.Resources.Add("SelectedItemChanged_Story", SelectedItemChanged_Story); // Кнопка для отображения свойств элемента m_ShowMemberPropertiesButton = new RanetToggleButton(); TabToolBar toolbar = tabControl.ToolBar; if (toolbar != null) { ToolTipService.SetToolTip(m_ShowMemberPropertiesButton, Localization.MemberChoice_ShowMemberProperties_ToolTip); m_ShowMemberPropertiesButton.Click += new RoutedEventHandler(SowMemberPropertiesButton_Click); m_ShowMemberPropertiesButton.Content = UiHelper.CreateIcon(UriResources.Images.MemberProperty16); toolbar.Stack.Children.Add(m_ShowMemberPropertiesButton); } this.Content = LayoutRoot; } finally { m_Initializing = false; } }
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); } }