Esempio n. 1
0
        public static string GetDocumentLink(string MacroType)
        {
            try
            {
                string DocumentLink = string.Empty;
                if (Settings.Default[MacroType + "_Document"] is string Value)
                {
                    DocumentLink = Value;
                }

                if (string.IsNullOrEmpty(DocumentLink) || string.IsNullOrWhiteSpace(DocumentLink))
                {
                    DocumentLink = XmlFunctionLibrary.GetDefaultDocumentLink();
                }

                return(DocumentLink);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(
                    "Failed to read data from the setting file\n" + Ex.Message,
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                return(string.Empty);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandPackage"/> class.
 /// </summary>
 public CommandPackage()
 {
     // Inside this method you can place any initialization code that does not require
     // any Visual Studio service because at this point the package object is created but
     // not sited yet inside Visual Studio environment. The place to do all the other
     // initialization is the Initialize method.
     XmlFunctionLibrary.LoadDefaultConfig();
 }