예제 #1
0
 private void addButton_Click(object sender, EventArgs e)
 {
     if (this.openAddinDialog.ShowDialog(this) == DialogResult.OK)
     {
         try
         {
             AddinHelper.AddAddinAssembly(this.openAddinDialog.FileName);
             AddAddinToList(this.openAddinDialog.FileName);
         }
         catch (ApplicationException aex)
         {
             MessageBox.Show(aex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }
예제 #2
0
        private static void RegisterAddins()
        {
            try
            {
                //if addins are prsents in current path then add them
                string curPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

                if (File.Exists(curPath + @"\PTM.Addin.Charts.dll") && !AddinHelper.ExistAddin(curPath + @"\PTM.Addin.Charts.dll"))
                {
                    AddinHelper.AddAddinAssembly(curPath + @"\PTM.Addin.Charts.dll");
                }

                if (File.Exists(curPath + @"\PTM.Addin.WeekView.dll") && !AddinHelper.ExistAddin(curPath + @"\PTM.Addin.WeekView.dll"))
                {
                    AddinHelper.AddAddinAssembly(curPath + @"\PTM.Addin.WeekView.dll");
                }
            }
            catch (Exception ex)
            {
                Logger.WriteException(ex);
            }
        }