예제 #1
0
        /// <summary>
        /// Delete the assembly
        /// </summary>
        /// <param name="plugin">Plugin to delete</param>
        /// <returns>Result of this method</returns>
        private Boolean DeletePlugin(IPluginVisualization plugin)
        {
            if (plugin != null)
            {
                //delete the assembly file
                string filePath =
                    PluginPath +
                    Path.DirectorySeparatorChar +
                    MISD.Client.Model.Properties.Settings.Default.PluginFileBase + plugin.Name +
                    ".dll";
                if (System.IO.File.Exists(filePath))
                {
                    try
                    {
                        System.IO.File.Delete(filePath);
                    }
                    catch (System.IO.IOException e)
                    {
                        ClientLogger.Instance.WriteEntry("Can't delete the plugin. \n" + e, LogType.Exception);
                        return(false);
                    }
                }
                else
                {
                    return(true);
                }
            }


            return(true);
        }
예제 #2
0
 public static Version GetVersion(this IPluginVisualization plugin)
 {
     return(System.Reflection.Assembly.GetAssembly(plugin.GetType()).GetName().Version);
 }