Esempio n. 1
0
        private void btnGetOrch_Click(object sender, EventArgs e)
        {
            string connStr        = String.Empty;
            string sqlMgmtConnStr = String.Empty;

            try
            {
                string mgmtDBName = string.Empty;
                Tools.GetConnectionStrings(this.txtDTAServerName.Text, this.txtDTADBName.Text, mgmtDBName, out connStr, out sqlMgmtConnStr);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Unable to connect to DTA Db : " + exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            try
            {
                foreach (OrchestrationInfo info in BTSOrchestrationExplorer.GetDeployedOrchestrations(connStr))
                {
                    this.dgOrchestration.Rows.Add(info.ServiceName, info.AssemblyName, info.TxtSymbols);
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error when retrieving orchestrations", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void dgOrchestration_SelectionChanged(object sender, EventArgs e)
        {
            this.dgDebugShapes.Rows.Clear();

            if (this.dgOrchestration.SelectedRows.Count > 0)
            {
                this.dgDebugShapes.Enabled = true;
                this.btnGenerate.Enabled   = true;

                string     serviceName  = (string)this.dgOrchestration.SelectedRows[0].Cells["ServiceName"].Value;
                string     debugSymbols = (string)this.dgOrchestration.SelectedRows[0].Cells["DebugSymbols"].Value;
                DebugTrace trace        = BTSOrchestrationExplorer.GetDebugTrace(serviceName, debugSymbols, FlatteningPrefixType.Indentation);

                foreach (DebugShape shape in trace.TraceDetails)
                {
                    this.dgDebugShapes.Rows.Add(
                        shape.shapeText,
                        shape.shapeType.ToString(),
                        "true",
                        "true",
                        "1",
                        shape.ShapeID.ToString());
                }
            }
        }
Esempio n. 3
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (this.dgOrchestration.SelectedRows.Count > 0)
            {
                DataGridViewRow dr = this.dgOrchestration.SelectedRows[0];

                string serviceName  = (string)dr.Cells["ServiceName"].Value;
                string debugSymbols = (string)dr.Cells["DebugSymbols"].Value;

                string destPath;
                destPath = Path.Combine(this._targetFolder, this._requestedFileName);
                FileInfo fi = new FileInfo(destPath);

                int i = 0;
                while (fi.Exists)
                {
                    i++;
                    destPath = Path.Combine(this._targetFolder,
                                            String.Format("{0}-{2}{1}", fi.Name.Replace(fi.Extension, ""), fi.Extension, i));
                    fi = new FileInfo(destPath);
                }

                DebugTrace originalTrace = BTSOrchestrationExplorer.GetDebugTrace(serviceName, debugSymbols, FlatteningPrefixType.ParentName);
                DebugTrace trace         = new DebugTrace();
                foreach (DataGridViewRow row in this.dgDebugShapes.Rows)
                {
                    if (Boolean.Parse((string)row.Cells["AddToScenario"].Value))
                    {
                        DebugShape shape = originalTrace.TraceDetails.Single(s => s.ShapeID.ToString() == (string)row.Cells["ShapeID"].Value);
                        shape.Completed   = Boolean.Parse((string)row.Cells["MustComplete"].Value);
                        shape.RepeatCount = Int32.Parse((string)row.Cells["RepeatCount"].Value);
                        trace.TraceDetails.Add(shape);
                    }
                }
                trace.Export(destPath);

                if (this._project != null)
                {
                    EnvDTE.ProjectItem item = this._project.ProjectItems.AddFromFile(destPath);

                    EnvDTE.Property prop = item.Properties.Item("BuildAction");
                    prop.Value = 2;

                    Tools.AddConfigKeys(this._project, this.txtDTAServerName.Text, this.txtDTADBName.Text, "BizTalkMgmtDb");
                }

                this.Close();
            }
        }