Example #1
0
 public ErrorMessageDialog(string caption, string heading, string code, CFGViewerApp app)
 {
     InitializeComponent();
     m_app = app;
     if (caption != null)
     {
         this.Text = caption;
     }
     if (heading != null)
     {
         labelHeading.Text = heading;
     }
     if (code != null)
     {
         richTextBoxCode.Text = code;
         int startIndex = richTextBoxCode.Text.LastIndexOf('^');
         if (startIndex > 0)
         {
             int lastIndex = richTextBoxCode.Text.Length - 1;
             richTextBoxCode.Select(startIndex, lastIndex - startIndex + 1);
             richTextBoxCode.SelectionColor = Color.Red;
             richTextBoxCode.Select(0, 0);
         }
         m_app.ApplyKeywordsColoring(richTextBoxCode);
         richTextBoxCode.BackColor = Color.White;
     }
 }
Example #2
0
 public CFGViewerForm()
 {
     InitializeComponent();
     codeTextBox.BackColor = Color.White;
     codeTextBox.ForeColor = codeTextBox.ReadOnly ? Color.Gray : Color.Black;
     m_app = new CFGViewerApp(SetMessage, LoadImageFromFile, OnError);
     m_app.OnMCTextUpdated += UpdateMCText;
 }
Example #3
0
        public MCGraphViewerForm(string graphName, CFGViewerApp app)
        {
            InitializeComponent();
            m_app = app;
            if (graphName != null)
            {
                labelGraphName.Text = graphName;
            }
            else
            {
                labelGraphName.Text = "";
            }
            string fname = m_app.DIGRAPH_FILE + ".MC_" + graphName;
            Guid   id    = Guid.NewGuid();

            if (m_app.GenerateDotBitmap(fname, fname + id.ToString() + ".png"))
            {
                MCGraphPictureBox.Image = new Bitmap(fname + id.ToString() + ".png");
                Size imgSize = MCGraphPictureBox.Image.Size;
                this.Size = new Size(imgSize.Width + 37, imgSize.Height + 116);
            }
        }