PurplePen.CustomSymbolText.SetCustomSymbolDictionaries C# (CSharp) Méthode

SetCustomSymbolDictionaries() public méthode

public SetCustomSymbolDictionaries ( Dictionary customSymbolText, bool>.Dictionary customSymbolKey ) : void
customSymbolText Dictionary
customSymbolKey bool>.Dictionary
Résultat void
        public void SetCustomSymbolDictionaries(Dictionary<string, List<SymbolText>> customSymbolText, Dictionary<string, bool> customSymbolKey)
        {
            this.customSymbolText = customSymbolText;
            this.customSymbolKey = customSymbolKey;

            if (selectedId != null)
                UpdateControlsFromId(selectedId);
        }

Usage Example

Exemple #1
0
        private void customizeDescriptionsMenu_Click(object sender, EventArgs e)
        {
            Dictionary<string, List<SymbolText>> customSymbolText;
            Dictionary<string, bool> customSymbolKey;

            // Initialize the dialog
            CustomSymbolText dialog = new CustomSymbolText(symbolDB, false);
            controller.GetCustomSymbolText(out customSymbolText, out customSymbolKey);
            dialog.SetCustomSymbolDictionaries(customSymbolText, customSymbolKey);
            dialog.LangId = controller.GetDescriptionLanguage();

            // Show the dialog.
            DialogResult result = dialog.ShowDialog(this);

            // Apply the changes
            if (result == DialogResult.OK) {
                // dialog changes the dictionaries, so we don't need to retrieve tham.
                controller.SetCustomSymbolText(customSymbolText, customSymbolKey, dialog.LangId);
                if (dialog.UseAsDefaultLanguage)
                    controller.DefaultDescriptionLanguage = dialog.LangId;
            }

            dialog.Dispose();
        }