/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BitmapViewerTest)); this.bitmapViewer1 = new BitmapViewer(); this.SuspendLayout(); // // bitmapViewer1 // this.bitmapViewer1.Bitmap = null; this.bitmapViewer1.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewer1.CenterPoint"))); this.bitmapViewer1.Dock = System.Windows.Forms.DockStyle.Fill; this.bitmapViewer1.Location = new System.Drawing.Point(0, 0); this.bitmapViewer1.Margin = new System.Windows.Forms.Padding(1200, 258, 1200, 258); this.bitmapViewer1.Name = "bitmapViewer1"; this.bitmapViewer1.Size = new System.Drawing.Size(462, 380); this.bitmapViewer1.TabIndex = 0; this.bitmapViewer1.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewer1.Viewport"))); this.bitmapViewer1.ZoomFactor = 1F; // // BitmapViewerTest // this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(462, 380); this.Controls.Add(this.bitmapViewer1); this.Margin = new System.Windows.Forms.Padding(60, 28, 60, 28); this.Name = "BitmapViewerTest"; this.Text = "BitmapViewerTest"; this.ResumeLayout(false); }
public MainForm() { Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; InitializeComponent(); w = new World(); /*SolidColorBitmap scb = new SolidColorBitmap(); * ColorBlender cb = new ColorBlender(); * * w.AddNode(scb); * w.AddNode(cb); * scb.GetPinByName("Color").Connect(cb.GetPinByName("Output"));*/ BitmapFileReader bf1 = new BitmapFileReader(); bf1.FileName = "Base.jpg"; BitmapFileReader bf2 = new BitmapFileReader(); bf2.FileName = "Blend.jpg"; BitmapXBlender bb = new BitmapXBlender(); bb.BlendMode = BlendMode.ColorBurn; bb.SetPinConstantValue("Mix", 1.0); w.AddNode(bf1); w.AddNode(bf2); w.AddNode(bb); bb.GetPinByName("Input 1").Connect(bf1.GetPinByName("Output")); bb.GetPinByName("Input 2").Connect(bf2.GetPinByName("Output")); /* * TimeToLFO t2l = new TimeToLFO(); * t2l.SetPinConstantValue("Amplitude", 0.5); * t2l.SetPinConstantValue("Bias", 0.5); * w.AddNode(t2l); * bb.GetPinByName("Mix").Connect(t2l.GetPinByName("Output")); */ BitmapChannelRemap cr = new BitmapChannelRemap(); w.AddNode(cr); cr.GetPinByName("Input").Connect(bb.GetPinByName("Output")); BitmapViewer bv = new BitmapViewer(); w.AddNode(bv); bv.UpdateInterval = 1000 / 20; bv.GetPinByName("Input").Connect(cr.GetPinByName("Output")); connView.World = w; NodeRegistry.Instance.Populate(); UpdateNodeCatalogView(); UpdateNodeListView(); nodeTabCtrl.SelectedTab = connTabPage; bv.Interact(); }
private void DisplayBitmap() { try { _zoom = 1.0; UpdateZoom(); BitmapViewer.DisplayBitmap(_bitmap); GridViewer.CreateGrid(_bitmap); } catch (Exception e) { ShowError(e); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BitmapCompareDialog)); this.acceptBaselineButton = new System.Windows.Forms.Button(); this.failButton = new System.Windows.Forms.Button(); this.infoLabel = new System.Windows.Forms.Label(); this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.label4 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.bitmapViewerNew = new BitmapViewer(); this.bitmapViewerBaseline = new BitmapViewer(); this.bitmapViewerDiff1 = new BitmapViewer(); this.bitmapViewerDiff2 = new BitmapViewer(); this.label1 = new System.Windows.Forms.Label(); this.tableLayoutPanel.SuspendLayout(); this.SuspendLayout(); // // acceptBaselineButton // this.acceptBaselineButton.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.acceptBaselineButton.Location = new System.Drawing.Point(522, 39); this.acceptBaselineButton.Margin = new System.Windows.Forms.Padding(48, 22, 48, 22); this.acceptBaselineButton.Name = "acceptBaselineButton"; this.acceptBaselineButton.Size = new System.Drawing.Size(119, 26); this.acceptBaselineButton.TabIndex = 1; this.acceptBaselineButton.Text = "Accept new baseline"; this.acceptBaselineButton.UseVisualStyleBackColor = true; this.acceptBaselineButton.Click += new System.EventHandler(this.acceptBaselineButton_Click); // // failButton // this.failButton.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.failButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.failButton.Location = new System.Drawing.Point(522, 7); this.failButton.Margin = new System.Windows.Forms.Padding(0); this.failButton.Name = "failButton"; this.failButton.Size = new System.Drawing.Size(119, 26); this.failButton.TabIndex = 2; this.failButton.Text = "Fail"; this.failButton.UseVisualStyleBackColor = true; this.failButton.Click += new System.EventHandler(this.failButton_Click); // // infoLabel // this.infoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.infoLabel.Location = new System.Drawing.Point(10, 7); this.infoLabel.Margin = new System.Windows.Forms.Padding(48, 0, 48, 0); this.infoLabel.Name = "infoLabel"; this.infoLabel.Size = new System.Drawing.Size(346, 80); this.infoLabel.TabIndex = 3; this.infoLabel.Text = "infoLabel"; // // tableLayoutPanel // this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel.ColumnCount = 2; this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel.Controls.Add(this.label4, 1, 0); this.tableLayoutPanel.Controls.Add(this.label2, 0, 2); this.tableLayoutPanel.Controls.Add(this.label3, 1, 2); this.tableLayoutPanel.Controls.Add(this.bitmapViewerNew, 0, 1); this.tableLayoutPanel.Controls.Add(this.bitmapViewerBaseline, 1, 1); this.tableLayoutPanel.Controls.Add(this.bitmapViewerDiff1, 0, 3); this.tableLayoutPanel.Controls.Add(this.bitmapViewerDiff2, 1, 3); this.tableLayoutPanel.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel.Location = new System.Drawing.Point(5, 110); this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(48, 22, 48, 22); this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.RowCount = 4; this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); this.tableLayoutPanel.Size = new System.Drawing.Size(636, 404); this.tableLayoutPanel.TabIndex = 4; // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.label4.Location = new System.Drawing.Point(318, 0); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(101, 13); this.label4.TabIndex = 7; this.label4.Text = "Baseline Bitmap:"; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.label2.Location = new System.Drawing.Point(0, 202); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(138, 13); this.label2.TabIndex = 5; this.label2.Text = "Diff (pink background):"; // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.label3.Location = new System.Drawing.Point(318, 202); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(138, 13); this.label3.TabIndex = 6; this.label3.Text = "Diff (blue background):"; // // bitmapViewerNew // this.bitmapViewerNew.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bitmapViewerNew.Bitmap = null; this.bitmapViewerNew.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewerNew.CenterPoint"))); this.bitmapViewerNew.Location = new System.Drawing.Point(0, 24); this.bitmapViewerNew.Margin = new System.Windows.Forms.Padding(0); this.bitmapViewerNew.Name = "bitmapViewerNew"; this.bitmapViewerNew.Size = new System.Drawing.Size(318, 178); this.bitmapViewerNew.TabIndex = 8; this.bitmapViewerNew.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewerNew.Viewport"))); this.bitmapViewerNew.ZoomFactor = 1F; this.bitmapViewerNew.OnViewportChange += new System.EventHandler(this.bitmapViewer_OnViewportChange); // // bitmapViewerBaseline // this.bitmapViewerBaseline.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bitmapViewerBaseline.Bitmap = null; this.bitmapViewerBaseline.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewerBaseline.CenterPoint"))); this.bitmapViewerBaseline.Location = new System.Drawing.Point(318, 24); this.bitmapViewerBaseline.Margin = new System.Windows.Forms.Padding(0); this.bitmapViewerBaseline.Name = "bitmapViewerBaseline"; this.bitmapViewerBaseline.Size = new System.Drawing.Size(318, 178); this.bitmapViewerBaseline.TabIndex = 9; this.bitmapViewerBaseline.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewerBaseline.Viewport"))); this.bitmapViewerBaseline.ZoomFactor = 1F; this.bitmapViewerBaseline.OnViewportChange += new System.EventHandler(this.bitmapViewer_OnViewportChange); // // bitmapViewerDiff1 // this.bitmapViewerDiff1.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bitmapViewerDiff1.Bitmap = null; this.bitmapViewerDiff1.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewerDiff1.CenterPoint"))); this.bitmapViewerDiff1.Location = new System.Drawing.Point(0, 226); this.bitmapViewerDiff1.Margin = new System.Windows.Forms.Padding(0); this.bitmapViewerDiff1.Name = "bitmapViewerDiff1"; this.bitmapViewerDiff1.Size = new System.Drawing.Size(318, 178); this.bitmapViewerDiff1.TabIndex = 10; this.bitmapViewerDiff1.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewerDiff1.Viewport"))); this.bitmapViewerDiff1.ZoomFactor = 1F; this.bitmapViewerDiff1.OnViewportChange += new System.EventHandler(this.bitmapViewer_OnViewportChange); // // bitmapViewerDiff2 // this.bitmapViewerDiff2.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bitmapViewerDiff2.Bitmap = null; this.bitmapViewerDiff2.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewerDiff2.CenterPoint"))); this.bitmapViewerDiff2.Location = new System.Drawing.Point(318, 226); this.bitmapViewerDiff2.Margin = new System.Windows.Forms.Padding(0); this.bitmapViewerDiff2.Name = "bitmapViewerDiff2"; this.bitmapViewerDiff2.Size = new System.Drawing.Size(318, 178); this.bitmapViewerDiff2.TabIndex = 11; this.bitmapViewerDiff2.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewerDiff2.Viewport"))); this.bitmapViewerDiff2.ZoomFactor = 1F; this.bitmapViewerDiff2.OnViewportChange += new System.EventHandler(this.bitmapViewer_OnViewportChange); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(78, 13); this.label1.TabIndex = 12; this.label1.Text = "New Bitmap:"; // // BitmapCompareDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(648, 520); this.Controls.Add(this.tableLayoutPanel); this.Controls.Add(this.infoLabel); this.Controls.Add(this.failButton); this.Controls.Add(this.acceptBaselineButton); this.Margin = new System.Windows.Forms.Padding(48, 22, 48, 22); this.Name = "BitmapCompareDialog"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Bitmaps do not match"; this.Shown += new System.EventHandler(this.BitmapCompareDialog_Shown); this.Load += new System.EventHandler(this.BitmapCompareDialog_Load); this.tableLayoutPanel.ResumeLayout(false); this.tableLayoutPanel.PerformLayout(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BitmapCompareDialog2)); this.panel1 = new System.Windows.Forms.Panel(); this.buttonFail = new System.Windows.Forms.Button(); this.buttonAccept = new System.Windows.Forms.Button(); this.infoText = new System.Windows.Forms.Label(); this.checkBoxBlink = new System.Windows.Forms.CheckBox(); this.checkBoxRed = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.labelNowShowing = new System.Windows.Forms.Label(); this.timer = new System.Windows.Forms.Timer(this.components); this.bitmapViewer = new BitmapViewer(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // panel1 // this.panel1.Controls.Add(this.labelNowShowing); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.checkBoxRed); this.panel1.Controls.Add(this.checkBoxBlink); this.panel1.Controls.Add(this.infoText); this.panel1.Controls.Add(this.buttonAccept); this.panel1.Controls.Add(this.buttonFail); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(784, 57); this.panel1.TabIndex = 1; // // buttonFail // this.buttonFail.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonFail.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonFail.Location = new System.Drawing.Point(697, 12); this.buttonFail.Name = "buttonFail"; this.buttonFail.Size = new System.Drawing.Size(75, 23); this.buttonFail.TabIndex = 0; this.buttonFail.Text = "Fail"; this.buttonFail.UseVisualStyleBackColor = true; this.buttonFail.Click += new System.EventHandler(this.buttonFail_Click); // // buttonAccept // this.buttonAccept.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonAccept.Location = new System.Drawing.Point(593, 12); this.buttonAccept.Name = "buttonAccept"; this.buttonAccept.Size = new System.Drawing.Size(98, 23); this.buttonAccept.TabIndex = 1; this.buttonAccept.Text = "Accept Baseline"; this.buttonAccept.UseVisualStyleBackColor = true; this.buttonAccept.Click += new System.EventHandler(this.buttonAccept_Click); // // infoText // this.infoText.Location = new System.Drawing.Point(12, 9); this.infoText.Name = "infoText"; this.infoText.Size = new System.Drawing.Size(291, 40); this.infoText.TabIndex = 2; this.infoText.Text = "label1"; // // checkBoxBlink // this.checkBoxBlink.AutoSize = true; this.checkBoxBlink.Location = new System.Drawing.Point(317, 8); this.checkBoxBlink.Name = "checkBoxBlink"; this.checkBoxBlink.Size = new System.Drawing.Size(104, 17); this.checkBoxBlink.TabIndex = 3; this.checkBoxBlink.Text = "Continuous blink"; this.checkBoxBlink.UseVisualStyleBackColor = true; // // checkBoxRed // this.checkBoxRed.AutoSize = true; this.checkBoxRed.Location = new System.Drawing.Point(432, 8); this.checkBoxRed.Name = "checkBoxRed"; this.checkBoxRed.Size = new System.Drawing.Size(132, 17); this.checkBoxRed.TabIndex = 4; this.checkBoxRed.Text = "Show difference in red"; this.checkBoxRed.UseVisualStyleBackColor = true; this.checkBoxRed.CheckedChanged += new System.EventHandler(this.checkBoxRed_CheckedChanged); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(314, 36); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(74, 13); this.label1.TabIndex = 5; this.label1.Text = "Now showing:"; // // labelNowShowing // this.labelNowShowing.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (0))); this.labelNowShowing.Location = new System.Drawing.Point(394, 36); this.labelNowShowing.Name = "labelNowShowing"; this.labelNowShowing.Size = new System.Drawing.Size(196, 17); this.labelNowShowing.TabIndex = 6; this.labelNowShowing.Text = "now showing"; // // timer // this.timer.Enabled = true; this.timer.Interval = 350; this.timer.Tick += new System.EventHandler(this.timer_Tick); // // bitmapViewer // this.bitmapViewer.Bitmap = null; this.bitmapViewer.CenterPoint = ((System.Drawing.PointF) (resources.GetObject("bitmapViewer.CenterPoint"))); this.bitmapViewer.Dock = System.Windows.Forms.DockStyle.Fill; this.bitmapViewer.Location = new System.Drawing.Point(0, 57); this.bitmapViewer.Margin = new System.Windows.Forms.Padding(48, 22, 48, 22); this.bitmapViewer.Name = "bitmapViewer"; this.bitmapViewer.Size = new System.Drawing.Size(784, 707); this.bitmapViewer.TabIndex = 0; this.bitmapViewer.Viewport = ((System.Drawing.RectangleF) (resources.GetObject("bitmapViewer.Viewport"))); this.bitmapViewer.ZoomFactor = 1F; this.bitmapViewer.MouseDown += new System.Windows.Forms.MouseEventHandler(this.bitmapViewer_MouseDown); // // BitmapCompareDialog2 // this.AcceptButton = this.buttonFail; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonFail; this.ClientSize = new System.Drawing.Size(784, 764); this.Controls.Add(this.bitmapViewer); this.Controls.Add(this.panel1); this.Name = "BitmapCompareDialog2"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Bitmaps do not match"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Shown += new System.EventHandler(this.BitmapCompareDialog2_Shown); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.BitmapCompareDialog2_FormClosed); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); }
public void LoadEditor(int tagIndex) { //Try to.. try { //Obtain an instance of the meta editor container. MetaEditorContainer existingMetaEditor = (MetaEditorContainer)documentContainer1.ActiveDocument.Controls[0]; } catch { try { MetaGrid MG = (MetaGrid)documentContainer1.ActiveDocument.Controls[0]; } catch { //We failed.. its not a meta editor. //Try disposing our current library try { //Dispose our current documentContainer1.ActiveDocument.Controls[0].Dispose(); } catch { } } } //If its not null tag Index if (tagIndex != -1) { //Load our Meta Information LoadMetaInformation(tagIndex); //If we're changing tabs if (ChangingTab) { //Stop code return; } Painting = false; //Determine the editor to use and load it. #region Meta Grid if (menuButtonMetaGrid.Checked) { //Initialize our metaParser MetaParser metaParser = new MetaParser(Map, tagIndex); //Get our plugin path. string pluginPath = ""; //If it's retail halo 3 if (Map.Halo_Map_Version == HaloMap.HaloMapVersion.Halo3Retail) { pluginPath = Application.StartupPath + "\\plugins\\halo 3\\" + Map.IndexItems[tagIndex].Class.Replace(" ", "").Replace("<", "_").Replace(">", "_") + ".alt"; } else if (Map.Halo_Map_Version == HaloMap.HaloMapVersion.Halo3ODST) { pluginPath = Application.StartupPath + "\\plugins\\odst\\" + Map.IndexItems[tagIndex].Class.Replace(" ", "").Replace("<", "_").Replace(">", "_") + ".alt"; } //Initialize our XmlParser XmlParser xmlparser = new XmlParser(); //Parse our xml xmlparser.ParsePlugin(pluginPath); //Parse our meta metaParser.ParseMeta(xmlparser); //Initialize our instance of metaGrid MetaGrid metaGrid = new MetaGrid(metaParser); //Create a new document which we will load in, or grab the selected. DockControl document = GetCurrentSelectedDocument(true); //Clear all controls on this document document.Controls.Clear(); //Get our tag last index of name. string[] temporaryString = Map.IndexItems[tagIndex].Name.Split('\\'); string lastIndexName = temporaryString[temporaryString.Length - 1]; //Set our document text. document.Text = lastIndexName + "." + Map.IndexItems[tagIndex].Class; //Set our document tag to our tag Index. document.Tag = tagIndex; //Add the meta editor to the document document.Controls.Add(metaGrid); //Set our metaEditorContainer to dock. metaGrid.Dock = DockStyle.Fill; //Select it as the active document. documentContainer1.ActiveDocument = document; } #endregion #region Meta Editor if (menuButtonMetaEditor.Checked) { //Create a new document which we will load in. DockControl document = GetCurrentSelectedDocument(true); //Get our tag last index of name. string[] temporaryString = Map.IndexItems[tagIndex].Name.Split('\\'); string lastIndexName = temporaryString[temporaryString.Length - 1]; //Set our document text. document.Text = lastIndexName + "." + Map.IndexItems[tagIndex].Class; //Set our document tag to our tag Index. document.Tag = tagIndex; //Try to... try { //Obtain an instance of the meta editor container. MetaEditorContainer existingMetaEditor = (MetaEditorContainer)document.Controls[0]; //Switch our tag in our existing meta editor existingMetaEditor.SwitchToTag(tagIndex); } //If its not an existing editor. catch { //Clear all controls on this document document.Controls.Clear(); //Create our instance of the Meta Editor container. MetaEditorContainer metaEditorContainer = new MetaEditorContainer(Map); //Add the meta editor to the document document.Controls.Add(metaEditorContainer); //Set our metaEditorContainer to dock. metaEditorContainer.Dock = DockStyle.Fill; //Select it as the active document. documentContainer1.ActiveDocument = document; //Load the meta Editor controls and values metaEditorContainer.LoadMetaEditor(tagIndex, AppSettings.Settings.ShowInvisibles); } } #endregion #region Bitmap Editor //Decide whether to show our menu item. menuBitmapEditor.Visible = (Map.IndexItems[tagIndex].Class == "bitm"); //If our menuBitmapEditor is invisible. if (menuBitmapEditor.Visible && menuBitmapEditor.Checked) { //Create a new document which we will load in, or grab the selected. DockControl document = GetCurrentSelectedDocument(true); //Clear all controls on this document document.Controls.Clear(); //Get our tag last index of name. string[] temporaryString = Map.IndexItems[tagIndex].Name.Split('\\'); string lastIndexName = temporaryString[temporaryString.Length - 1]; //Set our document text. document.Text = lastIndexName + "." + Map.IndexItems[tagIndex].Class; //Set our document tag to our tag Index. document.Tag = tagIndex; //Create our bitmap viewer BitmapViewer bitmap_viewer = new BitmapViewer(); //Add the bitmap editor to the document document.Controls.Add(bitmap_viewer); //Load our bitmap stuff.. bitmap_viewer.LoadBitmapTag(Map, tagIndex); bitmap_viewer.Dock = DockStyle.Fill; //Select it as the active document. documentContainer1.ActiveDocument = document; } #endregion Painting = true; } }