private void InitializeContactList() { _contactList = new ContactList(_parent.Persons, _parent.Companies); _contactList.BoundAlphabetList = AlphabetList; _contactList.BoundTabControl = ContactTabControl; _contactList.BoundToggleButton = ToggleButton; _contactList.BoundSearchBox = ContactSearchBox; _contactList.BoundSearchBox.SearchPhraseChanged += (s, ea) => { string searchPhrase = _contactList.BoundSearchBox.SearchPhrase; if (searchPhrase != "" && searchPhrase != "Wyszukaj") { MainMenuStrip.Visibility = Visibility.Collapsed; } else { MainMenuStrip.Visibility = Visibility.Visible; } }; ContactMainContainer.Children.Add(_contactList); _contactList.RenameCompany += _contactList_RenameCompany; _contactList.RemoveCompanyEvent += _contactList_RemoveCompany; _contactList.PersonShowDetails += _contactList_PersonShowDetails; _contactList.RemoveExternalContact += _contactList_RemoveExternalContact; _addButton = new ToolBarButton("", new Uri("pack://application:,,,/resources/add.png")); _addButton.Click += AddButton_Click; MainMenuStrip.AddButton(_addButton, Dock.Left); }
void MainForm_TitleButtonOnClick(object sender, Point mousePoint) { if (sender is UI.Render.MenuButton) { MainMenuStrip.Show(this, mousePoint.X - 3, mousePoint.Y + 10); } }
public MainForm() { InitializeComponent(); MainMenuStrip menuStrip = new MainMenuStrip(); Controls.Add(menuStrip); }
private void DisableVSSButtons() { BtPush.Invoke(new Action(() => BtPush.Enabled = false)); BtPushDWH4DM.Invoke(new Action(() => BtPushDWH4DM.Enabled = false)); MainMenuStrip.Invoke(new Action(() => CreateScriptsRepositoryDirToolStripMenuItem.Enabled = false)); MainMenuStrip.Invoke(new Action(() => CreateInfaRepositoryDirToolStripMenuItem.Enabled = false)); }
private void CreateForm_FormClosed(object sender, FormClosedEventArgs e) { var allowDrop = new MainForm(); allowDrop.AllowDrop = true; var canOpen = new MainMenuStrip(); canOpen.openFile(true); var reset = new Struture.Structure(); reset.reset(); }
////////////////////////////////////////////////////////////////////////////////////////// Password User Control Click // Name: loginPswdUserControl1_LoginButtonClicked // Arguments : object sender, EventArgs e // // Description : // when the login button is clicked it checks if the username and password is correct // then it hides the custom login user control and shows the menu strip // ////////////////////////////////////////////////////////////////////////////////////////// private void loginPswdUserControl1_LoginButtonClicked(object sender, EventArgs e) { //if username and password is admin then grant access if (loginPswdUserControl1.Login == "admin" && loginPswdUserControl1.Password == "admin") { MainMenuStrip.Show(); loginPswdUserControl1.Hide(); } else { MessageBox.Show("Incorrect Username Or Password, Try User: admin, Pass: admin", "Incorrect"); } }
public MainForm() { InitializeComponent(); var menuStrip = new MainMenuStrip(); MainTabControl = new MainTabControl(); Controls.AddRange(new Control[] { MainTabControl, menuStrip }); InitializeFile(); }
public void CheckMenuColorTheme() { if (this.MainMenuStrip != null) { var rend = MainMenuStrip.Renderer as MyToolStripRenderer; if (rend == null) { return; } rend.SetColorTheme(MyColorTheme); MainMenuStrip.Refresh(); } }
public MainForm() { InitializeComponent(); Session = new Session(); var menuStrip = new MainMenuStrip(); MainTabControl = new MainTabControl(); TextFile file = new TextFile("c:/test.txt"); Controls.AddRange(new Control[] { MainTabControl, menuStrip }); InitializeFile(); }
public static void Start(frmStudioMain mainForm) { DroppedSTLFiles = new List <string>(); DroppedProjectFiles = new List <string>(); //add handlers _mainForm = mainForm; _mainForm.AllowDrop = true; _mainForm.DragEnter += new DragEventHandler(MainForm_DragEnter); _mainForm.DragDrop += new DragEventHandler(MainForm_DragDrop); _mainFormMenu = new MainMenuStrip(); _mainFormMenu.OnSelectMenuItem += MainFormDropdownMenu_OnSelectMenuItem; _mainFormMenu.Top = 0; _mainFormMenu.Left = 16; }
public void CheckMenuColorTheme() { if (this.MainMenuStrip != null) { var rend = MainMenuStrip.Renderer as MyToolStripRenderer; if (rend == null) { SetupMenuRenderer(); rend = MainMenuStrip.Renderer as MyToolStripRenderer; if (rend == null) { return; } } var colortheme = _topManager.Settings.ColorTheme; rend.SetColorTheme(colortheme); MainMenuStrip.Refresh(); } }
////////////////////////////////////////////////////////////////////////////////////////// Form Load // Name: MainForm_Load // Arguments : object sender, EventArgs e // // Description : // ////////////////////////////////////////////////////////////////////////////////////////// private void MainForm_Load(object sender, EventArgs e) { //hide menu MainMenuStrip.Hide(); }
private void MainMenuStrip_Click(object sender, EventArgs e) { // without this, the main menu strip never receives focus (focus is always on the WebView) MainMenuStrip.Focus(); }
//needs work with nested nodes //also super slow lol private void UpdateSyntaxHighlighting() { if (IsXml) { string nodes = "<.+?>|\t<.+?>"; MatchCollection nodeMatches = Regex.Matches(TextTextBox.Text, nodes); string comments = "<!--.+?-->"; MatchCollection commentMatches = Regex.Matches(TextTextBox.Text, comments); string attributeNames = " .+?=\""; MatchCollection attributeMatches = Regex.Matches(TextTextBox.Text, attributeNames); string strings = "\".+?\""; MatchCollection stringMatches = Regex.Matches(TextTextBox.Text, strings); int originalIndex = TextTextBox.SelectionStart; int originalLength = TextTextBox.SelectionLength; Color originalColor = Color.Black; MainMenuStrip.Focus(); TextTextBox.SelectionStart = 0; TextTextBox.SelectionLength = TextTextBox.Text.Length; TextTextBox.SelectionColor = originalColor; if (nodeMatches != null) { foreach (Match m in nodeMatches) { TextTextBox.SelectionStart = m.Index; TextTextBox.SelectionLength = m.Length; TextTextBox.SelectionColor = NodeColor; } } if (attributeMatches != null) { foreach (Match m in attributeMatches) { TextTextBox.SelectionStart = m.Index; TextTextBox.SelectionLength = m.Length; TextTextBox.SelectionColor = AttributeColor; } } if (stringMatches != null) { foreach (Match m in stringMatches) { TextTextBox.SelectionStart = m.Index; TextTextBox.SelectionLength = m.Length; TextTextBox.SelectionColor = StringColor; } } if (commentMatches != null) { foreach (Match m in commentMatches) { TextTextBox.SelectionStart = m.Index; TextTextBox.SelectionLength = m.Length; TextTextBox.SelectionColor = CommentColor; } } TextTextBox.SelectionStart = originalIndex; TextTextBox.SelectionLength = originalLength; TextTextBox.SelectionColor = originalColor; TextTextBox.Focus(); } }
protected override void OnLayout(LayoutEventArgs levent) { var clientSize = ClientSize; currentMetrics.TotalWidth = clientSize.Width; currentMetrics.TotalHeight = clientSize.Height; // If maximized, Windows will make a Form bigger than the screen to hide the drop shadow used for resizing. // If a Form such as this one is drawn without that drop shadow, we need to compensate for that. if (WindowState == FormWindowState.Maximized) { currentMetrics.IsMaximized = true; currentMetrics.HorizontalResizeBorderThickness = SystemInformation.HorizontalResizeBorderThickness * 2; currentMetrics.VerticalResizeBorderThickness = SystemInformation.VerticalResizeBorderThickness * 2; } else { currentMetrics.IsMaximized = false; currentMetrics.HorizontalResizeBorderThickness = SystemInformation.HorizontalResizeBorderThickness; currentMetrics.VerticalResizeBorderThickness = SystemInformation.VerticalResizeBorderThickness; } currentMetrics.CaptionHeight = CaptionHeight; if (MainMenuStrip != null && MainMenuStrip.Visible) { currentMetrics.MainMenuWidth = MainMenuHorizontalMargin + MainMenuStrip.Items .OfType <ToolStripItem>() .Where(x => x.Visible) .Select(x => x.Width) .Sum(); } else { currentMetrics.MainMenuWidth = 0; } if (currentMetrics.MainMenuWidth > 0) { MainMenuStrip.SetBounds( currentMetrics.MainMenuLeft, currentMetrics.MainMenuTop, currentMetrics.MainMenuWidth, currentMetrics.MainMenuHeight); } maximizeButton.Visible = MaximizeBox; minimizeButton.Visible = MinimizeBox; currentMetrics.UpdateSystemButtonMetrics(saveButton.Visible, MaximizeBox, MinimizeBox); closeButton.SetBounds( currentMetrics.CloseButtonLeft, currentMetrics.SystemButtonTop, currentMetrics.SystemButtonWidth, currentMetrics.SystemButtonHeight); if (saveButton.Visible) { saveButton.SetBounds( currentMetrics.SaveButtonLeft, currentMetrics.SystemButtonTop, currentMetrics.SystemButtonWidth, currentMetrics.SystemButtonHeight); } if (maximizeButton.Visible) { maximizeButton.SetBounds( currentMetrics.MaximizeButtonLeft, currentMetrics.SystemButtonTop, currentMetrics.SystemButtonWidth, currentMetrics.SystemButtonHeight); } if (minimizeButton.Visible) { minimizeButton.SetBounds( currentMetrics.MinimizeButtonLeft, currentMetrics.SystemButtonTop, currentMetrics.SystemButtonWidth, currentMetrics.SystemButtonHeight); } // Do a null-check in case this is called from our constructor, it may not yet been set. DockedAsControl?.SetBounds( currentMetrics.ClientAreaLeft, currentMetrics.ClientAreaTop, currentMetrics.ClientAreaWidth, currentMetrics.ClientAreaHeight); // Setting MinimumSize on an inactive Form will activate it. // To work around this issue, I tried delaying updates to MinimumSize until the window is active. // However, this prevents a window from being restored to a maximized state from an auto-save file, // even if e.g. a nonce is used. // // See also: // https://github.com/dotnet/winforms/issues/3020 // https://social.msdn.microsoft.com/Forums/en-US/9625570d-4bd7-48f2-b158-15dcbd96c60b/bug-in-form-class-setting-formminimumsize-triggers-an-activated-event-even-when-the-form-is // https://social.msdn.microsoft.com/Forums/en-US/31f9d493-f8d6-4b39-92c9-912399ed3964/why-parentformdeactivate-event-getting-triggered-when-try-to-set-the-minimum-size-for-child-form // // An appopriate MinimumSize is a size which allows the entire menu and the system buttons to be displayed, // taking border thickness into account. Using the current metrics: // // MinimumWidth = MainMenuLeft + MainMenuWidth + TotalWidth - MinimizeButtonLeft // MinimumHeight = CaptionHeight + VerticalResizeBorderThickness * 2 // MinimumSize = new Size(MinimumWidth, MinimumHeight) // // Setting MinimumSize to a fixed size for the time being, since a likely fix is going to be to trap // the property getters and setters, and reimplementing what they do by hand. MinimumSize = new Size(500, 80); // Update maximize button because Aero snap changes the client size directly and updates // the window state, but does not seem to call WndProc with e.g. a WM_SYSCOMMAND. UpdateMaximizeButtonIcon(); }
private bool paintCaption_(Graphics g) { int X = 0; int R = this.ClientSize.Width; bool ret = false; // paint caption bar // - icon // - text // - mainmenustrip // - min/max/close var rc = new Rectangle(X, 0, R, CaptionHeight); if (g != null) { var sb = new SolidBrush(CaptionColor); g.FillRectangle(sb, rc); } if (this.ShowIcon) { if (g != null) { var rcIcon = new Rectangle(X, 0, CaptionHeight, CaptionHeight); g.DrawIcon(this.Icon, rcIcon); X += CaptionHeight; } } if (!string.IsNullOrEmpty(Text)) { var captionFont = SystemFonts.CaptionFont; var captionBrush = SystemBrushes.ActiveCaptionText; if (g != null) { var m = g.MeasureString(Text, captionFont); int W = CaptionTextWidth; if (W == 0) { W = (int)m.Width + 2;// runf up plus extra pixel space } actualCaptionTextWidth = W; var topOffset = (CaptionHeight - m.Height) / 2; var captionRect = new RectangleF(X, topOffset < 0 ? 0 : topOffset, W, CaptionHeight); g.DrawString(Text, captionFont, captionBrush, captionRect); X += W; } else { X += actualCaptionTextWidth;// use width from last time we drew it (are we one step behind?) } } // // seperator after text X += CaptionHeight; // // control button far right if (this.ControlBox) { R -= CaptionHeight; if (g != null) { #if SYSTEM_CLOSE_BUTTON var r = new Rectangle(R, 0, CaptionHeight, CaptionHeight); ControlPaint.DrawCaptionButton(g, r, CaptionButton.Close, ButtonState.Normal | ButtonState.Flat); #else // just draw a simple cross Pen p = Pens.Black; int o = CaptionHeight / 3; // offset to cross ends inside the box int w = CaptionHeight - o - o; // width/height of the cross g.DrawLine(p, R + o, o, R + o + w, o + w); g.DrawLine(p, R + o, o + w, R + o + w, o); #endif } } // // seperator before control button R -= CaptionHeight; // // whatever isleft is for mmenu strip // from X to R... if (this.MainMenuStrip != null) { // no room for the menu! if (R < X) { R = X; } // // if mainmenu is not in calculated place then move it // - note width check is ">" rather than "!=" becuase we may set toolstrip size and it // may set somethign lower depending what it has if (this.MainMenuStrip.Left != X || this.MainMenuStrip.Right > R) { // never dock the main menu from outer form...we "own" its position if (this.MainMenuStrip.Dock != DockStyle.None) { this.MainMenuStrip.Dock = DockStyle.None; } this.MainMenuStrip.SetBounds(X, 0, R - X, CaptionHeight); ret = true; } if (g != null) { // menu same back color as us if (MainMenuStrip.BackColor != this.CaptionColor) { MainMenuStrip.BackColor = this.CaptionColor; } MainMenuStrip.Refresh(); } } return(ret); }
public void createFile(int[] size, ArrayList block, int count, int multiplier) { saveFileDialog = new SaveFileDialog(); saveFileDialog.Title = "Place your file somewhere"; saveFileDialog.Filter = "mcfunction|*.mcfunction"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { string path = saveFileDialog.FileName; var nbt = new ArrayList(); try { using (FileStream fs = File.Create(path)) { byte[] info2 = new UTF8Encoding(true).GetBytes("###################################################################################\n## ##\n## Made with the MiniStructure generator - by NoNOréo ##\n## ##\n###################################################################################\n\n"); fs.Write(info2, 0, info2.Length); for (int i = 0; i < (count * multiplier); i = i + multiplier) { if (block[i + 3].ToString().Contains("minecraft:air") == false) { if (block[i + 3].ToString().Contains("minecraft:cave_air") == false) { double x = float.Parse((string)block[i]) / constant; double y = float.Parse((string)block[i + 1]) / constant; double z = float.Parse((string)block[i + 2]) / constant; if (paramSize != 5) { //Slab if (block[i + 3].ToString().Contains("slab") == true) { switch (block[i + 5].ToString()) { case "double": bool a = Array.Exists <string>(specialBlocks.wood, element => element.Contains(block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", ""))); bool b = Array.Exists <string>(specialBlocks.withoutSlab, element => element.Contains(block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", ""))); bool c = Array.Exists <string>(specialBlocks.brick, element => element.Contains(block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", ""))); bool d = Array.Exists <string>(specialBlocks.slabToBlock, element => element.Contains(block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", ""))); if (a == true) { block[i + 3] = block[i + 3].ToString().Replace("slab", "planks"); } if (b == true) { block[i + 3] = block[i + 3].ToString().Replace("_slab", ""); } if (c == true) { block[i + 3] = block[i + 3].ToString().Replace("_slab", "s"); } if (d == true) { block[i + 3] = block[i + 3].ToString().Replace("_slab", "_block"); } if (block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", "") == "petrified_oak") { block[i + 3] = "minecraft:oak_planks"; } if (block[i + 3].ToString().Replace("_slab", "").Replace("minecraft:", "") == "quartz") { block[i + 3] = "minecraft:quartz_block"; } break; case "top": y += constraint.SlabType(paramSize); break; case "bottom": break; } } if (onArm == 1) { if (block[i + 3].ToString().Contains("stairs") == true || block[i + 3].ToString().Contains("observer") == true) { block[i + 4] = constraint.ChangeFacingStairs(block[i + 4].ToString()); } if (block[i + 3].ToString().Contains("chest") == true || block[i + 3].ToString().Contains("trapped_chest") == true) { block[i + 4] = constraint.ChangeFacing(block[i + 4].ToString()); } } else { if ((block[i + 3].ToString()).Contains("stairs") == true || (block[i + 3].ToString()).Contains("observer") == true) { block[i + 4] = constraint.ChangeFacingStairs(block[i + 4].ToString()); block[i + 4] = constraint.ChangeFacingStairs(block[i + 4].ToString()); } } //Rotation if (block[i + 6].ToString() != "null" && paramSize == 1) { x = constraint.MoveBigBlockDueToRotationX(x, block, i); z = constraint.MoveBigBlockDueToRotationZ(z, block, i); } if (block[i + 6].ToString() != "null" && paramSize == 2) { x = constraint.MoveNormalBlockDueToRotationX(x, block, i); z = constraint.MoveNormalBlockDueToRotationZ(z, block, i); } if (block[i + 6].ToString() != "null" && paramSize == 3) { x = constraint.MoveSmallBlockDueToRotationX(x, block, i); z = constraint.MoveSmallBlockDueToRotationZ(z, block, i); } if (block[i + 6].ToString() != "null" && paramSize == 4) { x = constraint.MoveMiniBlockDueToRotationX(x, block, i); z = constraint.MoveMiniBlockDueToRotationZ(z, block, i); } //~ ~0.08 ~0.192 //~ ~0.1142 ~0.26976 //~-0.29 ~-0.38 ~-0.3 //~-0.145 ~-0.19 ~-0.15 if (Array.Exists <string>(specialBlocks.flatItem, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", "")) == true)) { switch (paramSize) { case 1: y += -0.5107; z += 0.27276; break; case 2: y += -0.3575; z += 0.192; break; case 3: x += -0.29; y += -0.7545; z += -0.3; break; case 4: x += -0.145; y += -0.37725; z += -0.15; break; } } if (MoreOptionsForm.coolPlants == true && Array.Exists <string>(specialBlocks.paperPlant, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", ""))) == true) { switch (paramSize) { case 1: x += -0.195; z += -0.1; break; case 2: x += -0.13879; z += -0.06335; break; case 3: x += 0.29; z += 0.43; break; case 4: x += 0.145; z += 0.215; break; } } //Facing if (block[i + 4].ToString() != "null" && paramSize == 3) { x = constraint.MoveBlockDueToFacingX(x, block, i); z = constraint.MoveBlockDueToFacingZ(z, block, i); } if (block[i + 4].ToString() != "null" && paramSize == 4) { x = constraint.MoveMiniBlockDueToFacingX(x, block, i); z = constraint.MoveMiniBlockDueToFacingZ(z, block, i); } if (MoreOptionsForm.toSnowBlock == true && Array.Exists <string>(specialBlocks.transformToSnow, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", ""))) == true && block[i + 7].ToString() == "true") { block[i + 3] = "minecraft:snow_block"; } } string xString = x.ToString(); string yString = y.ToString(); string zString = z.ToString(); string data = block[i + 3].ToString(); byte[] info = new UTF8Encoding(true).GetBytes(""); if (paramSize != 5) { info = new UTF8Encoding(true).GetBytes("summon armor_stand ~" + xString.Replace(",", ".") + " ~" + yString.Replace(",", ".") + " ~" + zString.Replace(",", ".") + " {Invisible:1b,Invulnerable:1b,NoBasePlate:1b"); } if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == true) { info = new UTF8Encoding(true).GetBytes("summon armor_stand ~" + xString.Replace(",", ".") + " ~" + yString.Replace(",", ".") + " ~" + zString.Replace(",", ".") + " {Invisible:1b,Invulnerable:1b,NoBasePlate:1b"); } if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == false) { info = new UTF8Encoding(true).GetBytes("summon falling_block ~" + xString.Replace(",", ".") + " ~" + yString.Replace(",", ".") + " ~" + zString.Replace(",", ".") + " {Invulnerable:1b,Time:-2147483648"); } fs.Write(info, 0, info.Length); string presentTags = ""; if (CreateForm.tag == true) { info = new UTF8Encoding(true).GetBytes(",Tags:[\""); fs.Write(info, 0, info.Length); for (int j = 0; j < CreateForm.tagsList.Length; j++) { if (CreateForm.tagsList[j] != "") { presentTags = CreateForm.tagsList[j]; info = new UTF8Encoding(true).GetBytes(presentTags.ToString().Replace(" ", "_")); fs.Write(info, 0, info.Length); if (j != CreateForm.tagsList.Length - 1) { info = new UTF8Encoding(true).GetBytes("\",\""); fs.Write(info, 0, info.Length); } } } info = new UTF8Encoding(true).GetBytes("\"]"); fs.Write(info, 0, info.Length); } if (MoreOptionsForm.team == true) { info = new UTF8Encoding(true).GetBytes(",Team:\""); fs.Write(info, 0, info.Length); info = new UTF8Encoding(true).GetBytes(MoreOptionsForm.teamList.ToString().Replace(" ", "_") + "\""); fs.Write(info, 0, info.Length); } if (paramSize != 5) { string rotation = ""; //Facing & //Rotation if (block[i + 4].ToString() != "null") { rotation = constraint.RotateArmorStandHead(block, i); } if (block[i + 6].ToString() != "null") { rotation = constraint.RotateArmorStandSign(block, i); } if (MoreOptionsForm.coolPlants == true && Array.Exists <string>(specialBlocks.paperPlant, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", ""))) == true) { rotation = ",Rotation:[45f]"; } info = new UTF8Encoding(true).GetBytes(rotation); fs.Write(info, 0, info.Length); info = new UTF8Encoding(true).GetBytes(",Small:" + small + "b"); fs.Write(info, 0, info.Length); } if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == true) { info = new UTF8Encoding(true).GetBytes(",NoGravity:" + noGravity + "b,Marker:" + marker + "b"); } else { info = new UTF8Encoding(true).GetBytes(",NoGravity:" + noGravity + "b"); } fs.Write(info, 0, info.Length); if (paramSize != 5) { if (onArm == 0) { info = new UTF8Encoding(true).GetBytes("ArmorItems:[{},{},{},{id:\"" + data.Replace("minecraft:", "") + "\",Count:1b}],DisabledSlots:4144959}\n"); fs.Write(info, 0, info.Length); } else { info = new UTF8Encoding(true).GetBytes("HandItems:[{id:\"" + data.Replace("minecraft:", "") + "\",Count:1b},{}],DisabledSlots:4144959,"); fs.Write(info, 0, info.Length); if (Array.Exists <string>(specialBlocks.flatItem, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", "")) == true)) { info = new UTF8Encoding(true).GetBytes(horizontalPose + "}\n"); fs.Write(info, 0, info.Length); } else { info = new UTF8Encoding(true).GetBytes(pose + "}\n"); fs.Write(info, 0, info.Length); } } } else { if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == true) { info = new UTF8Encoding(true).GetBytes(",Passengers:[{id:\"minecraft:falling_block\",Invulnerable:1b"); fs.Write(info, 0, info.Length); if (MoreOptionsForm.tag2 == true) { info = new UTF8Encoding(true).GetBytes(",Tags:[\""); fs.Write(info, 0, info.Length); for (int j = 0; j < MoreOptionsForm.tagsList2.Length; j++) { if (MoreOptionsForm.tagsList2[j] != "") { presentTags = MoreOptionsForm.tagsList2[j]; info = new UTF8Encoding(true).GetBytes(presentTags.ToString().Replace(" ", "_")); fs.Write(info, 0, info.Length); if (j != MoreOptionsForm.tagsList2.Length - 1) { info = new UTF8Encoding(true).GetBytes("\",\""); fs.Write(info, 0, info.Length); } } } info = new UTF8Encoding(true).GetBytes("\"]"); fs.Write(info, 0, info.Length); } if (MoreOptionsForm.team == true) { info = new UTF8Encoding(true).GetBytes(",Team:\""); fs.Write(info, 0, info.Length); info = new UTF8Encoding(true).GetBytes(MoreOptionsForm.teamList.ToString().Replace(" ", "_") + "\""); fs.Write(info, 0, info.Length); } info = new UTF8Encoding(true).GetBytes(",Time:-2147483648,NoGravity:" + noGravity + ",BlockState:{Name:\"" + data.Remove(0, 10) + "\",Properties:{"); } else if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == false) { info = new UTF8Encoding(true).GetBytes(",BlockState:{Name:\"" + data.Remove(0, 10) + "\",Properties:{"); } fs.Write(info, 0, info.Length); info = new UTF8Encoding(true).GetBytes(""); fs.Write(info, 0, info.Length); for (int j = 4; j < multiplier; j++) { if (block[i + j].ToString() != "null") { switch (j) { case 4: info = new UTF8Encoding(true).GetBytes("facing:" + block[i + j].ToString() + ","); break; case 5: info = new UTF8Encoding(true).GetBytes("type:" + block[i + j].ToString() + ","); break; case 6: info = new UTF8Encoding(true).GetBytes("rotation:" + block[i + j].ToString() + ","); break; case 7: info = new UTF8Encoding(true).GetBytes("snowy:" + block[i + j].ToString() + ","); break; case 8: info = new UTF8Encoding(true).GetBytes("half:" + block[i + j].ToString() + ","); break; case 9: info = new UTF8Encoding(true).GetBytes("axis:" + block[i + j].ToString() + ","); break; } fs.Write(info, 0, info.Length); } } if (paramSize == 5 && MoreOptionsForm.fOnArmorStand == true) { info = new UTF8Encoding(true).GetBytes("}}}]}\n"); } else { info = new UTF8Encoding(true).GetBytes("}}}\n"); } fs.Write(info, 0, info.Length); } if (MoreOptionsForm.coolPlants == true && Array.Exists <string>(specialBlocks.paperPlant, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", ""))) == true) { if (MoreOptionsForm.coolPlants == true && Array.Exists <string>(specialBlocks.paperPlant, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", ""))) == true) { switch (paramSize) { case 1: x += 0.39; //z +=- -0.3657; break; case 2: x += 0.27758; break; case 3: x += -0.8; z += -0.53; break; case 4: x += -0.4; z += -0.265; break; } } xString = x.ToString(); yString = y.ToString(); zString = z.ToString(); info = new UTF8Encoding(true).GetBytes("summon armor_stand ~" + xString.Replace(",", ".") + " ~" + yString.Replace(",", ".") + " ~" + zString.Replace(",", ".") + " {Invisible:1b,Invulnerable:1b,PersistenceRequired:1b"); fs.Write(info, 0, info.Length); if (CreateForm.tag == true) { info = new UTF8Encoding(true).GetBytes(",Tags:[\""); fs.Write(info, 0, info.Length); for (int j = 0; j < CreateForm.tagsList.Length; j++) { if (CreateForm.tagsList[j] != "") { presentTags = CreateForm.tagsList[j]; info = new UTF8Encoding(true).GetBytes(presentTags.ToString().Replace(" ", "_")); fs.Write(info, 0, info.Length); if (j != CreateForm.tagsList.Length - 1) { info = new UTF8Encoding(true).GetBytes("\",\""); fs.Write(info, 0, info.Length); } } } info = new UTF8Encoding(true).GetBytes("\"]"); fs.Write(info, 0, info.Length); } if (MoreOptionsForm.team == true) { info = new UTF8Encoding(true).GetBytes(",Team:\""); fs.Write(info, 0, info.Length); info = new UTF8Encoding(true).GetBytes(MoreOptionsForm.teamList.ToString().Replace(" ", "_") + "\""); fs.Write(info, 0, info.Length); } info = new UTF8Encoding(true).GetBytes(",Rotation:[-45f],NoBasePlate:1b,Small:" + small + "b,NoGravity:" + noGravity + "b,Marker:" + marker + "b,"); fs.Write(info, 0, info.Length); if (onArm == 0) { info = new UTF8Encoding(true).GetBytes("ArmorItems:[{},{},{},{id:\"" + data.Remove(0, 10) + "\",Count:1b}],DisabledSlots:4144959}\n"); fs.Write(info, 0, info.Length); } else { info = new UTF8Encoding(true).GetBytes("HandItems:[{id:\"" + data.Remove(0, 10) + "\",Count:1b},{}],DisabledSlots:4144959,"); fs.Write(info, 0, info.Length); if (Array.Exists <string>(specialBlocks.flatItem, element => element.Contains(block[i + 3].ToString().Replace("minecraft:", "")) == true)) { info = new UTF8Encoding(true).GetBytes(horizontalPose + "}\n"); fs.Write(info, 0, info.Length); } else { info = new UTF8Encoding(true).GetBytes(pose + "}\n"); fs.Write(info, 0, info.Length); } } } else { } } else { } } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } var allowDrop = new MainForm(); allowDrop.AllowDrop = true; var canOpen = new MainMenuStrip(); canOpen.openFile(true); }