private void Click(object sender, EventArgs e) { if (!LoggingAccept(sender)) { return; } string temp = ""; Type type = sender.GetType(); if (type == typeof(Button)) { Button control = (Button)sender; temp = "\"" + control.Name + "\""; } else if (type == typeof(ToolStripButton)) { ToolStripButton control = (ToolStripButton)sender; temp = "\"" + control.Name + "\""; } temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
private void ValueChanged(object sender, EventArgs e) { if (!LoggingAccept(sender)) { return; } string temp = ""; Type type = sender.GetType(); if (type == typeof(NumericUpDown)) { NumericUpDown control = (NumericUpDown)sender; temp = "\"" + control.Name + "\" | "; temp += "Value = " + control.Value; } else if (type == typeof(ToolStripNumericUpDown)) { ToolStripNumericUpDown control = (ToolStripNumericUpDown)sender; temp = "\"" + control.Name + "\" | "; temp += "Value = " + control.Value; } temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
private void TextChanged(object sender, EventArgs e) { if (!LoggingAccept(sender)) { return; } string temp = ""; Type type = sender.GetType(); if (type == typeof(RichTextBox)) { RichTextBox control = (RichTextBox)sender; string text = control.Text; temp += "\"" + control.Name + "\" | "; temp += "Text = \"" + text.Substring(0, Math.Min(30, text.Length)); if (text.Length > 30) { temp += "..."; } } else if (type == typeof(TextBox)) { TextBox control = (TextBox)sender; string text = control.Text; temp += "\"" + control.Name + "\" | "; temp += "Text = \"" + text.Substring(0, Math.Min(30, text.Length)); if (text.Length > 30) { temp += "..."; } } else if (type == typeof(ToolStripTextBox)) { ToolStripTextBox control = (ToolStripTextBox)sender; string text = control.Text; temp += "\"" + control.Name + "\" | "; temp += "Text = \"" + text.Substring(0, Math.Min(30, text.Length)); if (text.Length > 30) { temp += "..."; } } temp += "\""; temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
private void SelectedIndexChanged(object sender, EventArgs e) { if (!LoggingAccept(sender)) { return; } string temp = ""; Type type = sender.GetType(); if (type == typeof(ComboBox)) { ComboBox control = (ComboBox)sender; temp += "\"" + control.Name + "\" | "; temp += "SelectedIndex = " + control.SelectedIndex; } else if (type == typeof(ToolStripComboBox)) { ToolStripComboBox control = (ToolStripComboBox)sender; temp += "\"" + control.Name + "\" | "; temp += "SelectedIndex = " + control.SelectedIndex; } else if (type == typeof(CheckedListBox) || type == typeof(NewCheckedListBox)) { CheckedListBox control = (CheckedListBox)sender; temp += "\"" + control.Name + "\" | "; if (control.SelectedItem == null) { return; } temp += "\"" + control.SelectedItem.ToString().Trim() + "\" = "; temp += control.GetItemChecked(control.SelectedIndex); } else if (type == typeof(ListBox) || type == typeof(NewListBox)) { ListBox control = (ListBox)sender; temp += "\"" + control.Name + "\" | "; if (control.SelectedItem == null) { return; } temp += "\"" + control.SelectedItem.ToString().Trim(); } temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
// event handlers private void CheckedChanged(object sender, EventArgs e) { if (!LoggingAccept(sender)) { return; } CheckBox control = (CheckBox)sender; string temp = "\"" + control.Name + "\" | "; temp += "Checked = " + control.Checked; temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
private void MouseDown(object sender, MouseEventArgs e) { if (!LoggingAccept(sender)) { return; } mouseDownControl = true; Control control = (Control)sender; string temp = "\"" + control.Name + "\" | "; temp += "MouseDown = (X:" + e.X + ",Y:" + e.Y + ")"; temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
// constructor public History(NewForm form) { this.form = form; if (form.Name == "Editor") { Do.AddHistory("LOADED LAZY SHELL APPLICATION"); } else if (form.Name != "SpritePartitions" && form.Name != "PaletteEditor" && form.Name != "GraphicEditor" && form.Name != "TileEditor" && form.Name != "NPCEditor") { Do.AddHistory("OPENED FORM \"" + form.Name + "\""); } this.form.FormClosed += new FormClosedEventHandler(FormClosed); foreach (Control control in form.Controls) { SetEventHandler(control); } }
private void NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (!LoggingAccept(sender)) { return; } TreeView control = (TreeView)sender; string text = e.Node.Text; string temp = "\"" + control.Name + "\" | "; temp += "\"" + text.Substring(0, Math.Min(30, text.Length)); if (text.Length > 30) { temp += "..."; } temp += "\""; temp += " | Form \"" + form.Name + "\""; AddElementIndex(ref temp); // Do.AddHistory(temp); dateTime = DateTime.Now; }
private void FormClosed(object sender, FormClosedEventArgs e) { Do.AddHistory("CLOSED FORM \"" + form.Name + "\""); LAZYSHELL.Properties.Settings.Default.Save(); }