Beispiel #1
0
        private void FrmAddressBook_Load(object sender, EventArgs e)
        {
            // локализация библиотеки
            string errMsg;

            if (!Localization.UseRussian)
            {
                if (Localization.LoadDictionaries(appDirs.LangDir, "AddressBook", out errMsg))
                {
                    Translator.TranslateForm(this, "Scada.Comm.Devices.AB.FrmAddressBook");
                    AbPhrases.Init();
                    rootNode.Text = AbPhrases.AddressBookNode;
                }
                else
                {
                    ScadaUiUtils.ShowError(errMsg);
                }
            }

            // загрузка адресной книги
            string fileName = appDirs.ConfigDir + AddressBook.DefFileName;

            if (File.Exists(fileName) && !addressBook.Load(fileName, out errMsg))
            {
                ScadaUiUtils.ShowError(errMsg);
            }
            Modified = false;

            // вывод дерева адресной книги
            BuildTree();

            // установка доступности кнопок
            SetButtonsEnabled();
        }
Beispiel #2
0
        private void FrmAddressBook_Load(object sender, EventArgs e)
        {
            // library localization
            string errMsg;

            if (!Localization.UseRussian)
            {
                if (Localization.LoadDictionaries(appDirs.LangDir, "AddressBook", out errMsg))
                {
                    Translator.TranslateForm(this, "Scada.Comm.Devices.AB.FrmAddressBook");
                    AbPhrases.Init();
                    rootNode.Text = AbPhrases.AddressBookNode;
                }
                else
                {
                    ScadaUiUtils.ShowError(errMsg);
                }
            }

            // loading address book
            string fileName = appDirs.ConfigDir + AddressBook.DefFileName;

            if (File.Exists(fileName) && !addressBook.Load(fileName, out errMsg))
            {
                ScadaUiUtils.ShowError(errMsg);
            }
            Modified = false;

            // output address book tree
            BuildTree();

            // setting the availability of buttons
            SetButtonsEnabled();
        }