using System; using System.Reflection; using System.Windows.Forms; using System.ComponentModel; using System.Data; using System.IO; using System.Collections.Generic; using System.Xml; using System.Text; using System.Drawing; using Advanced_Combat_Tracker; [assembly: AssemblyTitle("Parse by Category or # of Players")] [assembly: AssemblyDescription("Display the Top Performers in a Selected Set of Categories Back-To-Back")] [assembly: AssemblyVersion("3.0.1.0")] /* * Version - Date.Time - Notes * ======== =============== ========================================================== * 1.0.0.0 04.19.08.00.00 Initial Release * 2.0.0.0 04.30.08.11.10 Major Changes. Fixed Save to file location. All * Functionality is working, however if some parts are * somewhat buggy due to lack of complete testing/coding. * * 2.0.1.0 04.30.08.13.30 Commented Some of the Code * 3.0.0.0 05.05.08.11.10 DataColumn Specification so Sort occurs as appropriate * (Integer instead of String) * 3.0.1.0 05.20.08.15.20 Fixed Formatting for HPS/Exthps * */ namespace ZeroSum_ACT_Plugins { public class ByCategoryOrPlayerCount_ACT_Plugin : IActPluginV1 { Label lblStatus; //Default label used for tracing the status of the plugin TabPage tpScreen; // Page tab for the Plugin string xmlFileName = Application.StartupPath + "\\Config\\ParseByCategoryNumberofPlayers.config.xml"; // XML File to use for Configuration will be saved in the ACT Program's Config Directory string LastSelectedSection = ""; // Last Section Selected is the last selected item selection (Section 1, section 2, etc) string mocException = ""; // Fake Exception String to avoid "ex Not Used" error TextBox txtPopped_frmPop; // Textbox Used for Form Pop-Up private bool AllowLoad = true; // Booleans to determine if a section was used once to keep it from being used repeatedly private bool AllowSave = true; // Booleans to determine if a section was used once to keep it from being used repeatedly private bool AllowValueChanged = true; // Booleans to determine if a section was used once to keep it from being used repeatedly private bool AllowLostFocus = true; // Booleans to determine if a section was used once to keep it from being used repeatedly private bool AllowTextChanged = true; // Booleans to determine if a section was used once to keep it from being used repeatedly private bool AllowCheckedChanged = true; // Booleans to determine if a section was used once to keep it from being used repeatedly #region UI components // UI Components used by the main Part of the Plugin private System.Windows.Forms.Panel pnlMain; #region Form Components private System.Windows.Forms.GroupBox gbSection2; private System.Windows.Forms.Label lblSection2_MaxPlayers; private System.Windows.Forms.NumericUpDown nudSection2_MaxPlayers; private System.Windows.Forms.Label lblSection2_SortBy; private System.Windows.Forms.Label lblSection2_PerPlayer; private System.Windows.Forms.Label lblSection2_Header; private System.Windows.Forms.TextBox txtSection2_PerPlayer; private System.Windows.Forms.TextBox txtSection2_Header; private System.Windows.Forms.CheckBox chkSection2_Unlimited; private System.Windows.Forms.CheckBox chkSection2_Enabled; private System.Windows.Forms.ComboBox cboxSection2_SortBy; private System.Windows.Forms.Button btnSection2_Delete; private System.Windows.Forms.Button btnSection2_MoveUp; private System.Windows.Forms.Button btnSection2_MoveDown; private System.Windows.Forms.Button btnAddNewSection; private System.Windows.Forms.Label lblSections; private System.Windows.Forms.TreeView tvSections; private System.Windows.Forms.TextBox txtSection2_ID; private System.Windows.Forms.GroupBox gbExportSettings; private System.Windows.Forms.Label lblExportToFile; private System.Windows.Forms.TextBox txtExportToFile; private System.Windows.Forms.ComboBox cboxSection2_PrefixLine; private System.Windows.Forms.Label lblSection2_PrefixLine; private System.Windows.Forms.GroupBox gbSection1; private System.Windows.Forms.ComboBox cboxSection1_PrefixLine; private System.Windows.Forms.Label lblSection1_PrefixLine; private System.Windows.Forms.TextBox txtSection1_ID; private System.Windows.Forms.Button btnSection1_Delete; private System.Windows.Forms.Button btnSection1_MoveUp; private System.Windows.Forms.Button btnSection1_MoveDown; private System.Windows.Forms.ComboBox cboxSection1_SortBy; private System.Windows.Forms.CheckBox chkSection1_Enabled; private System.Windows.Forms.Label lblSection1_MaxPlayers; private System.Windows.Forms.NumericUpDown nudSection1_MaxPlayers; private System.Windows.Forms.Label lblSection1_SortBy; private System.Windows.Forms.Label lblSection1_PerPlayer; private System.Windows.Forms.Label lblSection1_Header; private System.Windows.Forms.TextBox txtSection1_PerPlayer; private System.Windows.Forms.TextBox txtSection1_Header; private System.Windows.Forms.CheckBox chkSection1_Unlimited; private System.Windows.Forms.GroupBox gbSection3; private System.Windows.Forms.ComboBox cboxSection3_PrefixLine; private System.Windows.Forms.Label lblSection3_PrefixLine; private System.Windows.Forms.TextBox txtSection3_ID; private System.Windows.Forms.Button btnSection3_Delete; private System.Windows.Forms.Button btnSection3_MoveUp; private System.Windows.Forms.Button btnSection3_MoveDown; private System.Windows.Forms.ComboBox cboxSection3_SortBy; private System.Windows.Forms.CheckBox chkSection3_Enabled; private System.Windows.Forms.Label lblSection3_MaxPlayers; private System.Windows.Forms.NumericUpDown nudSection3_MaxPlayers; private System.Windows.Forms.Label lblSection3_SortBy; private System.Windows.Forms.Label lblSection3_PerPlayer; private System.Windows.Forms.Label lblSection3_Header; private System.Windows.Forms.TextBox txtSection3_PerPlayer; private System.Windows.Forms.TextBox txtSection3_Header; private System.Windows.Forms.CheckBox chkSection3_Unlimited; private System.Windows.Forms.CheckBox chkSection1_AlliesOnly; private System.Windows.Forms.CheckBox chkSection2_AlliesOnly; private System.Windows.Forms.CheckBox chkSection3_AlliesOnly; private System.Windows.Forms.ToolTip oToolTip; #endregion //Form Components private void InitUI() { this.pnlMain = new System.Windows.Forms.Panel(); this.oToolTip = new System.Windows.Forms.ToolTip(); #region This (Panel) Components From Creator this.gbSection2 = new System.Windows.Forms.GroupBox(); this.cboxSection2_PrefixLine = new System.Windows.Forms.ComboBox(); this.lblSection2_PrefixLine = new System.Windows.Forms.Label(); this.txtSection2_ID = new System.Windows.Forms.TextBox(); this.btnSection2_Delete = new System.Windows.Forms.Button(); this.btnSection2_MoveUp = new System.Windows.Forms.Button(); this.btnSection2_MoveDown = new System.Windows.Forms.Button(); this.cboxSection2_SortBy = new System.Windows.Forms.ComboBox(); this.chkSection2_Enabled = new System.Windows.Forms.CheckBox(); this.lblSection2_MaxPlayers = new System.Windows.Forms.Label(); this.nudSection2_MaxPlayers = new System.Windows.Forms.NumericUpDown(); this.lblSection2_SortBy = new System.Windows.Forms.Label(); this.lblSection2_PerPlayer = new System.Windows.Forms.Label(); this.lblSection2_Header = new System.Windows.Forms.Label(); this.txtSection2_PerPlayer = new System.Windows.Forms.TextBox(); this.txtSection2_Header = new System.Windows.Forms.TextBox(); this.chkSection2_Unlimited = new System.Windows.Forms.CheckBox(); this.tvSections = new System.Windows.Forms.TreeView(); this.btnAddNewSection = new System.Windows.Forms.Button(); this.lblSections = new System.Windows.Forms.Label(); this.gbExportSettings = new System.Windows.Forms.GroupBox(); this.lblExportToFile = new System.Windows.Forms.Label(); this.txtExportToFile = new System.Windows.Forms.TextBox(); this.gbSection1 = new System.Windows.Forms.GroupBox(); this.cboxSection1_PrefixLine = new System.Windows.Forms.ComboBox(); this.lblSection1_PrefixLine = new System.Windows.Forms.Label(); this.txtSection1_ID = new System.Windows.Forms.TextBox(); this.btnSection1_Delete = new System.Windows.Forms.Button(); this.btnSection1_MoveUp = new System.Windows.Forms.Button(); this.btnSection1_MoveDown = new System.Windows.Forms.Button(); this.cboxSection1_SortBy = new System.Windows.Forms.ComboBox(); this.chkSection1_Enabled = new System.Windows.Forms.CheckBox(); this.lblSection1_MaxPlayers = new System.Windows.Forms.Label(); this.nudSection1_MaxPlayers = new System.Windows.Forms.NumericUpDown(); this.lblSection1_SortBy = new System.Windows.Forms.Label(); this.lblSection1_PerPlayer = new System.Windows.Forms.Label(); this.lblSection1_Header = new System.Windows.Forms.Label(); this.txtSection1_PerPlayer = new System.Windows.Forms.TextBox(); this.txtSection1_Header = new System.Windows.Forms.TextBox(); this.chkSection1_Unlimited = new System.Windows.Forms.CheckBox(); this.gbSection3 = new System.Windows.Forms.GroupBox(); this.cboxSection3_PrefixLine = new System.Windows.Forms.ComboBox(); this.lblSection3_PrefixLine = new System.Windows.Forms.Label(); this.txtSection3_ID = new System.Windows.Forms.TextBox(); this.btnSection3_Delete = new System.Windows.Forms.Button(); this.btnSection3_MoveUp = new System.Windows.Forms.Button(); this.btnSection3_MoveDown = new System.Windows.Forms.Button(); this.cboxSection3_SortBy = new System.Windows.Forms.ComboBox(); this.chkSection3_Enabled = new System.Windows.Forms.CheckBox(); this.lblSection3_MaxPlayers = new System.Windows.Forms.Label(); this.nudSection3_MaxPlayers = new System.Windows.Forms.NumericUpDown(); this.lblSection3_SortBy = new System.Windows.Forms.Label(); this.lblSection3_PerPlayer = new System.Windows.Forms.Label(); this.lblSection3_Header = new System.Windows.Forms.Label(); this.txtSection3_PerPlayer = new System.Windows.Forms.TextBox(); this.txtSection3_Header = new System.Windows.Forms.TextBox(); this.chkSection3_Unlimited = new System.Windows.Forms.CheckBox(); this.gbSection2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudSection2_MaxPlayers)).BeginInit(); this.gbExportSettings.SuspendLayout(); this.gbSection1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudSection1_MaxPlayers)).BeginInit(); this.gbSection3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudSection3_MaxPlayers)).BeginInit(); this.chkSection1_AlliesOnly = new System.Windows.Forms.CheckBox(); this.chkSection2_AlliesOnly = new System.Windows.Forms.CheckBox(); this.chkSection3_AlliesOnly = new System.Windows.Forms.CheckBox(); #endregion //This (Panel) Components this.pnlMain.SuspendLayout(); tpScreen.SuspendLayout(); // Create the ToolTip and set initial values. this.oToolTip.AutoPopDelay = 5000; this.oToolTip.InitialDelay = 500; this.oToolTip.OwnerDraw = true; this.oToolTip.ReshowDelay = 10; this.oToolTip.Draw += new DrawToolTipEventHandler(this.oToolTip_Draw); #region ControlConfiguration From Creator // // gbSection2 // this.gbSection2.Controls.Add(this.chkSection2_AlliesOnly); this.gbSection2.Controls.Add(this.cboxSection2_PrefixLine); this.gbSection2.Controls.Add(this.lblSection2_PrefixLine); this.gbSection2.Controls.Add(this.txtSection2_ID); this.gbSection2.Controls.Add(this.btnSection2_Delete); this.gbSection2.Controls.Add(this.btnSection2_MoveUp); this.gbSection2.Controls.Add(this.btnSection2_MoveDown); this.gbSection2.Controls.Add(this.cboxSection2_SortBy); this.gbSection2.Controls.Add(this.chkSection2_Enabled); this.gbSection2.Controls.Add(this.lblSection2_MaxPlayers); this.gbSection2.Controls.Add(this.nudSection2_MaxPlayers); this.gbSection2.Controls.Add(this.lblSection2_SortBy); this.gbSection2.Controls.Add(this.lblSection2_PerPlayer); this.gbSection2.Controls.Add(this.lblSection2_Header); this.gbSection2.Controls.Add(this.txtSection2_PerPlayer); this.gbSection2.Controls.Add(this.txtSection2_Header); this.gbSection2.Controls.Add(this.chkSection2_Unlimited); this.gbSection2.Location = new System.Drawing.Point(3, 118); this.gbSection2.Name = "gbSection2"; this.gbSection2.Size = new System.Drawing.Size(535, 100); this.gbSection2.TabIndex = 1; this.gbSection2.TabStop = false; this.gbSection2.Text = "Section 2"; this.gbSection2.Visible = false; // // cboxSection2_PrefixLine // this.cboxSection2_PrefixLine.FormattingEnabled = true; this.cboxSection2_PrefixLine.Items.AddRange(new object[] { "Group", "Say", "Raid", "Guild", "Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12", "Channel 13", "Channel 14", "Channel 15", "Channel 16", "Channel 17", "Channel 18", "Channel 19", "Channel 20", "tell {name}", "tell Player"}); this.cboxSection2_PrefixLine.Location = new System.Drawing.Point(361, 43); this.cboxSection2_PrefixLine.Name = "cboxSection2_PrefixLine"; this.cboxSection2_PrefixLine.Size = new System.Drawing.Size(138, 21); this.cboxSection2_PrefixLine.TabIndex = 22; // // lblSection2_PrefixLine // this.lblSection2_PrefixLine.AutoSize = true; this.lblSection2_PrefixLine.Location = new System.Drawing.Point(354, 31); this.lblSection2_PrefixLine.Name = "lblSection2_PrefixLine"; this.lblSection2_PrefixLine.Size = new System.Drawing.Size(88, 13); this.lblSection2_PrefixLine.TabIndex = 21; this.lblSection2_PrefixLine.Text = "Chat Destination:"; // // txtSection2_ID // this.txtSection2_ID.Location = new System.Drawing.Point(6, 46); this.txtSection2_ID.Name = "txtSection2_ID"; this.txtSection2_ID.Size = new System.Drawing.Size(16, 20); this.txtSection2_ID.TabIndex = 20; this.txtSection2_ID.Visible = false; // // btnSection2_Delete // this.btnSection2_Delete.Location = new System.Drawing.Point(505, 10); this.btnSection2_Delete.Name = "btnSection2_Delete"; this.btnSection2_Delete.Size = new System.Drawing.Size(25, 25); this.btnSection2_Delete.TabIndex = 18; this.btnSection2_Delete.Text = "X"; this.btnSection2_Delete.UseVisualStyleBackColor = true; // // btnSection2_MoveUp // this.btnSection2_MoveUp.Location = new System.Drawing.Point(505, 36); this.btnSection2_MoveUp.Name = "btnSection2_MoveUp"; this.btnSection2_MoveUp.Size = new System.Drawing.Size(26, 23); this.btnSection2_MoveUp.TabIndex = 17; this.btnSection2_MoveUp.Text = "▲"; this.btnSection2_MoveUp.UseVisualStyleBackColor = true; // // btnSection2_MoveDown // this.btnSection2_MoveDown.Location = new System.Drawing.Point(505, 62); this.btnSection2_MoveDown.Margin = new System.Windows.Forms.Padding(1); this.btnSection2_MoveDown.Name = "btnSection2_MoveDown"; this.btnSection2_MoveDown.Size = new System.Drawing.Size(26, 23); this.btnSection2_MoveDown.TabIndex = 16; this.btnSection2_MoveDown.Text = "▼"; this.btnSection2_MoveDown.UseVisualStyleBackColor = true; // // cboxSection2_SortBy // this.cboxSection2_SortBy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboxSection2_SortBy.FormattingEnabled = true; this.cboxSection2_SortBy.Location = new System.Drawing.Point(301, 68); this.cboxSection2_SortBy.Name = "cboxSection2_SortBy"; this.cboxSection2_SortBy.Size = new System.Drawing.Size(198, 21); this.cboxSection2_SortBy.TabIndex = 15; this.cboxSection2_SortBy.Items.AddRange(new object[] { "{name}", "===Damage===", "{damage}", "{damage%}", "{dps}", "{DPS}", "{extdps}", "{EXTDPS}", "===Healed===", "{healed}", "{healed%}", "{exthps}", "{EXTHPS}", "{critheals}", "{heals}", "{maxheal}", "{MAXHEAL}", "{maxhealward}", "{MAXHEALWARD}", "===Hits===", "{hits}", "{crithits}", "{misses}", "{hitfailed}", "{swings}", "{tohit}", "{TOHIT}", "{maxhit}", "{MAXHIT}", "===Misc===", "{healstaken}", "{powerdrain}", "{kills}", "{deaths}", "{date}", "{time}", "{datetime}", "===Name===", "{NAME3}", "{NAME4}", "{NAME5}", "{NAME6}", "{NAME7}", "{NAME8}", "{NAME9}", "{NAME10}", "{NAME11}", "{NAME12}", "{NAME13}", "{NAME14}", "{NAME15}"}); // // chkSection2_Enabled // this.chkSection2_Enabled.AutoSize = true; this.chkSection2_Enabled.Location = new System.Drawing.Point(434, 15); this.chkSection2_Enabled.Name = "chkSection2_Enabled"; this.chkSection2_Enabled.Size = new System.Drawing.Size(65, 17); this.chkSection2_Enabled.TabIndex = 14; this.chkSection2_Enabled.Text = "Enabled"; this.chkSection2_Enabled.UseVisualStyleBackColor = true; // // lblSection2_MaxPlayers // this.lblSection2_MaxPlayers.AutoSize = true; this.lblSection2_MaxPlayers.Location = new System.Drawing.Point(28, 72); this.lblSection2_MaxPlayers.Name = "lblSection2_MaxPlayers"; this.lblSection2_MaxPlayers.Size = new System.Drawing.Size(77, 13); this.lblSection2_MaxPlayers.TabIndex = 9; this.lblSection2_MaxPlayers.Text = "Max # Players:"; // // nudSection2_MaxPlayers // this.nudSection2_MaxPlayers.Location = new System.Drawing.Point(111, 69); this.nudSection2_MaxPlayers.Maximum = new decimal(new int[] { 24, 0, 0, 0}); this.nudSection2_MaxPlayers.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.nudSection2_MaxPlayers.Name = "nudSection2_MaxPlayers"; this.nudSection2_MaxPlayers.Size = new System.Drawing.Size(37, 20); this.nudSection2_MaxPlayers.TabIndex = 8; this.nudSection2_MaxPlayers.Value = new decimal(new int[] { 10, 0, 0, 0}); // // lblSection2_SortBy // this.lblSection2_SortBy.AutoSize = true; this.lblSection2_SortBy.Location = new System.Drawing.Point(251, 72); this.lblSection2_SortBy.Name = "lblSection2_SortBy"; this.lblSection2_SortBy.Size = new System.Drawing.Size(44, 13); this.lblSection2_SortBy.TabIndex = 7; this.lblSection2_SortBy.Text = "Sort By:"; // // lblSection2_PerPlayer // this.lblSection2_PerPlayer.AutoSize = true; this.lblSection2_PerPlayer.Location = new System.Drawing.Point(27, 44); this.lblSection2_PerPlayer.Name = "lblSection2_PerPlayer"; this.lblSection2_PerPlayer.Size = new System.Drawing.Size(58, 13); this.lblSection2_PerPlayer.TabIndex = 6; this.lblSection2_PerPlayer.Text = "Per Player:"; // // lblSection2_Header // this.lblSection2_Header.AutoSize = true; this.lblSection2_Header.Location = new System.Drawing.Point(6, 23); this.lblSection2_Header.Name = "lblSection2_Header"; this.lblSection2_Header.Size = new System.Drawing.Size(84, 13); this.lblSection2_Header.TabIndex = 5; this.lblSection2_Header.Text = "Section Header:"; // // txtSection2_PerPlayer // this.txtSection2_PerPlayer.Location = new System.Drawing.Point(91, 44); this.txtSection2_PerPlayer.Name = "txtSection2_PerPlayer"; this.txtSection2_PerPlayer.Size = new System.Drawing.Size(254, 20); this.txtSection2_PerPlayer.TabIndex = 3; // // txtSection2_Header // this.txtSection2_Header.Location = new System.Drawing.Point(92, 20); this.txtSection2_Header.Name = "txtSection2_Header"; this.txtSection2_Header.Size = new System.Drawing.Size(253, 20); this.txtSection2_Header.TabIndex = 2; // // chkSection2_Unlimited // this.chkSection2_Unlimited.AutoSize = true; this.chkSection2_Unlimited.Location = new System.Drawing.Point(154, 70); this.chkSection2_Unlimited.Name = "chkSection2_Unlimited"; this.chkSection2_Unlimited.Size = new System.Drawing.Size(69, 17); this.chkSection2_Unlimited.TabIndex = 1; this.chkSection2_Unlimited.Text = "Unlimited"; this.chkSection2_Unlimited.UseVisualStyleBackColor = true; // // tvSections // this.tvSections.AllowDrop = true; this.tvSections.Location = new System.Drawing.Point(551, 36); this.tvSections.Name = "tvSections"; this.tvSections.Size = new System.Drawing.Size(206, 250); this.tvSections.TabIndex = 2; // // btnAddNewSection // this.btnAddNewSection.Location = new System.Drawing.Point(614, 296); this.btnAddNewSection.Name = "btnAddNewSection"; this.btnAddNewSection.Size = new System.Drawing.Size(143, 23); this.btnAddNewSection.TabIndex = 4; this.btnAddNewSection.Text = "Add/Insert New Section"; this.btnAddNewSection.UseVisualStyleBackColor = true; // // lblSections // this.lblSections.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lblSections.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblSections.Location = new System.Drawing.Point(551, 12); this.lblSections.Name = "lblSections"; this.lblSections.Size = new System.Drawing.Size(206, 21); this.lblSections.TabIndex = 5; this.lblSections.Text = "Sections"; this.lblSections.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // gbExportSettings // this.gbExportSettings.Controls.Add(this.lblExportToFile); this.gbExportSettings.Controls.Add(this.txtExportToFile); this.gbExportSettings.Location = new System.Drawing.Point(9, 329); this.gbExportSettings.Name = "gbExportSettings"; this.gbExportSettings.Size = new System.Drawing.Size(748, 46); this.gbExportSettings.TabIndex = 10; this.gbExportSettings.TabStop = false; this.gbExportSettings.Text = "Export Settings"; // // lblExportToFile // this.lblExportToFile.AutoSize = true; this.lblExportToFile.Location = new System.Drawing.Point(9, 20); this.lblExportToFile.Name = "lblExportToFile"; this.lblExportToFile.Size = new System.Drawing.Size(71, 13); this.lblExportToFile.TabIndex = 11; this.lblExportToFile.Text = "Export to File:"; // // txtExportToFile // this.txtExportToFile.Location = new System.Drawing.Point(86, 17); this.txtExportToFile.Name = "txtExportToFile"; this.txtExportToFile.Size = new System.Drawing.Size(533, 20); this.txtExportToFile.TabIndex = 10; // // gbSection1 // this.gbSection1.Controls.Add(this.chkSection1_AlliesOnly); this.gbSection1.Controls.Add(this.cboxSection1_PrefixLine); this.gbSection1.Controls.Add(this.lblSection1_PrefixLine); this.gbSection1.Controls.Add(this.txtSection1_ID); this.gbSection1.Controls.Add(this.btnSection1_Delete); this.gbSection1.Controls.Add(this.btnSection1_MoveUp); this.gbSection1.Controls.Add(this.btnSection1_MoveDown); this.gbSection1.Controls.Add(this.cboxSection1_SortBy); this.gbSection1.Controls.Add(this.chkSection1_Enabled); this.gbSection1.Controls.Add(this.lblSection1_MaxPlayers); this.gbSection1.Controls.Add(this.nudSection1_MaxPlayers); this.gbSection1.Controls.Add(this.lblSection1_SortBy); this.gbSection1.Controls.Add(this.lblSection1_PerPlayer); this.gbSection1.Controls.Add(this.lblSection1_Header); this.gbSection1.Controls.Add(this.txtSection1_PerPlayer); this.gbSection1.Controls.Add(this.txtSection1_Header); this.gbSection1.Controls.Add(this.chkSection1_Unlimited); this.gbSection1.Location = new System.Drawing.Point(3, 12); this.gbSection1.Name = "gbSection1"; this.gbSection1.Size = new System.Drawing.Size(535, 100); this.gbSection1.TabIndex = 11; this.gbSection1.TabStop = false; this.gbSection1.Text = "Section 1"; this.gbSection1.Visible = false; // // cboxSection1_PrefixLine // this.cboxSection1_PrefixLine.FormattingEnabled = true; this.cboxSection1_PrefixLine.Items.AddRange(new object[] { "Group", "Say", "Raid", "Guild", "Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12", "Channel 13", "Channel 14", "Channel 15", "Channel 16", "Channel 17", "Channel 18", "Channel 19", "Channel 20", "tell {name}", "tell Player"}); this.cboxSection1_PrefixLine.Location = new System.Drawing.Point(361, 43); this.cboxSection1_PrefixLine.Name = "cboxSection1_PrefixLine"; this.cboxSection1_PrefixLine.Size = new System.Drawing.Size(138, 21); this.cboxSection1_PrefixLine.TabIndex = 22; // // lblSection1_PrefixLine // this.lblSection1_PrefixLine.AutoSize = true; this.lblSection1_PrefixLine.Location = new System.Drawing.Point(354, 31); this.lblSection1_PrefixLine.Name = "lblSection1_PrefixLine"; this.lblSection1_PrefixLine.Size = new System.Drawing.Size(88, 13); this.lblSection1_PrefixLine.TabIndex = 21; this.lblSection1_PrefixLine.Text = "Chat Destination:"; // // txtSection1_ID // this.txtSection1_ID.Location = new System.Drawing.Point(6, 46); this.txtSection1_ID.Name = "txtSection1_ID"; this.txtSection1_ID.Size = new System.Drawing.Size(16, 20); this.txtSection1_ID.TabIndex = 20; this.txtSection1_ID.Visible = false; // // btnSection1_Delete // this.btnSection1_Delete.Location = new System.Drawing.Point(505, 10); this.btnSection1_Delete.Name = "btnSection1_Delete"; this.btnSection1_Delete.Size = new System.Drawing.Size(25, 25); this.btnSection1_Delete.TabIndex = 18; this.btnSection1_Delete.Text = "X"; this.btnSection1_Delete.UseVisualStyleBackColor = true; // // btnSection1_MoveUp // this.btnSection1_MoveUp.Location = new System.Drawing.Point(505, 36); this.btnSection1_MoveUp.Name = "btnSection1_MoveUp"; this.btnSection1_MoveUp.Size = new System.Drawing.Size(26, 23); this.btnSection1_MoveUp.TabIndex = 17; this.btnSection1_MoveUp.Text = "▲"; this.btnSection1_MoveUp.UseVisualStyleBackColor = true; // // btnSection1_MoveDown // this.btnSection1_MoveDown.Location = new System.Drawing.Point(505, 62); this.btnSection1_MoveDown.Margin = new System.Windows.Forms.Padding(1); this.btnSection1_MoveDown.Name = "btnSection1_MoveDown"; this.btnSection1_MoveDown.Size = new System.Drawing.Size(26, 23); this.btnSection1_MoveDown.TabIndex = 16; this.btnSection1_MoveDown.Text = "▼"; this.btnSection1_MoveDown.UseVisualStyleBackColor = true; // // cboxSection1_SortBy // this.cboxSection1_SortBy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboxSection1_SortBy.FormattingEnabled = true; this.cboxSection1_SortBy.Location = new System.Drawing.Point(301, 68); this.cboxSection1_SortBy.Name = "cboxSection1_SortBy"; this.cboxSection1_SortBy.Size = new System.Drawing.Size(198, 21); this.cboxSection1_SortBy.TabIndex = 15; this.cboxSection1_SortBy.Items.AddRange(new object[] { "{name}", "===Damage===", "{damage}", "{damage%}", "{dps}", "{DPS}", "{extdps}", "{EXTDPS}", "===Healed===", "{healed}", "{healed%}", "{exthps}", "{EXTHPS}", "{critheals}", "{heals}", "{maxheal}", "{MAXHEAL}", "{maxhealward}", "{MAXHEALWARD}", "===Hits===", "{hits}", "{crithits}", "{misses}", "{hitfailed}", "{swings}", "{tohit}", "{TOHIT}", "{maxhit}", "{MAXHIT}", "===Misc===", "{healstaken}", "{powerdrain}", "{kills}", "{deaths}", "===Name===", "{NAME3}", "{NAME4}", "{NAME5}", "{NAME6}", "{NAME7}", "{NAME8}", "{NAME9}", "{NAME10}", "{NAME11}", "{NAME12}", "{NAME13}", "{NAME14}", "{NAME15}"}); // // chkSection1_Enabled // this.chkSection1_Enabled.AutoSize = true; this.chkSection1_Enabled.Location = new System.Drawing.Point(434, 15); this.chkSection1_Enabled.Name = "chkSection1_Enabled"; this.chkSection1_Enabled.Size = new System.Drawing.Size(65, 17); this.chkSection1_Enabled.TabIndex = 14; this.chkSection1_Enabled.Text = "Enabled"; this.chkSection1_Enabled.UseVisualStyleBackColor = true; // // lblSection1_MaxPlayers // this.lblSection1_MaxPlayers.AutoSize = true; this.lblSection1_MaxPlayers.Location = new System.Drawing.Point(28, 72); this.lblSection1_MaxPlayers.Name = "lblSection1_MaxPlayers"; this.lblSection1_MaxPlayers.Size = new System.Drawing.Size(77, 13); this.lblSection1_MaxPlayers.TabIndex = 9; this.lblSection1_MaxPlayers.Text = "Max # Players:"; // // nudSection1_MaxPlayers // this.nudSection1_MaxPlayers.Location = new System.Drawing.Point(111, 69); this.nudSection1_MaxPlayers.Maximum = new decimal(new int[] { 24, 0, 0, 0}); this.nudSection1_MaxPlayers.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.nudSection1_MaxPlayers.Name = "nudSection1_MaxPlayers"; this.nudSection1_MaxPlayers.Size = new System.Drawing.Size(37, 20); this.nudSection1_MaxPlayers.TabIndex = 8; this.nudSection1_MaxPlayers.Value = new decimal(new int[] { 10, 0, 0, 0}); // // lblSection1_SortBy // this.lblSection1_SortBy.AutoSize = true; this.lblSection1_SortBy.Location = new System.Drawing.Point(251, 72); this.lblSection1_SortBy.Name = "lblSection1_SortBy"; this.lblSection1_SortBy.Size = new System.Drawing.Size(44, 13); this.lblSection1_SortBy.TabIndex = 7; this.lblSection1_SortBy.Text = "Sort By:"; // // lblSection1_PerPlayer // this.lblSection1_PerPlayer.AutoSize = true; this.lblSection1_PerPlayer.Location = new System.Drawing.Point(27, 44); this.lblSection1_PerPlayer.Name = "lblSection1_PerPlayer"; this.lblSection1_PerPlayer.Size = new System.Drawing.Size(58, 13); this.lblSection1_PerPlayer.TabIndex = 6; this.lblSection1_PerPlayer.Text = "Per Player:"; // // lblSection1_Header // this.lblSection1_Header.AutoSize = true; this.lblSection1_Header.Location = new System.Drawing.Point(6, 23); this.lblSection1_Header.Name = "lblSection1_Header"; this.lblSection1_Header.Size = new System.Drawing.Size(84, 13); this.lblSection1_Header.TabIndex = 5; this.lblSection1_Header.Text = "Section Header:"; // // txtSection1_PerPlayer // this.txtSection1_PerPlayer.Location = new System.Drawing.Point(91, 44); this.txtSection1_PerPlayer.Name = "txtSection1_PerPlayer"; this.txtSection1_PerPlayer.Size = new System.Drawing.Size(254, 20); this.txtSection1_PerPlayer.TabIndex = 3; // // txtSection1_Header // this.txtSection1_Header.Location = new System.Drawing.Point(92, 20); this.txtSection1_Header.Name = "txtSection1_Header"; this.txtSection1_Header.Size = new System.Drawing.Size(253, 20); this.txtSection1_Header.TabIndex = 2; // // chkSection1_Unlimited // this.chkSection1_Unlimited.AutoSize = true; this.chkSection1_Unlimited.Location = new System.Drawing.Point(154, 70); this.chkSection1_Unlimited.Name = "chkSection1_Unlimited"; this.chkSection1_Unlimited.Size = new System.Drawing.Size(69, 17); this.chkSection1_Unlimited.TabIndex = 1; this.chkSection1_Unlimited.Text = "Unlimited"; this.chkSection1_Unlimited.UseVisualStyleBackColor = true; // // gbSection3 // this.gbSection3.Controls.Add(this.chkSection3_AlliesOnly); this.gbSection3.Controls.Add(this.cboxSection3_PrefixLine); this.gbSection3.Controls.Add(this.lblSection3_PrefixLine); this.gbSection3.Controls.Add(this.txtSection3_ID); this.gbSection3.Controls.Add(this.btnSection3_Delete); this.gbSection3.Controls.Add(this.btnSection3_MoveUp); this.gbSection3.Controls.Add(this.btnSection3_MoveDown); this.gbSection3.Controls.Add(this.cboxSection3_SortBy); this.gbSection3.Controls.Add(this.chkSection3_Enabled); this.gbSection3.Controls.Add(this.lblSection3_MaxPlayers); this.gbSection3.Controls.Add(this.nudSection3_MaxPlayers); this.gbSection3.Controls.Add(this.lblSection3_SortBy); this.gbSection3.Controls.Add(this.lblSection3_PerPlayer); this.gbSection3.Controls.Add(this.lblSection3_Header); this.gbSection3.Controls.Add(this.txtSection3_PerPlayer); this.gbSection3.Controls.Add(this.txtSection3_Header); this.gbSection3.Controls.Add(this.chkSection3_Unlimited); this.gbSection3.Location = new System.Drawing.Point(3, 223); this.gbSection3.Name = "gbSection3"; this.gbSection3.Size = new System.Drawing.Size(535, 100); this.gbSection3.TabIndex = 23; this.gbSection3.TabStop = false; this.gbSection3.Text = "Section 3"; this.gbSection3.Visible = false; // // cboxSection3_PrefixLine // this.cboxSection3_PrefixLine.FormattingEnabled = true; this.cboxSection3_PrefixLine.Items.AddRange(new object[] { "Group", "Say", "Raid", "Guild", "Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12", "Channel 13", "Channel 14", "Channel 15", "Channel 16", "Channel 17", "Channel 18", "Channel 19", "Channel 20", "tell {name}", "tell Player"}); this.cboxSection3_PrefixLine.Location = new System.Drawing.Point(361, 43); this.cboxSection3_PrefixLine.Name = "cboxSection3_PrefixLine"; this.cboxSection3_PrefixLine.Size = new System.Drawing.Size(138, 21); this.cboxSection3_PrefixLine.TabIndex = 22; // // lblSection3_PrefixLine // this.lblSection3_PrefixLine.AutoSize = true; this.lblSection3_PrefixLine.Location = new System.Drawing.Point(354, 31); this.lblSection3_PrefixLine.Name = "lblSection3_PrefixLine"; this.lblSection3_PrefixLine.Size = new System.Drawing.Size(88, 13); this.lblSection3_PrefixLine.TabIndex = 21; this.lblSection3_PrefixLine.Text = "Chat Destination:"; // // txtSection3_ID // this.txtSection3_ID.Location = new System.Drawing.Point(6, 46); this.txtSection3_ID.Name = "txtSection3_ID"; this.txtSection3_ID.Size = new System.Drawing.Size(16, 20); this.txtSection3_ID.TabIndex = 20; this.txtSection3_ID.Visible = false; // // btnSection3_Delete // this.btnSection3_Delete.Location = new System.Drawing.Point(505, 10); this.btnSection3_Delete.Name = "btnSection3_Delete"; this.btnSection3_Delete.Size = new System.Drawing.Size(25, 25); this.btnSection3_Delete.TabIndex = 18; this.btnSection3_Delete.Text = "X"; this.btnSection3_Delete.UseVisualStyleBackColor = true; // // btnSection3_MoveUp // this.btnSection3_MoveUp.Location = new System.Drawing.Point(505, 36); this.btnSection3_MoveUp.Name = "btnSection3_MoveUp"; this.btnSection3_MoveUp.Size = new System.Drawing.Size(26, 23); this.btnSection3_MoveUp.TabIndex = 17; this.btnSection3_MoveUp.Text = "▲"; this.btnSection3_MoveUp.UseVisualStyleBackColor = true; // // btnSection3_MoveDown // this.btnSection3_MoveDown.Location = new System.Drawing.Point(505, 62); this.btnSection3_MoveDown.Margin = new System.Windows.Forms.Padding(1); this.btnSection3_MoveDown.Name = "btnSection3_MoveDown"; this.btnSection3_MoveDown.Size = new System.Drawing.Size(26, 23); this.btnSection3_MoveDown.TabIndex = 16; this.btnSection3_MoveDown.Text = "▼"; this.btnSection3_MoveDown.UseVisualStyleBackColor = true; // // cboxSection3_SortBy // this.cboxSection3_SortBy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboxSection3_SortBy.FormattingEnabled = true; this.cboxSection3_SortBy.Location = new System.Drawing.Point(301, 68); this.cboxSection3_SortBy.Name = "cboxSection3_SortBy"; this.cboxSection3_SortBy.Size = new System.Drawing.Size(198, 21); this.cboxSection3_SortBy.TabIndex = 15; this.cboxSection3_SortBy.Items.AddRange(new object[] { "{name}", "===Damage===", "{damage}", "{damage%}", "{dps}", "{DPS}", "{extdps}", "{EXTDPS}", "===Healed===", "{healed}", "{healed%}", "{exthps}", "{EXTHPS}", "{critheals}", "{heals}", "{maxheal}", "{MAXHEAL}", "{maxhealward}", "{MAXHEALWARD}", "===Hits===", "{hits}", "{crithits}", "{misses}", "{hitfailed}", "{swings}", "{tohit}", "{TOHIT}", "{maxhit}", "{MAXHIT}", "===Misc===", "{healstaken}", "{powerdrain}", "{kills}", "{deaths}", "===Name===", "{NAME3}", "{NAME4}", "{NAME5}", "{NAME6}", "{NAME7}", "{NAME8}", "{NAME9}", "{NAME10}", "{NAME11}", "{NAME12}", "{NAME13}", "{NAME14}", "{NAME15}"}); // // chkSection3_Enabled // this.chkSection3_Enabled.AutoSize = true; this.chkSection3_Enabled.Location = new System.Drawing.Point(434, 15); this.chkSection3_Enabled.Name = "chkSection3_Enabled"; this.chkSection3_Enabled.Size = new System.Drawing.Size(65, 17); this.chkSection3_Enabled.TabIndex = 14; this.chkSection3_Enabled.Text = "Enabled"; this.chkSection3_Enabled.UseVisualStyleBackColor = true; // // lblSection3_MaxPlayers // this.lblSection3_MaxPlayers.AutoSize = true; this.lblSection3_MaxPlayers.Location = new System.Drawing.Point(28, 72); this.lblSection3_MaxPlayers.Name = "lblSection3_MaxPlayers"; this.lblSection3_MaxPlayers.Size = new System.Drawing.Size(77, 13); this.lblSection3_MaxPlayers.TabIndex = 9; this.lblSection3_MaxPlayers.Text = "Max # Players:"; // // nudSection3_MaxPlayers // this.nudSection3_MaxPlayers.Location = new System.Drawing.Point(111, 69); this.nudSection3_MaxPlayers.Maximum = new decimal(new int[] { 24, 0, 0, 0}); this.nudSection3_MaxPlayers.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.nudSection3_MaxPlayers.Name = "nudSection3_MaxPlayers"; this.nudSection3_MaxPlayers.Size = new System.Drawing.Size(37, 20); this.nudSection3_MaxPlayers.TabIndex = 8; this.nudSection3_MaxPlayers.Value = new decimal(new int[] { 10, 0, 0, 0}); // // lblSection3_SortBy // this.lblSection3_SortBy.AutoSize = true; this.lblSection3_SortBy.Location = new System.Drawing.Point(251, 72); this.lblSection3_SortBy.Name = "lblSection3_SortBy"; this.lblSection3_SortBy.Size = new System.Drawing.Size(44, 13); this.lblSection3_SortBy.TabIndex = 7; this.lblSection3_SortBy.Text = "Sort By:"; // // lblSection3_PerPlayer // this.lblSection3_PerPlayer.AutoSize = true; this.lblSection3_PerPlayer.Location = new System.Drawing.Point(27, 44); this.lblSection3_PerPlayer.Name = "lblSection3_PerPlayer"; this.lblSection3_PerPlayer.Size = new System.Drawing.Size(58, 13); this.lblSection3_PerPlayer.TabIndex = 6; this.lblSection3_PerPlayer.Text = "Per Player:"; // // lblSection3_Header // this.lblSection3_Header.AutoSize = true; this.lblSection3_Header.Location = new System.Drawing.Point(6, 23); this.lblSection3_Header.Name = "lblSection3_Header"; this.lblSection3_Header.Size = new System.Drawing.Size(84, 13); this.lblSection3_Header.TabIndex = 5; this.lblSection3_Header.Text = "Section Header:"; // // txtSection3_PerPlayer // this.txtSection3_PerPlayer.Location = new System.Drawing.Point(91, 44); this.txtSection3_PerPlayer.Name = "txtSection3_PerPlayer"; this.txtSection3_PerPlayer.Size = new System.Drawing.Size(254, 20); this.txtSection3_PerPlayer.TabIndex = 3; // // txtSection3_Header // this.txtSection3_Header.Location = new System.Drawing.Point(92, 20); this.txtSection3_Header.Name = "txtSection3_Header"; this.txtSection3_Header.Size = new System.Drawing.Size(253, 20); this.txtSection3_Header.TabIndex = 2; // // chkSection3_Unlimited // this.chkSection3_Unlimited.AutoSize = true; this.chkSection3_Unlimited.Location = new System.Drawing.Point(154, 70); this.chkSection3_Unlimited.Name = "chkSection3_Unlimited"; this.chkSection3_Unlimited.Size = new System.Drawing.Size(69, 17); this.chkSection3_Unlimited.TabIndex = 1; this.chkSection3_Unlimited.Text = "Unlimited"; this.chkSection3_Unlimited.UseVisualStyleBackColor = true; // // chkSection1_AlliesOnly // this.chkSection1_AlliesOnly.AutoSize = true; this.chkSection1_AlliesOnly.Location = new System.Drawing.Point(351, 15); this.chkSection1_AlliesOnly.Name = "chkSection1_AlliesOnly"; this.chkSection1_AlliesOnly.Size = new System.Drawing.Size(74, 17); this.chkSection1_AlliesOnly.TabIndex = 23; this.chkSection1_AlliesOnly.Text = "Allies Only"; this.chkSection1_AlliesOnly.UseVisualStyleBackColor = true; // // chkSection2_AlliesOnly // this.chkSection2_AlliesOnly.AutoSize = true; this.chkSection2_AlliesOnly.Location = new System.Drawing.Point(351, 15); this.chkSection2_AlliesOnly.Name = "chkSection2_AlliesOnly"; this.chkSection2_AlliesOnly.Size = new System.Drawing.Size(74, 17); this.chkSection2_AlliesOnly.TabIndex = 24; this.chkSection2_AlliesOnly.Text = "Allies Only"; this.chkSection2_AlliesOnly.UseVisualStyleBackColor = true; // // chkSection3_AlliesOnly // this.chkSection3_AlliesOnly.AutoSize = true; this.chkSection3_AlliesOnly.Location = new System.Drawing.Point(351, 15); this.chkSection3_AlliesOnly.Name = "chkSection3_AlliesOnly"; this.chkSection3_AlliesOnly.Size = new System.Drawing.Size(74, 17); this.chkSection3_AlliesOnly.TabIndex = 24; this.chkSection3_AlliesOnly.Text = "Allies Only"; this.chkSection3_AlliesOnly.UseVisualStyleBackColor = true; #endregion //ControlConfiguration #region Tooltips this.oToolTip.SetToolTip(this.btnSection1_Delete, "Delete this Section"); this.oToolTip.SetToolTip(this.btnSection1_MoveUp, "Move this Section Up one Level"); this.oToolTip.SetToolTip(this.btnSection1_MoveDown, "Move this Section Down one Level"); this.oToolTip.SetToolTip(this.chkSection1_Enabled, "Click to Enable / Disable Section"); this.oToolTip.SetToolTip(this.nudSection1_MaxPlayers, "Max Number of Players to Display in this Section"); this.oToolTip.SetToolTip(this.btnSection2_Delete, "Delete this Section"); this.oToolTip.SetToolTip(this.btnSection2_MoveUp, "Move this Section Up one Level"); this.oToolTip.SetToolTip(this.btnSection2_MoveDown, "Move this Section Down one Level"); this.oToolTip.SetToolTip(this.chkSection2_Enabled, "Click to Enable / Disable Section"); this.oToolTip.SetToolTip(this.nudSection2_MaxPlayers, "Max Number of Players to Display in this Section"); this.oToolTip.SetToolTip(this.btnSection3_Delete, "Delete this Section"); this.oToolTip.SetToolTip(this.btnSection3_MoveUp, "Move this Section Up one Level"); this.oToolTip.SetToolTip(this.btnSection3_MoveDown, "Move this Section Down one Level"); this.oToolTip.SetToolTip(this.chkSection3_Enabled, "Click to Enable / Disable Section"); this.oToolTip.SetToolTip(this.nudSection3_MaxPlayers, "Max Number of Players to Display in this Section"); this.oToolTip.SetToolTip(this.tvSections, "Click a Section to Select and Display"); this.oToolTip.SetToolTip(this.btnSection1_Delete, "Add New Section"); this.oToolTip.SetToolTip(this.txtSection1_PerPlayer, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.txtSection2_PerPlayer, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.txtSection3_PerPlayer, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.txtSection1_Header, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.txtSection2_Header, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.txtSection3_Header, "Double Click for Parse Generator"); this.oToolTip.SetToolTip(this.cboxSection1_PrefixLine, "Chat To Send Data to (Prefix each line). For example: /g for group, /gu for guild, /tell Cedric, /tell funkmasterp"); this.oToolTip.SetToolTip(this.cboxSection2_PrefixLine, "Chat To Send Data to (Prefix each line). For example: /g for group, /gu for guild, /tell Cedric, /tell funkmasterp"); this.oToolTip.SetToolTip(this.cboxSection3_PrefixLine, "Chat To Send Data to (Prefix each line). For example: /g for group, /gu for guild, /tell Cedric, /tell funkmasterp"); #endregion //Tooltips #region Add Event Handlers this.nudSection1_MaxPlayers.ValueChanged += new System.EventHandler(this.Section_MaxPlayers_ValueChanged); this.nudSection1_MaxPlayers.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection1_PerPlayer.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection1_Header.LostFocus += new System.EventHandler(this.Section_LostFocus); this.nudSection1_MaxPlayers.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection1_PerPlayer.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection1_Header.TextChanged += new System.EventHandler(this.Section_TextChanged); this.chkSection1_Enabled.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.chkSection1_Unlimited.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.btnSection1_Delete.Click += new System.EventHandler(this.btnSection_Delete_Click); this.btnSection1_MoveUp.Click += new System.EventHandler(this.btnSection_MoveUp_Click); this.btnSection1_MoveDown.Click += new System.EventHandler(this.btnSection_MoveDown_Click); this.nudSection2_MaxPlayers.ValueChanged += new System.EventHandler(this.Section_MaxPlayers_ValueChanged); this.nudSection2_MaxPlayers.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection2_PerPlayer.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection2_Header.LostFocus += new System.EventHandler(this.Section_LostFocus); this.nudSection2_MaxPlayers.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection2_PerPlayer.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection2_Header.TextChanged += new System.EventHandler(this.Section_TextChanged); this.chkSection2_Enabled.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.chkSection2_Unlimited.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.btnSection2_Delete.Click += new System.EventHandler(this.btnSection_Delete_Click); this.btnSection2_MoveUp.Click += new System.EventHandler(this.btnSection_MoveUp_Click); this.btnSection2_MoveDown.Click += new System.EventHandler(this.btnSection_MoveDown_Click); this.nudSection3_MaxPlayers.ValueChanged += new System.EventHandler(this.Section_MaxPlayers_ValueChanged); this.nudSection3_MaxPlayers.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection3_PerPlayer.LostFocus += new System.EventHandler(this.Section_LostFocus); this.txtSection3_Header.LostFocus += new System.EventHandler(this.Section_LostFocus); this.nudSection3_MaxPlayers.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection3_PerPlayer.TextChanged += new System.EventHandler(this.Section_TextChanged); this.txtSection3_Header.TextChanged += new System.EventHandler(this.Section_TextChanged); this.chkSection3_Enabled.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.chkSection3_Unlimited.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.btnSection3_Delete.Click += new System.EventHandler(this.btnSection_Delete_Click); this.btnSection3_MoveUp.Click += new System.EventHandler(this.btnSection_MoveUp_Click); this.btnSection3_MoveDown.Click += new System.EventHandler(this.btnSection_MoveDown_Click); this.txtSection1_PerPlayer.DoubleClick += new System.EventHandler(this.Section_PerPlayer_dblClick); this.txtSection2_PerPlayer.DoubleClick += new System.EventHandler(this.Section_PerPlayer_dblClick); this.txtSection3_PerPlayer.DoubleClick += new System.EventHandler(this.Section_PerPlayer_dblClick); this.txtSection1_Header.DoubleClick += new System.EventHandler(this.Section_Header_dblClick); this.txtSection2_Header.DoubleClick += new System.EventHandler(this.Section_Header_dblClick); this.txtSection3_Header.DoubleClick += new System.EventHandler(this.Section_Header_dblClick); this.cboxSection1_SortBy.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.cboxSection1_PrefixLine.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.cboxSection2_SortBy.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.cboxSection2_PrefixLine.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.cboxSection3_SortBy.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.cboxSection3_PrefixLine.LostFocus += new System.EventHandler(this.Section_cBox_LostFocus); this.chkSection1_AlliesOnly.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.chkSection2_AlliesOnly.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.chkSection3_AlliesOnly.CheckedChanged += new System.EventHandler(this.Section_CheckedChanged); this.tvSections.MouseDown += new MouseEventHandler(this.tvSections_MouseDown); this.btnAddNewSection.Click += new System.EventHandler(this.btnAddNewSection_Click); this.txtExportToFile.LostFocus += new System.EventHandler(this.ExportToFile_LostFocus); #endregion //Add Event Handlers this.gbSection1.Visible = false; this.gbSection2.Visible = false; this.gbSection3.Visible = false; this.pnlMain.Controls.Add(this.gbSection3); this.pnlMain.Controls.Add(this.gbSection1); this.pnlMain.Controls.Add(this.gbExportSettings); this.pnlMain.Controls.Add(this.lblSections); this.pnlMain.Controls.Add(this.btnAddNewSection); this.pnlMain.Controls.Add(this.tvSections); this.pnlMain.Controls.Add(this.gbSection2); ((System.ComponentModel.ISupportInitialize)(this.nudSection2_MaxPlayers)).EndInit(); this.gbExportSettings.ResumeLayout(false); this.gbExportSettings.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudSection1_MaxPlayers)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSection3_MaxPlayers)).EndInit(); this.pnlMain.Location = new System.Drawing.Point(16, 9); this.pnlMain.Dock = DockStyle.Fill; tpScreen.Controls.Add(this.pnlMain); this.gbSection1.ResumeLayout(false); this.gbSection1.PerformLayout(); this.gbSection2.ResumeLayout(false); this.gbSection2.PerformLayout(); this.gbSection3.ResumeLayout(false); this.gbSection3.PerformLayout(); this.pnlMain.ResumeLayout(false); tpScreen.ResumeLayout(false); } #endregion //UI components #region IActPluginV1 Members public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { AllowSave = false; lblStatus = pluginStatusText; tpScreen = pluginScreenSpace; InitUI(); tpScreen.Controls.Add(pnlMain); lblStatus.Text = "Plugin started"; #region Act Event Handlers Attachment ActGlobals.oFormActMain.AfterCombatAction += new CombatActionDelegate(oFormActMain_AfterCombatAction); ActGlobals.oFormActMain.OnCombatEnd += new CombatToggleEventDelegate(oFormActMain_OnCombatEnd); #endregion //Act Event Handlers Attachment LoadXmlSettings(); AllowSave = true; } public void DeInitPlugin() { #region Act Event Handlers Detachment ActGlobals.oFormActMain.AfterCombatAction -= oFormActMain_AfterCombatAction; ActGlobals.oFormActMain.OnCombatEnd -= oFormActMain_OnCombatEnd; #endregion //Act Event Handlers Detachment SaveXmlSettings(); lblStatus.Text = "Plugin exited"; } #endregion //IActPluginV1 Members #region Functions And Events private void Allow_ValueLostTextCheck_Changed(bool isAllowed) { AllowValueChanged = isAllowed; AllowLostFocus = isAllowed; AllowTextChanged = isAllowed; AllowCheckedChanged = isAllowed; } #region ControlEvents private void Section_MaxPlayers_ValueChanged(object sender, EventArgs e) { if (AllowValueChanged == false) return; Allow_ValueLostTextCheck_Changed(false); SaveXmlSettings(); LoadXmlSettings(); Allow_ValueLostTextCheck_Changed(true); } private void Section_cBox_LostFocus(object sender, EventArgs e) { if (AllowLostFocus == false) return; Allow_ValueLostTextCheck_Changed(false); SaveXmlSettings(); LoadXmlSettings(); Allow_ValueLostTextCheck_Changed(true); } private void ExportToFile_LostFocus(object sender, EventArgs e) { SaveXmlSettings(); TextBox_LostFocus(sender, e); } private void Section_LostFocus(object sender, EventArgs e) { TextBox_LostFocus(sender, e); } private void TextBox_LostFocus(object sender, EventArgs e) { if (AllowLostFocus == false) return; Allow_ValueLostTextCheck_Changed(false); LoadXmlSettings(); Allow_ValueLostTextCheck_Changed(true); } private void Section_TextChanged(object sender, EventArgs e) { if (AllowTextChanged == false) return; Allow_ValueLostTextCheck_Changed(false); SaveXmlSettings(); Allow_ValueLostTextCheck_Changed(true); } private void Section_CheckedChanged(object sender, EventArgs e) { if (AllowCheckedChanged == false) return; Allow_ValueLostTextCheck_Changed(false); SaveXmlSettings(); LoadXmlSettings(); Allow_ValueLostTextCheck_Changed(true); } private void tvSections_MouseDown(object sender, MouseEventArgs e) { try { SelectNode(this.tvSections.GetNodeAt(e.X, e.Y).Name); } catch (System.Exception ex) { this.mocException = ex.ToString(); } } private void btnAddNewSection_Click(object sender, EventArgs e) { if (this.gbSection1.Visible == false) { LastSelectedSection = PrepSection( ref this.gbSection1, ref this.txtSection1_ID, ref this.chkSection1_Enabled, ref this.txtSection1_Header, ref this.txtSection1_PerPlayer, ref this.nudSection1_MaxPlayers, ref this.chkSection1_Unlimited, ref this.chkSection1_AlliesOnly, ref this.cboxSection1_SortBy, ref this.cboxSection1_PrefixLine ); this.txtSection1_Header.Text = "~~~Header Not Provided~~~"; } else if (this.gbSection2.Visible == false) { LastSelectedSection = PrepSection( ref this.gbSection2, ref this.txtSection2_ID, ref this.chkSection2_Enabled, ref this.txtSection2_Header, ref this.txtSection2_PerPlayer, ref this.nudSection2_MaxPlayers, ref this.chkSection2_Unlimited, ref this.chkSection2_AlliesOnly, ref this.cboxSection2_SortBy, ref this.cboxSection2_PrefixLine ); this.txtSection2_Header.Text = "~~~Header Not Provided~~~"; } else if (this.gbSection3.Visible == false) { LastSelectedSection = PrepSection( ref this.gbSection3, ref this.txtSection3_ID, ref this.chkSection3_Enabled, ref this.txtSection3_Header, ref this.txtSection3_PerPlayer, ref this.nudSection3_MaxPlayers, ref this.chkSection3_Unlimited, ref this.chkSection3_AlliesOnly, ref this.cboxSection3_SortBy, ref this.cboxSection3_PrefixLine ); this.txtSection3_Header.Text = "~~~Header Not Provided~~~"; } else //All Sections are Used, Create a New Section. { LastSelectedSection = InsertAndSelect_NewSection(); } SaveXmlSettings(); LoadXmlSettings(); } private void btnSection_Delete_Click(object sender, EventArgs e) { String Section_ID = ""; switch (((Button)sender).Name) { case "btnSection1_Delete": //this.btnSection1_Delete.Name: Section_ID = this.txtSection1_ID.Text; break; case "btnSection2_Delete": //this.btnSection2_Delete.Name: Section_ID = this.txtSection2_ID.Text; break; case "btnSection3_Delete": //this.btnSection3_Delete.Name: Section_ID = this.txtSection3_ID.Text; break; default: string error = "Error while attempting to Delete Section"; MessageBox.Show(error, "Delete Section Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; } this.LastSelectedSection = ""; DeleteSection(Section_ID); LoadXmlSettings(); } private void btnSection_MoveUp_Click(object sender, EventArgs e) { String Section_ID = ""; switch (((Button)sender).Name) { case "btnSection1_MoveUp": //this.btnSection1_MoveUp.Name: Section_ID = this.txtSection1_ID.Text; break; case "btnSection2_MoveUp": //this.btnSection2_MoveUp.Name: Section_ID = this.txtSection2_ID.Text; break; case "btnSection3_MoveUp": //this.btnSection3_MoveUp.Name: Section_ID = this.txtSection3_ID.Text; break; default: string error = "Error while attempting to MoveUp Section"; MessageBox.Show(error, "MoveUp Section Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; } MoveUpDownSection(Section_ID, true); LoadXmlSettings(); } private void btnSection_MoveDown_Click(object sender, EventArgs e) { String Section_ID = ""; switch (((Button)sender).Name) { case "btnSection1_MoveDown": //this.btnSection1_MoveDown.Name: Section_ID = this.txtSection1_ID.Text; break; case "btnSection2_MoveDown": //this.btnSection2_MoveDown.Name: Section_ID = this.txtSection2_ID.Text; break; case "btnSection3_MoveDown": //this.btnSection3_MoveDown.Name: Section_ID = this.txtSection3_ID.Text; break; default: string error = "Error while attempting to MoveDown Section"; MessageBox.Show(error, "MoveDown Section Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; } MoveUpDownSection(Section_ID, false); LoadXmlSettings(); } #endregion // Control Events private string PrepSection( ref GroupBox gbSection, ref TextBox txtSection_ID, ref CheckBox chkSection_Enabled, ref TextBox txtSection_Header, ref TextBox txtSection_PerPlayer, ref NumericUpDown nudSection_MaxPlayers, ref CheckBox chkSection_Unlimited, ref CheckBox chkSection_AlliesOnly, ref ComboBox cboxSection_SortBy, ref ComboBox cboxSection_PrefixLine ) { gbSection.Visible = true; txtSection_ID.Text = Guid.NewGuid().ToString(); chkSection_Enabled.Checked = false; nudSection_MaxPlayers.Value = 10; txtSection_PerPlayer.Text = ""; txtSection_Header.Text = ""; chkSection_Unlimited.Checked = false; chkSection_AlliesOnly.Checked = true; cboxSection_SortBy.Text = ""; cboxSection_PrefixLine.Text = ""; return txtSection_ID.Text; } #region XML private void DeleteSection(String Section_ID) { FileInfo file = new FileInfo(xmlFileName); if (file.Exists == false) return; XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); XmlNode RootNode = xml.DocumentElement; XmlNode SectionNode = RootNode.SelectSingleNode("descendant::Section[ID='" + Section_ID + "']"); try { this.LastSelectedSection = SectionNode.PreviousSibling.FirstChild.InnerText; } catch (System.Exception ex) { this.mocException = ex.Message.ToString(); } try { SectionNode.ParentNode.RemoveChild(SectionNode); } catch (System.Exception ex) { string error = "Unable to delete section."; MessageBox.Show(error, "Section Delete Failed.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); ActGlobals.oFormActMain.WriteExceptionLog(ex, error); } xml.Save(xmlFileName); ClearSettings(); } private void MoveUpDownSection(String Section_ID, Boolean MoveUp) { FileInfo file = new FileInfo(xmlFileName); if (file.Exists == false) return; XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); XmlNode RootNode = xml.DocumentElement; XmlNode SectionNode = RootNode.SelectSingleNode("descendant::Section[ID='" + Section_ID + "']"); try { if (MoveUp == false) { RootNode.SelectSingleNode("descendant::Sections").InsertAfter(SectionNode, SectionNode.NextSibling); } else { RootNode.SelectSingleNode("descendant::Sections").InsertBefore(SectionNode, SectionNode.PreviousSibling); } } catch (System.Exception ex) { string error = "Unable to move Section up/down."; MessageBox.Show(error, "Move Section Failed.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); ActGlobals.oFormActMain.WriteExceptionLog(ex, error); } try { if (MoveUp == false) { this.tvSections.SelectedNode = this.tvSections.Nodes[this.tvSections.SelectedNode.Index + 1]; } else { this.tvSections.SelectedNode = this.tvSections.Nodes[this.tvSections.SelectedNode.Index - 1]; } } catch (System.Exception ex) { this.mocException = ex.ToString(); } xml.Save(xmlFileName); ClearSettings(); this.LastSelectedSection = Section_ID; } private void LoadXmlSettings() { if (AllowLoad == false) return; AllowLoad = false; AllowSave = false; ClearSettings(); PrepSection( ref this.gbSection1, ref this.txtSection1_ID, ref this.chkSection1_Enabled, ref this.txtSection1_Header, ref this.txtSection1_PerPlayer, ref this.nudSection1_MaxPlayers, ref this.chkSection1_Unlimited, ref this.chkSection1_AlliesOnly, ref this.cboxSection1_SortBy, ref this.cboxSection1_PrefixLine ); PrepSection( ref this.gbSection2, ref this.txtSection2_ID, ref this.chkSection2_Enabled, ref this.txtSection2_Header, ref this.txtSection2_PerPlayer, ref this.nudSection2_MaxPlayers, ref this.chkSection2_Unlimited, ref this.chkSection2_AlliesOnly, ref this.cboxSection2_SortBy, ref this.cboxSection2_PrefixLine ); PrepSection( ref this.gbSection3, ref this.txtSection3_ID, ref this.chkSection3_Enabled, ref this.txtSection3_Header, ref this.txtSection3_PerPlayer, ref this.nudSection3_MaxPlayers, ref this.chkSection3_Unlimited, ref this.chkSection3_AlliesOnly, ref this.cboxSection3_SortBy, ref this.cboxSection3_PrefixLine ); this.tvSections.Nodes.Clear(); this.gbSection1.Visible = false; this.gbSection2.Visible = false; this.gbSection3.Visible = false; int sectionsUpdated = 0; FileInfo file = new FileInfo(xmlFileName); if (file.Exists == false) return; XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); // LOAD Without Save! XmlNode RootNode = xml.DocumentElement; try { foreach (XmlNode Setting in RootNode.SelectSingleNode("descendant::Settings")) { switch (Setting.Name) { case "ExportToFile": this.txtExportToFile.Text = Setting.InnerText; break; } } } catch (Exception ex) { this.mocException = ex.Message.ToString(); } foreach (XmlNode Section in RootNode.SelectSingleNode("descendant::Sections")) { Boolean SkipThis = false; if (sectionsUpdated == 0) { if(LastSelectedSection != "") { try { if (Section.NextSibling.InnerXml.Contains(LastSelectedSection) == false && Section.InnerXml.Contains(LastSelectedSection) == false) { SkipThis = true; try { String ThreeAheadExists = ""; // If there are not 3 nodes to do, SkipThis = false; ThreeAheadExists = Section.NextSibling.NextSibling.NextSibling.InnerText; } catch (Exception ex) { SkipThis = false; this.mocException = ex.ToString(); } } } catch (Exception ex) { this.mocException = ex.ToString(); } } } String Section_ID, Section_Enabled, Section_Header, Section_PerPlayer, Section_MaxPlayers, Section_Unlimited, Section_AlliesOnly, Section_SortBy, Section_PrefixLine; Section_ID = Guid.NewGuid().ToString(); Section_Enabled = ""; Section_Header = ""; Section_PerPlayer = ""; Section_MaxPlayers = ""; Section_Unlimited = ""; Section_AlliesOnly = ""; Section_SortBy = ""; Section_PrefixLine = ""; foreach (XmlNode SectionItem in Section.ChildNodes) { switch (SectionItem.Name) { case "ID": Section_ID = SectionItem.InnerText; break; case "Enabled": Section_Enabled = SectionItem.InnerText; break; case "Header": Section_Header = SectionItem.InnerText; break; case "PerPlayer": Section_PerPlayer = SectionItem.InnerText; break; case "MaxPlayers": Section_MaxPlayers = SectionItem.InnerText; break; case "Unlimited": Section_Unlimited = SectionItem.InnerText; break; case "AlliesOnly": Section_AlliesOnly = SectionItem.InnerText; break; case "SortBy": Section_SortBy = SectionItem.InnerText; break; case "PrefixLine": Section_PrefixLine = SectionItem.InnerText; Section_PrefixLine.Replace("/", ""); break; } } //if (this.tvSections.Nodes.IndexOfKey(Section_ID) == -1) //{ TreeNode tnSectionNode = new TreeNode(); tnSectionNode.Name = Section_ID; if (Section_Header == "") { tnSectionNode.Text = "~~~Header Not Provided~~~"; } else { tnSectionNode.Text = Section_Header; } if (Section_Enabled == "False") { tnSectionNode.Text = " (disabled)" + tnSectionNode.Text; } this.tvSections.Nodes.Add(tnSectionNode); //} if (Section_Enabled == "") Section_Enabled = "True"; if (Section_MaxPlayers == "") Section_Enabled = "10"; if (Section_Unlimited == "") Section_Unlimited = "True"; if (Section_AlliesOnly == "") Section_AlliesOnly = "True"; if (SkipThis == false) { if (sectionsUpdated == 2) { sectionsUpdated = 3; this.txtSection3_ID.Text = Section_ID; this.chkSection3_Enabled.Checked = Convert.ToBoolean(Section_Enabled); this.txtSection3_Header.Text = Section_Header; this.txtSection3_PerPlayer.Text = Section_PerPlayer; this.nudSection3_MaxPlayers.Value = Convert.ToInt16(Section_MaxPlayers); this.chkSection3_Unlimited.Checked = Convert.ToBoolean(Section_Unlimited); this.chkSection3_AlliesOnly.Checked = Convert.ToBoolean(Section_AlliesOnly); this.cboxSection3_SortBy.Text = Section_SortBy; this.cboxSection3_PrefixLine.Text = Section_PrefixLine; this.gbSection3.Visible = true; } if (sectionsUpdated == 1) { sectionsUpdated = 2; this.txtSection2_ID.Text = Section_ID; this.chkSection2_Enabled.Checked = Convert.ToBoolean(Section_Enabled); this.txtSection2_Header.Text = Section_Header; this.txtSection2_PerPlayer.Text = Section_PerPlayer; this.nudSection2_MaxPlayers.Value = Convert.ToInt16(Section_MaxPlayers); this.chkSection2_Unlimited.Checked = Convert.ToBoolean(Section_Unlimited); this.chkSection2_AlliesOnly.Checked = Convert.ToBoolean(Section_AlliesOnly); this.cboxSection2_SortBy.Text = Section_SortBy; this.cboxSection2_PrefixLine.Text = Section_PrefixLine; this.gbSection2.Visible = true; } if (sectionsUpdated == 0) { sectionsUpdated = 1; this.txtSection1_ID.Text = Section_ID; this.chkSection1_Enabled.Checked = Convert.ToBoolean(Section_Enabled); this.txtSection1_Header.Text = Section_Header; this.txtSection1_PerPlayer.Text = Section_PerPlayer; this.nudSection1_MaxPlayers.Value = Convert.ToInt16(Section_MaxPlayers); this.chkSection1_Unlimited.Checked = Convert.ToBoolean(Section_Unlimited); this.chkSection1_AlliesOnly.Checked = Convert.ToBoolean(Section_AlliesOnly); this.cboxSection1_SortBy.Text = Section_SortBy; this.cboxSection1_PrefixLine.Text = Section_PrefixLine; this.gbSection1.Visible = true; } if (LastSelectedSection != "") { foreach (TreeNode tn in this.tvSections.Nodes) { if (LastSelectedSection == tn.Name) { this.tvSections.SelectedNode = this.tvSections.Nodes[tn.Index]; } } } ColorGridBox_to_TreeView(); foreach (TreeNode tn in this.tvSections.Nodes) { if (this.txtSection1_ID.Text == tn.Name) { this.gbSection1.Text = "Section " + Convert.ToInt64(tn.Index + 1).ToString(); } else if (this.txtSection2_ID.Text == tn.Name) { this.gbSection2.Text = "Section " + Convert.ToInt64(tn.Index + 1).ToString(); } else if (this.txtSection3_ID.Text == tn.Name) { this.gbSection3.Text = "Section " + Convert.ToInt64(tn.Index + 1).ToString(); } } } } if (this.gbSection1.Visible == false) { } if (this.gbSection2.Visible == false) { } if (this.gbSection3.Visible == false) { } AllowLoad = true; AllowSave = true; } private void CloseFile() { FileStream fs; try { fs = System.IO.File.Open(xmlFileName, FileMode.OpenOrCreate, FileAccess.Read, FileShare.None); fs.Close(); } catch (System.IO.IOException ex) { this.mocException = ex.ToString(); } } private void CreateXmlSettings() { XmlTextWriter xml = new XmlTextWriter(xmlFileName, System.Text.Encoding.UTF8); xml.Formatting = Formatting.Indented; xml.Indentation = 4; xml.Namespaces = false; xml.WriteStartDocument(); xml.WriteStartElement("", "Config", ""); xml.WriteStartElement("", "Settings", ""); xml.WriteEndElement(); //Settings xml.WriteStartElement("", "Sections", ""); xml.WriteEndElement(); //Sections xml.WriteEndElement(); //Config xml.WriteEndDocument(); xml.Flush(); xml.Close(); } private void SaveXmlSettings() { if (AllowSave == false) return; AllowLoad = false; AllowSave = false; FileInfo file = new FileInfo(xmlFileName); if (file.Exists == false) { CreateXmlSettings(); } XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); XmlNode RootNode = xml.DocumentElement; XmlNode Section1Node, Section2Node, Section3Node; SaveXmlSettings_PBCSettings(ref xml); int nodeCount = 0; /* ---Section 1---- */ try { if (this.gbSection1.Visible == true) { Section1Node = RootNode.SelectSingleNode("descendant::Section[ID='" + this.txtSection1_ID.Text + "']"); nodeCount = Section1Node.ChildNodes.Count; UpdateSection(ref xml, ref Section1Node, ref this.txtSection1_ID, ref this.chkSection1_Enabled, ref this.txtSection1_Header, ref this.txtSection1_PerPlayer, ref this.nudSection1_MaxPlayers, ref this.chkSection1_Unlimited, ref this.chkSection1_AlliesOnly, ref this.cboxSection1_SortBy, ref this.cboxSection1_PrefixLine); } } catch (System.Exception ex) { AddSection(ref xml, RootNode.SelectSingleNode("descendant::Sections"), ref this.txtSection1_ID, ref this.chkSection1_Enabled, ref this.txtSection1_Header, ref this.txtSection1_PerPlayer, ref this.nudSection1_MaxPlayers, ref this.chkSection1_Unlimited, ref this.chkSection1_AlliesOnly, ref this.cboxSection1_SortBy, ref this.cboxSection1_PrefixLine, ex.Message.ToString()); } /* ---Section 2---- */ try { if (this.gbSection2.Visible == true) { Section2Node = RootNode.SelectSingleNode("descendant::Section[ID='" + this.txtSection2_ID.Text + "']"); nodeCount = Section2Node.ChildNodes.Count; UpdateSection(ref xml, ref Section2Node, ref this.txtSection2_ID, ref this.chkSection2_Enabled, ref this.txtSection2_Header, ref this.txtSection2_PerPlayer, ref this.nudSection2_MaxPlayers, ref this.chkSection2_Unlimited, ref this.chkSection2_AlliesOnly, ref this.cboxSection2_SortBy, ref this.cboxSection2_PrefixLine); } } catch (System.Exception ex) { AddSection(ref xml, RootNode.SelectSingleNode("descendant::Sections"), ref this.txtSection2_ID, ref this.chkSection2_Enabled, ref this.txtSection2_Header, ref this.txtSection2_PerPlayer, ref this.nudSection2_MaxPlayers, ref this.chkSection2_Unlimited, ref this.chkSection2_AlliesOnly, ref this.cboxSection2_SortBy, ref this.cboxSection2_PrefixLine, ex.Message.ToString()); } /* ---Section 3---- */ try { if (this.gbSection3.Visible == true) { Section3Node = RootNode.SelectSingleNode("descendant::Section[ID='" + this.txtSection3_ID.Text + "']"); nodeCount = Section3Node.ChildNodes.Count; UpdateSection(ref xml, ref Section3Node, ref this.txtSection3_ID, ref this.chkSection3_Enabled, ref this.txtSection3_Header, ref this.txtSection3_PerPlayer, ref this.nudSection3_MaxPlayers, ref this.chkSection3_Unlimited, ref this.chkSection3_AlliesOnly, ref this.cboxSection3_SortBy, ref this.cboxSection3_PrefixLine); } } catch (System.Exception ex) { AddSection(ref xml, RootNode.SelectSingleNode("descendant::Sections"), ref this.txtSection3_ID, ref this.chkSection3_Enabled, ref this.txtSection3_Header, ref this.txtSection3_PerPlayer, ref this.nudSection3_MaxPlayers, ref this.chkSection3_Unlimited, ref this.chkSection3_AlliesOnly, ref this.cboxSection3_SortBy, ref this.cboxSection3_PrefixLine, ex.Message.ToString()); } xml.Save(xmlFileName); AllowLoad = true; AllowSave = true; } private void SaveXmlSettings_PBCSettings(ref XmlDocument xml) { XmlNode RootNode = xml.DocumentElement; XmlNode PBCSettingsNode; Int32 nodeCount; try { PBCSettingsNode = RootNode.SelectSingleNode("descendant::Settings"); nodeCount = PBCSettingsNode.ChildNodes.Count; UpdateSettings(ref xml, ref PBCSettingsNode, ref this.txtExportToFile); } catch (System.Exception ex) { AddSetting(ref xml, RootNode.SelectSingleNode("descendant::Settings"), this.txtExportToFile.Text.ToString(), ex.Message.ToString()); } } private void AddSection( ref XmlDocument xml, XmlNode SectionsNode, ref TextBox txtSection_ID, ref CheckBox chkSection_Enabled, ref TextBox txtSection_Header, ref TextBox txtSection_PerPlayer, ref NumericUpDown nudSection_MaxPlayers, ref CheckBox chkSection_Unlimited, ref CheckBox chkSection_AlliesOnly, ref ComboBox cboxSection_SortBy, ref ComboBox cboxSection_PrefixLine, string ex ) { if (txtSection_ID.Text.ToString() == "") txtSection_ID.Text = Guid.NewGuid().ToString(); AddSection( ref xml, SectionsNode, txtSection_ID.Text.ToString(), chkSection_Enabled.Checked.ToString(), txtSection_Header.Text.ToString(), txtSection_PerPlayer.Text.ToString(), nudSection_MaxPlayers.Value.ToString(), chkSection_Unlimited.Checked.ToString(), chkSection_AlliesOnly.Checked.ToString(), cboxSection_SortBy.Text, cboxSection_PrefixLine.Text ); } private void AddSection( ref XmlDocument xml, XmlNode SectionsNode, String txtSection_ID, String chkSection_Enabled, String txtSection_Header, String txtSection_PerPlayer, String nudSection_MaxPlayers, String chkSection_Unlimited, String chkSection_AlliesOnly, String cboxSection_SortBy, String cboxSection_PrefixLine ) { if (txtSection_Header == "" && chkSection_Enabled == "False" && txtSection_PerPlayer == "" && nudSection_MaxPlayers == "10" && chkSection_Unlimited == "False" && chkSection_AlliesOnly == "True") return; try { XmlElement SectionNode = xml.CreateElement("Section"); XmlElement SectionNodeElement; if (txtSection_ID == "") return; SectionNodeElement = xml.CreateElement("ID"); SectionNodeElement.InnerText = txtSection_ID; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("Enabled"); SectionNodeElement.InnerText = chkSection_Enabled; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("Header"); SectionNodeElement.InnerText = txtSection_Header; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("PerPlayer"); SectionNodeElement.InnerText = txtSection_PerPlayer; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("MaxPlayers"); SectionNodeElement.InnerText = nudSection_MaxPlayers; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("Unlimited"); SectionNodeElement.InnerText = chkSection_Unlimited; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("AlliesOnly"); SectionNodeElement.InnerText = chkSection_AlliesOnly; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("SortBy"); SectionNodeElement.InnerText = cboxSection_SortBy; SectionNode.AppendChild(SectionNodeElement); SectionNodeElement = xml.CreateElement("PrefixLine"); SectionNodeElement.InnerText = cboxSection_SortBy; SectionNode.AppendChild(SectionNodeElement); SectionsNode.AppendChild(SectionNode); } catch (Exception ex) { this.mocException = ex.Message.ToString(); } } private void UpdateSection( ref XmlDocument xml, ref XmlNode SectionNode, ref TextBox txtSection_ID, ref CheckBox chkSection_Enabled, ref TextBox txtSection_Header, ref TextBox txtSection_PerPlayer, ref NumericUpDown nudSection_MaxPlayers, ref CheckBox chkSection_Unlimited, ref CheckBox chkSection_AlliesOnly, ref ComboBox cboxSection_SortBy, ref ComboBox cboxSection_PrefixLine ) { Boolean wasID = false, wasEnabled = false, wasHeader = false, wasPerPlayer = false, wasMaxPlayers = false, wasUnlimited = false, wasAlliesOnly = false, wasSortBy = false, wasPrefixLine = false; foreach (XmlElement SectionNodeItem in SectionNode.ChildNodes) { if (SectionNodeItem.Name == "ID") { SectionNodeItem.InnerText = txtSection_ID.Text.ToString(); wasID = true; } else if (SectionNodeItem.Name == "Enabled") { SectionNodeItem.InnerText = chkSection_Enabled.Checked.ToString(); wasEnabled = true; } else if (SectionNodeItem.Name == "Header") { SectionNodeItem.InnerText = txtSection_Header.Text.ToString(); wasHeader = true; } else if (SectionNodeItem.Name == "PerPlayer") { SectionNodeItem.InnerText = txtSection_PerPlayer.Text.ToString(); wasPerPlayer = true; } else if (SectionNodeItem.Name == "MaxPlayers") { SectionNodeItem.InnerText = nudSection_MaxPlayers.Value.ToString(); wasMaxPlayers = true; } else if (SectionNodeItem.Name == "Unlimited") { SectionNodeItem.InnerText = chkSection_Unlimited.Checked.ToString(); wasUnlimited = true; } else if (SectionNodeItem.Name == "AlliesOnly") { SectionNodeItem.InnerText = chkSection_AlliesOnly.Checked.ToString(); wasAlliesOnly = true; } else if (SectionNodeItem.Name == "SortBy") { SectionNodeItem.InnerText = cboxSection_SortBy.Text; wasSortBy = true; } else if (SectionNodeItem.Name == "PrefixLine") { SectionNodeItem.InnerText = cboxSection_PrefixLine.Text; wasPrefixLine = true; } } XmlNode newNode; if (wasID == false) { newNode = xml.CreateElement("ID"); newNode.InnerText = txtSection_ID.Text.ToString(); SectionNode.AppendChild(newNode); } if (wasEnabled == false) { newNode = xml.CreateElement("Enabled"); newNode.InnerText = chkSection_Enabled.Checked.ToString(); SectionNode.AppendChild(newNode); } if (wasHeader == false) { newNode = xml.CreateElement("Header"); newNode.InnerText = txtSection_Header.Text.ToString(); SectionNode.AppendChild(newNode); } if (wasPerPlayer == false) { newNode = xml.CreateElement("PerPlayer"); newNode.InnerText = txtSection_PerPlayer.Text.ToString(); SectionNode.AppendChild(newNode); } if (wasMaxPlayers == false) { newNode = xml.CreateElement("MaxPlayers"); newNode.InnerText = nudSection_MaxPlayers.Value.ToString(); SectionNode.AppendChild(newNode); } if (wasUnlimited == false) { newNode = xml.CreateElement("Unlimited"); newNode.InnerText = chkSection_Unlimited.Checked.ToString(); SectionNode.AppendChild(newNode); } if (wasAlliesOnly == false) { newNode = xml.CreateElement("AlliesOnly"); newNode.InnerText = chkSection_AlliesOnly.Checked.ToString(); SectionNode.AppendChild(newNode); } if (wasSortBy == false) { newNode = xml.CreateElement("SortBy"); newNode.InnerText = cboxSection_SortBy.Text.ToString(); SectionNode.AppendChild(newNode); } if (wasPrefixLine == false) { newNode = xml.CreateElement("PrefixLine"); newNode.InnerText = cboxSection_PrefixLine.Text.ToString(); SectionNode.AppendChild(newNode); } } private void UpdateSettings( ref XmlDocument xml, ref XmlNode SettingNode, ref TextBox txtExportToFile ) { Boolean wasExportFile = false; foreach (XmlElement SettingNodeItem in SettingNode.ChildNodes) { if (SettingNodeItem.Name == "ExportToFile") { SettingNodeItem.InnerText = txtExportToFile.Text.ToString(); wasExportFile = true; } } XmlNode newNode; if (wasExportFile == false) { newNode = xml.CreateElement("ExportToFile"); newNode.InnerText = txtExportToFile.Text.ToString(); SettingNode.AppendChild(newNode); } } private void AddSetting( ref XmlDocument xml, XmlNode SettingsNode, String txtExportToFile, String errorMessage ) { try { XmlElement SettingNode = xml.CreateElement("Settings"); XmlElement SettingNodeElement; SettingNodeElement = xml.CreateElement("ExportToFile"); SettingNodeElement.InnerText = txtExportToFile; SettingNode.AppendChild(SettingNodeElement); SettingsNode.AppendChild(SettingNode); } catch (Exception ex) { this.mocException = ex.Message.ToString(); } } #endregion //XML private void SelectNode(String Section_ID) { LastSelectedSection = Section_ID; AllowLoad = true; LoadXmlSettings(); AllowLoad = false; } private void ClearColors() { this.gbSection1.BackColor = System.Drawing.Color.Transparent; this.gbSection2.BackColor = System.Drawing.Color.Transparent; this.gbSection3.BackColor = System.Drawing.Color.Transparent; foreach (TreeNode tn in this.tvSections.Nodes) { tn.BackColor = System.Drawing.Color.Transparent; } } private void ColorGridBox_to_TreeView() { ClearColors(); if (this.tvSections.Nodes.Count > 0) { int NodeIndex = 0; try { NodeIndex = this.tvSections.SelectedNode.Index; } catch (System.Exception ex) { this.mocException = ex.ToString(); if (NodeIndex == 0) { if (tvSections.Nodes.Count == 1) { this.tvSections.SelectedNode = this.tvSections.Nodes[0]; } else { this.tvSections.SelectedNode = this.tvSections.Nodes[1]; } } } } if (this.txtSection2_ID.Text == this.tvSections.SelectedNode.Name) { this.gbSection2.BackColor = System.Drawing.Color.PaleVioletRed; } else if (this.txtSection1_ID.Text == this.tvSections.SelectedNode.Name) { this.gbSection1.BackColor = System.Drawing.Color.PaleVioletRed; } else if (this.txtSection3_ID.Text == this.tvSections.SelectedNode.Name) { this.gbSection3.BackColor = System.Drawing.Color.PaleVioletRed; } this.tvSections.SelectedNode.BackColor = System.Drawing.Color.PaleVioletRed; } private void ClearSettings() { this.tvSections.Nodes.Clear(); this.gbSection1.Visible = false; this.gbSection2.Visible = false; this.gbSection3.Visible = false; } private string InsertAndSelect_NewSection() { String sReturn = ""; String Section_ID = Guid.NewGuid().ToString(); try { XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); XmlNode RootNode = xml.DocumentElement; AddSection(ref xml, RootNode.SelectSingleNode("descendant::Sections"), Section_ID, "False", "====New Section Added===", "", "10", "False", "True", "", "" ); xml.Save(xmlFileName); sReturn = Section_ID; } catch (Exception ex) { this.mocException = ex.ToString(); } return sReturn; } #region Act Events void oFormActMain_AfterCombatAction(bool isImport, CombatActionEventArgs actionInfo) { //if (isImport) // return; //if (actionInfo.attacker == ActGlobals.charName && actionInfo.swingType == (int)SwingTypeEnum.Melee) //{ // if (DateTime.Now - lastAttackTime <= periodLimit && actionInfo.theAttackType == lastAttackType) // { // totalSingles--; // totalDoubles++; // if (rbBeepD.Checked) // { // System.Media.SystemSounds.Beep.Play(); // } // if (rbWavD.Checked) // { // ActGlobals.oFormActMain.PlaySound(txtSectionHeader.Text); // } // } // else // { // totalSingles++; // if (rbBeepS.Checked) // { // System.Media.SystemSounds.Beep.Play(); // } // if (rbWavS.Checked) // { // ActGlobals.oFormActMain.PlaySound(txtSectionHeader.Text); // } // } // lastAttackTime = DateTime.Now; // lastAttackType = actionInfo.theAttackType; // UpdateTotals(); } void oFormActMain_OnCombatEnd(bool isImport, CombatToggleEventArgs encounterInfo) { FileInfo file = new FileInfo(xmlFileName); if (file.Exists == false) return; if (isImport) return; if (encounterInfo.encounter.Parent.PopulateAll) { string export = ""; //string export = ActGlobals.oFormActMain.GetTextExport(encounterInfo.zoneDataIndex, 0, -1); XmlDocument xml = new XmlDocument(); xml.Load(xmlFileName); // LOAD Without Save! XmlNode RootNode = xml.DocumentElement; foreach (XmlNode Section in RootNode.SelectSingleNode("descendant::Sections")) { String Section_ID = "", Section_Enabled = "", Section_Header = "", Section_PerPlayer = "", Section_MaxPlayers = "", Section_Unlimited = "", Section_AlliesOnly = "", Section_SortBy = "", Section_PrefixLine = ""; String exportPerPlayer = ""; String Section_Header_PrepareParse = "", Section_PerPlayer_PrepareParse = "", Section_SortBy_PrepareParse = ""; foreach (XmlNode SectionItem in Section.ChildNodes) { switch (SectionItem.Name) { case "ID": Section_ID = SectionItem.InnerText; break; case "Enabled": Section_Enabled = SectionItem.InnerText; break; case "Header": Section_Header_PrepareParse = SectionItem.InnerText; break; case "PerPlayer": Section_PerPlayer_PrepareParse = SectionItem.InnerText; break; case "MaxPlayers": Section_MaxPlayers = SectionItem.InnerText; break; case "Unlimited": Section_Unlimited = SectionItem.InnerText; break; case "AlliesOnly": Section_AlliesOnly = SectionItem.InnerText; break; case "SortBy": Section_SortBy_PrepareParse = SectionItem.InnerText; if(Section_SortBy_PrepareParse == "===Damage===") Section_SortBy_PrepareParse = "{damage}"; if(Section_SortBy_PrepareParse == "===Healed===") Section_SortBy_PrepareParse = "{healed}"; if(Section_SortBy_PrepareParse == "===Hits===") Section_SortBy_PrepareParse = "{hits}"; if(Section_SortBy_PrepareParse == "===Misc===") Section_SortBy_PrepareParse = "{healstaken}"; if(Section_SortBy_PrepareParse == "===Name===") Section_SortBy_PrepareParse = "{name}"; break; case "PrefixLine": Section_PrefixLine = SectionItem.InnerText; break; } } if (Section_SortBy_PrepareParse.Trim() == "") Section_SortBy_PrepareParse = "{name}"; if (Section_Enabled == "True" && Section_PerPlayer_PrepareParse.Trim().Length > 0) { exportPerPlayer = ""; char[] splitDetailsStart = {'{'}, splitDetailsEnd = {'}'}; DataTable dt = new DataTable("PerPlayer_ForSorting"); DataColumn dc = new DataColumn(); #region Data Columns dc = new DataColumn(); dc.ColumnName = "Section_UseToSort"; dc.DataType = System.Type.GetType("System.String"); dt.Columns.Add(dc); dc = new DataColumn(); dc.ColumnName = "Section_PerPlayer"; dc.DataType = System.Type.GetType("System.String"); dt.Columns.Add(dc); dc = new DataColumn(); dc.ColumnName = "Section_UseToSort_Numbers"; dc.DataType = System.Type.GetType("System.Int64"); dt.Columns.Add(dc); dc = new DataColumn(); dc.ColumnName = "Section_UseToSort_Name"; dc.DataType = System.Type.GetType("System.String"); dt.Columns.Add(dc); #endregion //Data Columns DataRow dr; #region Section Header Parse Section_Header = Section_Header_PrepareParse; Section_Header_Format(ref Section_Header, "{n}", "\n" + SectionPrefixLine_Format(Section_PrefixLine)); Section_Header_Format(ref Section_Header, "{title}", encounterInfo.encounter.Title); //.Items[encounterItem.Key]..ToString()); Section_Header_Format(ref Section_Header, "{name}", encounterInfo.encounter.Title.ToString()); Section_Header_Format(ref Section_Header, "{ZoneName}", encounterInfo.encounter.ZoneName.ToString()); Section_Header_Format(ref Section_Header, "{duration}", encounterInfo.encounter.Duration.ToString()); Section_Header_Format(ref Section_Header, "{DURATION}", encounterInfo.encounter.DurationS.ToString()); //============================= Section_Header_Format(ref Section_Header, "{damage}", encounterInfo.encounter.Damage.ToString()); //Section_Header_Format(ref Section_Header, "{damage%}", encounterInfo.encounter.DamagePercent.ToString()); Section_Header_Format(ref Section_Header, "{dps}", encounterInfo.encounter.DPS.ToString()); Section_Header_Format(ref Section_Header, "{DPS}", encounterInfo.encounter.DPS.ToString()); //Section_Header_Format(ref Section_Header, "{extdps}", encounterInfo.encounter.ExtHPS.ToString()); //Section_Header_Format(ref Section_Header, "{EXTDPS}", encounterInfo.encounter.ExtDPS.ToString()); //============================= Section_Header_Format(ref Section_Header, "{hits}", encounterInfo.encounter.ToString()); //Section_Header_Format(ref Section_Header, "{crithits}", encounterInfo.encounter.CritHits.ToString()); //Section_Header_Format(ref Section_Header, "{misses}", encounterInfo.encounter.Misses.ToString()); //Section_Header_Format(ref Section_Header, "{hitfailed}", encounterInfo.encounter.Blocked.ToString()); //Section_Header_Format(ref Section_Header, "{swings}", encounterInfo.encounter.Swings.ToString()); //Section_Header_Format(ref Section_Header, "{tohit}", encounterInfo.encounter.ToHit.ToString()); //Section_Header_Format(ref Section_Header, "{TOHIT}", encounterInfo.encounter.ToHit.ToString()); Section_Header_Format(ref Section_Header, "{maxhit}", encounterInfo.encounter.GetMaxHit(true).ToString()); Section_Header_Format(ref Section_Header, "{MAXHIT}", encounterInfo.encounter.GetMaxHit(false)); //============================= Section_Header_Format(ref Section_Header, "{healed}", encounterInfo.encounter.Healed.ToString()); //Section_Header_Format(ref Section_Header, "{healed%}", encounterInfo.encounter.HealedPercent.ToString()); //Section_Header_Format(ref Section_Header, "{exthps}", encounterInfo.encounter.ExtHPS.ToString()); //Section_Header_Format(ref Section_Header, "{EXTHPS}", encounterInfo.encounter.ExtHPS.ToString()); //Section_Header_Format(ref Section_Header, "{critheals}", encounterInfo.encounter.CritHeals.ToString()); //Section_Header_Format(ref Section_Header, "{heals}", encounterInfo.encounter.Heals.ToString()); Section_Header_Format(ref Section_Header, "{maxheal}", encounterInfo.encounter.GetMaxHeal(true, false)); Section_Header_Format(ref Section_Header, "{MAXHEAL}", encounterInfo.encounter.GetMaxHeal(false, false)); Section_Header_Format(ref Section_Header, "{maxhealward}", encounterInfo.encounter.GetMaxHeal(true, true)); Section_Header_Format(ref Section_Header, "{MAXHEALWARD}", encounterInfo.encounter.GetMaxHeal(false, false)); //============================= //Section_Header_Format(ref Section_Header, "{healstaken}", encounterInfo.encounter.HealsTaken.ToString()); //Section_Header_Format(ref Section_Header, "{powerdrain}", encounterInfo.encounter.PowerDamage.ToString()); //Section_Header_Format(ref Section_Header, "{kills}", encounterInfo.encounter.Kills.ToString()); //Section_Header_Format(ref Section_Header, "{deaths}", encounterInfo.encounter.Deaths.ToString()); Section_Header_Format(ref Section_Header, "{date}", System.DateTime.Now.ToShortDateString().ToString()); Section_Header_Format(ref Section_Header, "{time}", System.DateTime.Now.ToShortTimeString().ToString()); Section_Header_Format(ref Section_Header, "{datetime}", System.DateTime.Now.ToString()); //============================= #endregion //Section Header Parse Boolean parseThisPerson = true; String gtc = ""; foreach (KeyValuePair encounterItem in encounterInfo.encounter.Items) { if (Section_AlliesOnly == "True") { switch (encounterInfo.encounter.Items[encounterItem.Key].GetCombatantType()) { case 0: parseThisPerson = false; break; case 4: parseThisPerson = true; break; default: //gtc = " Error(Unhandled GTC [" + gtc + "]) "; parseThisPerson = true; break; } } if (parseThisPerson == true) { Section_PerPlayer = Section_PerPlayer_PrepareParse; Section_SortBy = Section_SortBy_PrepareParse; // NOt sure here? gct 0 = enemy, 4 = ally? Section_PerPlayer += gtc; #region Replace Values with Actual Values/Events FormatSortBy(ref Section_SortBy); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{n}", "\n" + SectionPrefixLine_Format(Section_PrefixLine)); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{title}", encounterInfo.encounter.Title); //.Items[encounterItem.Key]..ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{ZoneName}", encounterInfo.encounter.ZoneName); //.Items[encounterItem.Key]..ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{name}", encounterInfo.encounter.Items[encounterItem.Key].Name.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{duration}", encounterInfo.encounter.Items[encounterItem.Key].Duration.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{DURATION}", encounterInfo.encounter.Items[encounterItem.Key].DurationS.ToString()); //============================= Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{damage}", encounterInfo.encounter.Items[encounterItem.Key].Damage.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{damage%}", encounterInfo.encounter.Items[encounterItem.Key].DamagePercent.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{dps}", encounterInfo.encounter.Items[encounterItem.Key].DPS.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{DPS}", encounterInfo.encounter.Items[encounterItem.Key].DPS.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{extdps}", encounterInfo.encounter.Items[encounterItem.Key].ExtDPS.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{EXTDPS}", encounterInfo.encounter.Items[encounterItem.Key].ExtDPS.ToString("0")); //============================= Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{hits}", encounterInfo.encounter.Items[encounterItem.Key].Hits.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{crithits}", encounterInfo.encounter.Items[encounterItem.Key].CritHits.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{misses}", encounterInfo.encounter.Items[encounterItem.Key].Misses.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{hitfailed}", encounterInfo.encounter.Items[encounterItem.Key].Blocked.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{swings}", encounterInfo.encounter.Items[encounterItem.Key].Swings.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{tohit}", encounterInfo.encounter.Items[encounterItem.Key].ToHit.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{TOHIT}", encounterInfo.encounter.Items[encounterItem.Key].ToHit.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{maxhit}", encounterInfo.encounter.Items[encounterItem.Key].GetMaxHit(true).ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{MAXHIT}", encounterInfo.encounter.Items[encounterItem.Key].GetMaxHit(false)); //============================= Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{healed}", encounterInfo.encounter.Items[encounterItem.Key].Healed.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{healed%}", encounterInfo.encounter.Items[encounterItem.Key].HealedPercent.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{exthps}", encounterInfo.encounter.Items[encounterItem.Key].ExtHPS.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{EXTHPS}", encounterInfo.encounter.Items[encounterItem.Key].ExtHPS.ToString("0")); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{critheals}", encounterInfo.encounter.Items[encounterItem.Key].CritHeals.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{heals}", encounterInfo.encounter.Items[encounterItem.Key].Heals.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{maxheal}", encounterInfo.encounter.Items[encounterItem.Key].GetMaxHeal(true, false)); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{MAXHEAL}", encounterInfo.encounter.Items[encounterItem.Key].GetMaxHeal(false, false)); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{maxhealward}", encounterInfo.encounter.GetMaxHeal(true, true)); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{MAXHEALWARD}", encounterInfo.encounter.GetMaxHeal(false, false)); //============================= Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{healstaken}", encounterInfo.encounter.Items[encounterItem.Key].HealsTaken.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{powerdrain}", encounterInfo.encounter.Items[encounterItem.Key].PowerDamage.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{kills}", encounterInfo.encounter.Items[encounterItem.Key].Kills.ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{deaths}", encounterInfo.encounter.Items[encounterItem.Key].Deaths.ToString()); //============================= Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{date}", System.DateTime.Now.ToShortDateString().ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{time}", System.DateTime.Now.ToShortTimeString().ToString()); Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{datetime}", System.DateTime.Now.ToString()); //============================= for (int i = 3; i <= 15; i++) { Section_PerPlayer_Format(ref Section_PerPlayer, ref Section_SortBy, "{NAME" + i.ToString() + "}", ReplaceName(encounterInfo.encounter.Items[encounterItem.Key].Name.ToString(), i)); } #endregion //Replace Values with Actual Values/Events dr = dt.NewRow(); dr["Section_UseToSort"] = Section_SortBy; dr["Section_PerPlayer"] = Section_PerPlayer; dr["Section_UseToSort_Name"] = encounterInfo.encounter.Items[encounterItem.Key].Name.ToString(); try { dr["Section_UseToSort_Numbers"] = Convert.ToInt64(Section_SortBy); } catch (Exception ex) { this.mocException = ex.ToString(); } dt.Rows.Add(dr); } } #region Sort switch (FormatSortBy(ref Section_SortBy_PrepareParse)) { case "{name}": case "===Name===": case "===Damage===": case "===Healed===": case "===Hits===": case "===Misc===": case "{NAME3}": case "{NAME4}": case "{NAME5}": case "{NAME6}": case "{NAME7}": case "{NAME8}": case "{NAME9}": case "{NAME10}": case "{NAME11}": case "{NAME12}": case "{NAME13}": case "{NAME14}": case "{NAME15}": case "{maxheal}": case "{MAXHEAL}": case "{maxhealward}": case "{MAXHEALWARD}": case "{maxhit}": case "{MAXHIT}": dt.DefaultView.Sort = "Section_UseToSort, Section_UseToSort_Name"; break; case "{damage}": case "{dps}": case "{DPS}": case "{extdps}": case "{EXTDPS}": case "{healed}": case "{exthps}": case "{EXTHPS}": case "{critheals}": case "{heals}": case "{hits}": case "{crithits}": case "{misses}": case "{kills}": case "{deaths}": dt.DefaultView.Sort = "Section_UseToSort_Numbers DESC, Section_UseToSort_Name"; break; case "{damage%}": case "{healed%}": case "{hitfailed}": case "{swings}": case "{tohit}": case "{TOHIT}": case "{healstaken}": case "{powerdrain}": dt.DefaultView.Sort = "Section_UseToSort_Numbers DESC, Section_UseToSort_Name"; break; default: dt.DefaultView.Sort = "Section_UseToSort DESC, Section_UseToSort_Name"; MessageBox.Show("Failed to Sort Properly: " + FormatSortBy(ref Section_SortBy_PrepareParse) + " - " + Section_SortBy_PrepareParse); break; } #endregion //Sort int PlayersPerformed = 1; foreach (DataRowView drv in dt.DefaultView) { if ((Convert.ToInt32(Section_MaxPlayers) >= Convert.ToInt32(PlayersPerformed)) || Section_Unlimited == "True") // Within the Max Players or Unlimited { //"\n" + SectionPrefixLine_Format(Section_PrefixLine) + exportPerPlayer += drv["Section_PerPlayer"].ToString(); //Section_PerPlayer; } PlayersPerformed++; } //exportPerPlayer = exportPerPlayer.Replace("\n", "\n" + SectionPrefixLine_Format(Section_PrefixLine)); if (export != "") export += "\n"; export += SectionPrefixLine_Format(Section_PrefixLine) + Section_Header + exportPerPlayer; } } //Export occurs here ActGlobals.oFormActMain.SendToMacroFile( this.txtExportToFile.Text.ToString(), //"ParseByCategory.txt", export, "" ); // NO Prefix Necessary: Handled by the Code (This will result in a space at the start of every line. However, eq2 seems to ignore this so it is fine. } } private String FormatSortBy(ref String Section_SortBy) { switch (Section_SortBy) { case "===Name===": case "{NAME3}": case "{NAME4}": case "{NAME5}": case "{NAME6}": case "{NAME7}": case "{NAME8}": case "{NAME9}": case "{NAME10}": case "{NAME11}": case "{NAME12}": case "{NAME13}": case "{NAME14}": case "{NAME15}": case "===Misc===": Section_SortBy = "{name}"; break; case "===Damage===": Section_SortBy = "{damage}"; break; case "===Healed===": Section_SortBy = "{Healed}"; break; case "===Hits===": Section_SortBy = "{hits}"; break; } return Section_SortBy; } private String SectionPrefixLine_Format(String Section_PrefixLine) { Section_PrefixLine = Section_PrefixLine.Trim(); Section_PrefixLine = Section_PrefixLine.Replace(" ", ""); Section_PrefixLine = Section_PrefixLine.Replace("/", ""); Section_PrefixLine = Section_PrefixLine.Replace("Group", "g"); Section_PrefixLine = Section_PrefixLine.Replace("Say", "s"); Section_PrefixLine = Section_PrefixLine.Replace("Raid", "ra"); Section_PrefixLine = Section_PrefixLine.Replace("Guild", "gu"); Section_PrefixLine = Section_PrefixLine.Replace("Channel ", ""); Section_PrefixLine = Section_PrefixLine.Replace("Channel", ""); Section_PrefixLine = Section_PrefixLine.Replace("tell {name}", "s"); Section_PrefixLine = Section_PrefixLine.Replace("tell Player", "s"); Section_PrefixLine = Section_PrefixLine.Replace("tell", "tell "); Section_PrefixLine += " "; return Section_PrefixLine; } private void Section_Header_Format(ref String Section_Header, String FindToReplace, String ReplaceWith) { Section_Format(ref Section_Header, FindToReplace, ReplaceWith); } private void Section_PerPlayer_Format(ref String Section_PerPlayer, ref String Section_SortBy, String FindToReplace, String ReplaceWith) { Section_Format(ref Section_PerPlayer, FindToReplace, ReplaceWith); Section_Format(ref Section_SortBy, FindToReplace, ReplaceWith); } private void Section_Format(ref String Section_Item, String FindToReplace, String ReplaceWith) { Section_Item = Section_Item.Replace(FindToReplace, ReplaceWith); } #endregion //Act Events #endregion //Functions And Events private string ReplaceName(String sName, int iLength) { String returnName = sName; try { returnName = sName.Substring(0, iLength); } catch(Exception ex) { this.mocException = ex.ToString(); } return returnName; } #region Handle ToolTip // Handles drawing the ToolTip. private void oToolTip_Draw(System.Object sender, System.Windows.Forms.DrawToolTipEventArgs e) { e.DrawBackground(); e.DrawBorder(); e.DrawText(); } #endregion //Handle ToolTip private Boolean AllowPerPlayerClick = true; private void Section_Header_dblClick(object sender, EventArgs e) { Section_HeaderPerPlayer_dblClick(sender, e); } private void Section_PerPlayer_dblClick(object sender, EventArgs e) { Section_HeaderPerPlayer_dblClick(sender, e); } private void Section_HeaderPerPlayer_dblClick(object sender, EventArgs e) { if (AllowPerPlayerClick == false) return; AllowPerPlayerClick = false; System.Windows.Forms.Form frmPop = new System.Windows.Forms.Form(); InitPopSelector(frmPop, (TextBox)sender); AllowPerPlayerClick = true; } #region PopUp Section Parse Generator #region Pop Selector Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitPopSelector(System.Windows.Forms.Form frmPop, TextBox txtPerPlayer) { this.dgParseItems = new System.Windows.Forms.DataGridView(); this.gbAvailableFormattingElements = new System.Windows.Forms.GroupBox(); this.lboxAvailableFormattingElements = new System.Windows.Forms.ListBox(); this.gbFormattingElementDescription = new System.Windows.Forms.GroupBox(); this.txtFormattingElementDescription = new System.Windows.Forms.TextBox(); this.gbFormattingExample = new System.Windows.Forms.GroupBox(); this.txtFormattingExample = new System.Windows.Forms.TextBox(); this.gbCustomText = new System.Windows.Forms.GroupBox(); this.txtCustomText = new System.Windows.Forms.TextBox(); this.btnAppend = new System.Windows.Forms.Button(); this.btnRemove = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dgParseItems)).BeginInit(); this.gbAvailableFormattingElements.SuspendLayout(); this.gbFormattingElementDescription.SuspendLayout(); this.gbFormattingExample.SuspendLayout(); this.gbCustomText.SuspendLayout(); frmPop.SuspendLayout(); // // dgParseItems // this.dgParseItems.AllowUserToAddRows = false; this.dgParseItems.AllowUserToDeleteRows = false; this.dgParseItems.AllowUserToOrderColumns = true; this.dgParseItems.AllowUserToResizeColumns = false; this.dgParseItems.AllowUserToResizeRows = false; this.dgParseItems.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgParseItems.ColumnHeadersVisible = true; this.dgParseItems.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgParseItems.Location = new System.Drawing.Point(4, 2); this.dgParseItems.Margin = new System.Windows.Forms.Padding(0); this.dgParseItems.MultiSelect = false; this.dgParseItems.Name = "dgParseItems"; this.dgParseItems.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.dgParseItems.Size = new System.Drawing.Size(450, 65); this.dgParseItems.TabIndex = 0; // // gbAvailableFormattingElements // this.gbAvailableFormattingElements.Controls.Add(this.lboxAvailableFormattingElements); this.gbAvailableFormattingElements.Controls.Add(this.btnAppend); this.gbAvailableFormattingElements.Location = new System.Drawing.Point(4, 71); this.gbAvailableFormattingElements.Name = "gbAvailableFormattingElements"; this.gbAvailableFormattingElements.Size = new System.Drawing.Size(208, 496); this.gbAvailableFormattingElements.TabIndex = 2; this.gbAvailableFormattingElements.TabStop = false; this.gbAvailableFormattingElements.Text = "Available Formatting Elements"; // // lboxAvailableFormattingElements // this.lboxAvailableFormattingElements.FormattingEnabled = true; this.lboxAvailableFormattingElements.Items.AddRange(new object[] { "custom text", "{n}", "{title}", "{name}", "{duration}", "{DURATION}", "===Damage===", "{damage}", "{damage%}", "{dps}", "{DPS}", "{extdps}", "{EXTDPS}", "===Healed===", "{healed}", "{healed%}", "{exthps}", "{EXTHPS}", "{critheals}", "{heals}", "{maxheal}", "{MAXHEAL}", "{maxhealward}", "{MAXHEALWARD}", "===Hits===", "{hits}", "{crithits}", "{misses}", "{hitfailed}", "{swings}", "{tohit}", "{TOHIT}", "{maxhit}", "{MAXHIT}", "===Misc===", "{healstaken}", "{powerdrain}", "{kills}", "{deaths}", "===Name===", "{NAME3}", "{NAME4}", "{NAME5}", "{NAME6}", "{NAME7}", "{NAME8}", "{NAME9}", "{NAME10}", "{NAME11}", "{NAME12}", "{NAME13}", "{NAME14}", "{NAME15}"}); this.lboxAvailableFormattingElements.Location = new System.Drawing.Point(6, 44); this.lboxAvailableFormattingElements.Name = "lboxAvailableFormattingElements"; this.lboxAvailableFormattingElements.Size = new System.Drawing.Size(195, 446); this.lboxAvailableFormattingElements.TabIndex = 2; // // btnAppend // this.btnAppend.Location = new System.Drawing.Point(6, 19); this.btnAppend.Name = "btnAppend"; this.btnAppend.Size = new System.Drawing.Size(195, 23); this.btnAppend.TabIndex = 7; this.btnAppend.Text = "Append Selected Available Element"; this.btnAppend.UseVisualStyleBackColor = true; // // gbFormattingElementDescription // this.gbFormattingElementDescription.Controls.Add(this.txtFormattingElementDescription); this.gbFormattingElementDescription.Location = new System.Drawing.Point(218, 115); this.gbFormattingElementDescription.Name = "gbFormattingElementDescription"; this.gbFormattingElementDescription.Size = new System.Drawing.Size(321, 162); this.gbFormattingElementDescription.TabIndex = 3; this.gbFormattingElementDescription.TabStop = false; this.gbFormattingElementDescription.Text = "Formatting Element Description"; // // txtFormattingElementDescription // this.txtFormattingElementDescription.Location = new System.Drawing.Point(6, 19); this.txtFormattingElementDescription.Multiline = true; this.txtFormattingElementDescription.Name = "txtFormattingElementDescription"; this.txtFormattingElementDescription.ReadOnly = true; this.txtFormattingElementDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.txtFormattingElementDescription.Size = new System.Drawing.Size(309, 137); this.txtFormattingElementDescription.TabIndex = 0; // // gbFormattingExample // this.gbFormattingExample.Controls.Add(this.txtFormattingExample); this.gbFormattingExample.Location = new System.Drawing.Point(218, 283); this.gbFormattingExample.Name = "gbFormattingExample"; this.gbFormattingExample.Size = new System.Drawing.Size(321, 284); this.gbFormattingExample.TabIndex = 4; this.gbFormattingExample.TabStop = false; this.gbFormattingExample.Text = "Formatting Example"; // // txtFormattingExample // this.txtFormattingExample.Location = new System.Drawing.Point(6, 19); this.txtFormattingExample.Multiline = true; this.txtFormattingExample.Name = "txtFormattingExample"; this.txtFormattingExample.ReadOnly = true; this.txtFormattingExample.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.txtFormattingExample.Size = new System.Drawing.Size(309, 259); this.txtFormattingExample.TabIndex = 0; // // gbCustomText // this.gbCustomText.Controls.Add(this.txtCustomText); this.gbCustomText.Location = new System.Drawing.Point(218, 70); this.gbCustomText.Name = "gbCustomText"; this.gbCustomText.Size = new System.Drawing.Size(321, 39); this.gbCustomText.TabIndex = 6; this.gbCustomText.TabStop = false; this.gbCustomText.Text = "Custom Text"; // // txtCustomText // this.txtCustomText.Location = new System.Drawing.Point(6, 15); this.txtCustomText.Name = "txtCustomText"; this.txtCustomText.Size = new System.Drawing.Size(307, 20); this.txtCustomText.TabIndex = 7; // // btnRemove // this.btnRemove.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnRemove.Location = new System.Drawing.Point(457, 2); this.btnRemove.Margin = new System.Windows.Forms.Padding(0); this.btnRemove.Name = "btnRemove"; this.btnRemove.Size = new System.Drawing.Size(82, 50); this.btnRemove.TabIndex = 8; this.btnRemove.Text = "Remove Selected Column"; this.btnRemove.UseVisualStyleBackColor = true; // // PrefixGenerator // frmPop.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); frmPop.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; frmPop.ClientSize = new System.Drawing.Size(542, 573); frmPop.Controls.Add(this.btnRemove); frmPop.Controls.Add(this.gbCustomText); frmPop.Controls.Add(this.gbFormattingExample); frmPop.Controls.Add(this.gbFormattingElementDescription); frmPop.Controls.Add(this.gbAvailableFormattingElements); frmPop.Controls.Add(this.dgParseItems); frmPop.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; frmPop.Name = "PrefixGenerator"; frmPop.Text = "(Per Player) Prefix Creator"; #region frmPop Event Handlers //frmPop.window += new EventHandler(this.frmPop_Close); this.lboxAvailableFormattingElements.SelectedIndexChanged += new EventHandler(this.frmPop_lboxAvailableFormattingElements_SelectedIndexChanged); this.dgParseItems.SelectionChanged += new EventHandler(this.dgParseItems_SelectionChanged); this.txtCustomText.Click += new EventHandler(this.txtCustomText_Click); this.btnAppend.Click += new EventHandler(this.btnAppend_Click); this.btnRemove.Click += new EventHandler(this.btnRemove_Click); #endregion //frmPop Event Handlers ((System.ComponentModel.ISupportInitialize)(this.dgParseItems)).EndInit(); this.gbAvailableFormattingElements.ResumeLayout(false); this.gbFormattingElementDescription.ResumeLayout(false); this.gbFormattingElementDescription.PerformLayout(); this.gbFormattingExample.ResumeLayout(false); this.gbFormattingExample.PerformLayout(); String SectionRow = ""; System.Windows.Forms.DataGridViewTextBoxColumn dgvTBC; foreach(String SectionColumn in txtPerPlayer.Text.ToString().Split(new char[] {'}'})) { if (SectionColumn != "") { String sColumn = SectionColumn; sColumn = sColumn.Replace(" ", "\u00A0"); // Non Breaking Space dgvTBC = new System.Windows.Forms.DataGridViewTextBoxColumn(); dgvTBC.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dgvTBC.SortMode = DataGridViewColumnSortMode.NotSortable; if (SectionRow != "") { SectionRow += ";"; } if (sColumn.Contains("{")) { String[] sColumn_Split = sColumn.Split(new char[] { '{' }); if (sColumn_Split[0] != "") { #region Split For Break System.Windows.Forms.DataGridViewTextBoxColumn dgvTBC_ForCat = new System.Windows.Forms.DataGridViewTextBoxColumn(); dgvTBC_ForCat.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dgvTBC_ForCat.SortMode = DataGridViewColumnSortMode.NotSortable; dgvTBC_ForCat.Name = sColumn_Split[0]; SectionRow += sColumn_Split[0] + ";"; this.dgParseItems.Columns.Add(dgvTBC_ForCat); #endregion Split For Break SectionRow += "{" + sColumn_Split[1]; dgvTBC.Name = "{" + sColumn_Split[1]; } else { SectionRow += sColumn; dgvTBC.Name = sColumn; } SectionRow += "}"; dgvTBC.Name += "}"; } else { SectionRow += sColumn; dgvTBC.Name = sColumn; } this.dgParseItems.Columns.Add(dgvTBC); } } this.dgParseItems.Rows.Add(SectionRow.Split(new char[] { ';' })); //this.dgParseItems.Rows[0].Height = 0; txtPopped_frmPop = txtPerPlayer; frmPop.ShowDialog(); frmPop_Close(txtPerPlayer); } private System.Windows.Forms.DataGridView dgParseItems; private System.Windows.Forms.GroupBox gbAvailableFormattingElements; private System.Windows.Forms.ListBox lboxAvailableFormattingElements; private System.Windows.Forms.GroupBox gbFormattingElementDescription; private System.Windows.Forms.TextBox txtFormattingElementDescription; private System.Windows.Forms.GroupBox gbFormattingExample; private System.Windows.Forms.TextBox txtFormattingExample; private System.Windows.Forms.GroupBox gbCustomText; private System.Windows.Forms.TextBox txtCustomText; private System.Windows.Forms.Button btnAppend; private System.Windows.Forms.Button btnRemove; #endregion //Form Designer generated code Pop Selector private void frmPop_Close(TextBox txtPerPlayer) { txtPerPlayer.Text = ""; String sPerPlayer = ""; DataTable dt = new DataTable("PerPlayer"); dt.Columns.Add(new DataColumn("DisplayOrder")); dt.Columns.Add(new DataColumn("ItemName")); DataRow dr; foreach (DataGridViewTextBoxColumn dgvTBC in this.dgParseItems.Columns) { dr = dt.NewRow(); dr["DisplayOrder"] = dgvTBC.DisplayIndex; dr["ItemName"] = dgvTBC.Name.Replace("\u00A0", " "); dt.Rows.Add(dr); } dt.DefaultView.Sort = "DisplayOrder"; foreach (DataRowView drv in dt.DefaultView) { sPerPlayer += drv["ItemName"]; } txtPerPlayer.Text = sPerPlayer; } private void frmPop_lboxAvailableFormattingElements_SelectedIndexChanged(Object sender, EventArgs ex) { String FormattingElementDescription = ""; switch (lboxAvailableFormattingElements.SelectedItem.ToString()) { case "{n}": FormattingElementDescription = "New Line Entry"; break; case "{title}": FormattingElementDescription = "Title for the Encounter"; break; case "{ZoneName}": FormattingElementDescription = "Zone name the Encounter Occured In"; break; case "{name}": FormattingElementDescription = "Name of the Participant"; break; case "{duration}": FormattingElementDescription = "Duration of the Battle"; break; case "{DURATION}": FormattingElementDescription = "Duration of the Battle"; break; case "===Damage===": FormattingElementDescription = "Damage Done/Occured During Battle"; break; case "{damage}": FormattingElementDescription = "Damage Done/Occured During Battle"; break; case "{damage%}": FormattingElementDescription = "% of Damage total Damage Delt"; break; case "{dps}": FormattingElementDescription = "Damage Per Second"; break; case "{DPS}": FormattingElementDescription = "Damage Per Second"; break; case "{extdps}": FormattingElementDescription = "Extended Damage Per Second"; break; case "{EXTDPS}": FormattingElementDescription = "Extended Damage Per Second"; break; case "===Healed===": FormattingElementDescription = "Amount Healed"; break; case "{healed}": FormattingElementDescription = "Amount Healed"; break; case "{healed%}": FormattingElementDescription = "% of Total Healed"; break; case "{exthps}": FormattingElementDescription = "Heals per Second"; break; case "{EXTHPS}": FormattingElementDescription = "Heals per Second"; break; case "{critheals}": FormattingElementDescription = "Number of Critical Heals"; break; case "{heals}": FormattingElementDescription = "total heals"; break; case "{maxheal}": FormattingElementDescription = "Biggest Heal (excluding Wards)"; break; case "{MAXHEAL}": FormattingElementDescription = "Biggest Heal (excluding Wards)"; break; case "{maxhealward}": FormattingElementDescription = "Biggest Heal (including Wards)"; break; case "{MAXHEALWARD}": FormattingElementDescription = "Biggest Heal (including Wards)"; break; case "===Hits===": FormattingElementDescription = "Number of Hits"; break; case "{hits}": FormattingElementDescription = "Number of Hits"; break; case "{crithits}": FormattingElementDescription = "Number of Critical Hits"; break; case "{misses}": FormattingElementDescription = "Number of Misses"; break; case "{hitfailed}": FormattingElementDescription = "Hits that Failed"; break; case "{swings}": FormattingElementDescription = "Number of Swings to hit"; break; case "{tohit}": FormattingElementDescription = "To Hit"; break; case "{TOHIT}": FormattingElementDescription = "To Hit"; break; case "{maxhit}": FormattingElementDescription = "Biggest Melee Hit"; break; case "{MAXHIT}": FormattingElementDescription = "Biggest Melee Hit"; break; case "===Misc===": FormattingElementDescription = "Hits Taken /Misc Items"; break; case "{healstaken}": FormattingElementDescription = "Hits Taken"; break; case "{powerdrain}": FormattingElementDescription = "Amount of Power Drained"; break; case "{kills}": FormattingElementDescription = "Total Kills"; break; case "{deaths}": FormattingElementDescription = "Total Deaths"; break; case "===Name===": FormattingElementDescription = "Character Name"; break; case "{NAME3}": FormattingElementDescription = "Character Name"; break; case "{NAME4}": FormattingElementDescription = "Character Name"; break; case "{NAME5}": FormattingElementDescription = "Character Name"; break; case "{NAME6}": FormattingElementDescription = "Character Name"; break; case "{NAME7}": FormattingElementDescription = "Character Name"; break; case "{NAME8}": FormattingElementDescription = "Character Name"; break; case "{NAME9}": FormattingElementDescription = "Character Name"; break; case "{NAME10}": FormattingElementDescription = "Character Name"; break; case "{NAME11}": FormattingElementDescription = "Character Name"; break; case "{NAME12}": FormattingElementDescription = "Character Name"; break; case "{NAME13}": FormattingElementDescription = "Character Name"; break; case "{NAME14}": FormattingElementDescription = "Character Name"; break; case "{NAME15}": FormattingElementDescription = "Character Name"; break; case "custom text": FormattingElementDescription = "Custom Text that you provide"; break; default: //case "custom text": //FormattingElementDescription break; } this.txtFormattingElementDescription.Text = FormattingElementDescription; if (lboxAvailableFormattingElements.SelectedItem.ToString() == "custom text") { this.txtCustomText.Enabled = true; } else { this.txtCustomText.Enabled = false; } } Boolean wasCustomText_Click = false; private void txtCustomText_Click(Object sender, EventArgs e) { if (wasCustomText_Click != false) return; wasCustomText_Click = true; this.lboxAvailableFormattingElements.SelectedIndex = this.lboxAvailableFormattingElements.FindStringExact("custom text"); wasCustomText_Click = false; } Boolean wasAppendRemove_Click = false; private void btnAppend_Click(Object sender, EventArgs e) { if (wasAppendRemove_Click != false) return; wasAppendRemove_Click = true; try { this.dgParseItems.Columns.Add(this.lboxAvailableFormattingElements.SelectedItem.ToString(),this.lboxAvailableFormattingElements.SelectedItem.ToString()); this.dgParseItems.Rows[0].Cells[this.dgParseItems.Rows[0].Cells.Count - 1].Value = this.lboxAvailableFormattingElements.SelectedItem.ToString(); } catch (Exception ex) { this.mocException = ex.ToString(); } try { this.dgParseItems.Rows[0].Cells[this.dgParseItems.Rows[0].Cells.Count - 1].Selected = true; } catch (Exception ex) { this.mocException = ex.ToString(); } wasAppendRemove_Click = false; } private void btnRemove_Click(Object sender, EventArgs e) { if (wasAppendRemove_Click != false) return; wasAppendRemove_Click = true; int wasSelected = 0; try { wasSelected = this.dgParseItems.Columns[this.dgParseItems.SelectedCells[0].ColumnIndex].Index; this.dgParseItems.Columns.Remove(this.dgParseItems.Columns[this.dgParseItems.SelectedCells[0].ColumnIndex]); } catch (Exception ex) { this.mocException = ex.ToString(); } try { this.dgParseItems.Rows[0].Cells[wasSelected -1].Selected = true; } catch (Exception ex) { this.mocException = ex.ToString(); try { this.dgParseItems.Rows[0].Cells[0].Selected = true; } catch (Exception exZero) { this.mocException = exZero.ToString(); } } wasAppendRemove_Click = false; } Boolean wasParseItemsSelectionChanged = false; private void dgParseItems_SelectionChanged(Object sender, EventArgs e) { if (wasParseItemsSelectionChanged != false) return; wasParseItemsSelectionChanged = true; try { this.lboxAvailableFormattingElements.SelectedIndex = this.lboxAvailableFormattingElements.FindStringExact(((DataGridView)sender).CurrentCell.Value.ToString()); this.txtCustomText.Text = ""; } catch (Exception ex) { this.lboxAvailableFormattingElements.SelectedIndex = this.lboxAvailableFormattingElements.FindStringExact("custom text"); this.txtCustomText.Text = ((DataGridView)sender).CurrentCell.Value.ToString(); this.mocException = ex.ToString(); } wasParseItemsSelectionChanged = false; } #endregion //PopUp Section Parse Generator } }