public void StopRenaming(bool save) { if (m_textBox != null) { if (m_textBox.Text != PermanentText) { if (save) { var newPath = File.Parent.FullName + Path.DirectorySeparatorChar + m_textBox.Text; Rename(File, newPath); } } m_textBox.Dispose(); m_textBox = null; } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { m_textBox.Dispose(); } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
void ReleaseDesignerOutlets() { if (MyTextBox != null) { MyTextBox.Dispose(); MyTextBox = null; } if (PhoneNumber != null) { PhoneNumber.Dispose(); PhoneNumber = null; } }