コード例 #1
0
        private static void ShowDatabaseElementInfo(string type, TreeViewItem selectedItem, ISqlUiPlugin plugin)
        {
            if (selectedItem == null)
            {
                throw new ArgumentNullException(nameof(selectedItem));
            }

            var formatter = new SqlFormatter();

            if (!(selectedItem.Tag is IDatabaseElement databaseElement))
            {
                return;
            }

            SqlUiElement.Logger.Info(string.Format(CultureInfo.InvariantCulture, "[{1} ({2})] Displaying {3}: {0}", databaseElement.Name, plugin.Name, plugin.Environment, type));

            var dialog = new ShowText
            {
                Text = formatter.FormatString(databaseElement.BodyDefinition),
            };

            dialog.SetTitleParts(new Dictionary <string, string>()
            {
                { "0", string.Format(CultureInfo.InvariantCulture, "[{1} ({2})] {3}: {0}", databaseElement.Name, plugin.Name, plugin.Environment, type) },
            });

            dialog.Show();
        }
コード例 #2
0
        private void FormatSQL_Click(object sender, RoutedEventArgs e)
        {
            var formatter = new SqlFormatter();

            this.TextToShow.Text = formatter.FormatString(this.TextToShow.Text);
        }