Ejemplo n.º 1
0
        private void ShowEditor(object sender, EventArgs e)
        {
            TextBox origin = (TextBox)sender;

            if (
                (comboBox1.SelectedItem.ToString().Equals("Generic T-SQL Query Collector Type")) ||
                (comboBox1.SelectedItem.ToString().Equals("Extended T-SQL Query Collector Type"))
                )
            {
                TSQLParametersEditor editor = new TSQLParametersEditor(origin.Text);
                editor.ShowDialog(this);
                origin.Text = CollectorUtils.FormatXMLDocument(editor.ReturnValue);
            }
            else
            {
                if (comboBox1.SelectedItem.ToString().Equals("Extended XE Reader Collector Type"))
                {
                    XEReaderParametersEditor editor = new XEReaderParametersEditor(origin.Text);
                    editor.ShowDialog(this);
                    origin.Text = CollectorUtils.FormatXMLDocument(editor.ReturnValue);
                }
                else
                {
                    XMLEditor dialog = new XMLEditor(origin.Text);
                    dialog.ShowDialog(this);
                    origin.Text = dialog.ReturnValue;
                }
            }
        }
Ejemplo n.º 2
0
        public XMLEditor(String text, String type)
        {
            InitializeComponent();
            _textControl = new ICSharpCode.TextEditor.TextEditorControl();
            this.Controls.Add(_textControl);
            _textControl.Dock = DockStyle.Fill;

            _textControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(type);

            this.Text = type + " Editor";

            if (type.Equals("XML"))
            {
                _textControl.Text = CollectorUtils.FormatXMLDocument(text);
            }
            else
            {
                _textControl.Text = text;
            }
        }
Ejemplo n.º 3
0
        private void fillValues(int collectionItemId)
        {
            String sql = @"
                SELECT *
                FROM msdb.dbo.syscollector_collection_items
                WHERE collection_item_id = '{0}'
            ";

            sql = String.Format(sql, collectionItemId);
            DataTable dt = CollectorUtils.GetDataTable(Manager.ServerName, "msdb", sql);

            foreach (DataRow dr in dt.Rows)
            {
                textBox1.Text = dr["collection_set_id"].ToString();
                textBox7.Text = dr["collection_item_id"].ToString();
                textBox2.Text = dr["name"].ToString();
                ComboSetValue(comboBox1, (Guid)dr["collector_type_uid"]);
                textBox3.Text = dr["frequency"].ToString();
                textBox4.Text = CollectorUtils.FormatXMLDocument(dr["parameters"].ToString());
            }
        }
        private void fillValues(Guid collectorTypeUid)
        {
            String sql = @"
                SELECT *
                FROM msdb.dbo.syscollector_collector_types
                WHERE collector_type_uid = '{0}'
            ";

            sql = String.Format(sql, collectorTypeUid.ToString());
            DataTable dt = CollectorUtils.GetDataTable(Manager.ServerName, "msdb", sql);

            foreach (DataRow dr in dt.Rows)
            {
                textBox1.Text     = dr["collector_type_uid"].ToString();
                textBox2.Text     = dr["name"].ToString();
                textBox3.Text     = CollectorUtils.FormatXMLDocument(dr["parameter_schema"].ToString());
                textBox4.Text     = CollectorUtils.FormatXMLDocument(dr["parameter_formatter"].ToString());
                textBox5.Text     = dr["collection_package_path"].ToString();
                button1.Tag       = dr["collection_package_id"].ToString();
                textBox6.Text     = dr["upload_package_path"].ToString();
                button2.Tag       = dr["upload_package_id"].ToString();
                checkBox1.Checked = Boolean.Parse(dr["is_system"].ToString());
            }
        }