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 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 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); } }