Canguro.Commands.Forms.SectionsGUI.loadButton_Click C# (CSharp) Метод

loadButton_Click() приватный Метод

private loadButton_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void loadButton_Click(object sender, EventArgs e)
        {
            Canguro.Model.UnitSystem.UnitSystemsManager.Instance.Enabled = false;
            string path = "";
            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
            dlg.Filter = "Treu Structure Sections (*.xsec)|*.xsec";
            dlg.DefaultExt = "xsec";
            dlg.AddExtension = true;
            if (model.CurrentPath.Length > 0)
                dlg.FileName = model.CurrentPath;
            dlg.CheckPathExists = true;
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                path = dlg.FileName;
            try
            {
                if (path.Length > 0)
                    SectionManager.Instance.LoadXmlSections(path, model.Sections);
            }
            catch
            {
                MessageBox.Show(Culture.Get("errorLoadingFile") + " " + path, Culture.Get("error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Canguro.Model.UnitSystem.UnitSystemsManager.Instance.Enabled = true;
            }
            UpdatePage1();
        }