示例#1
0
        /// <summary>
        /// Initializes plugin</summary>
        /// <returns>true, iff plugin was initialized correctly</returns>
        void IInitializable.Initialize()
        {
            // check for assembly mapping attribute.
            // this attribute is used for bug-reporting and checking for update.
            var assembly = Assembly.GetEntryAssembly();
            var mapAttr =
                (ProjectMappingAttribute) Attribute.GetCustomAttribute(assembly, typeof(ProjectMappingAttribute));
            m_assemblyMappingFound = (mapAttr != null && mapAttr.Mapping != null && mapAttr.Mapping.Trim().Length != 0);

            if (m_assemblyMappingFound)
            {
                // check for new update
                m_updateCheck = new VersionCheck();
                m_updateCheck.CheckComplete += updateCheck_CheckComplete;

                if (m_commandService != null)
                {
                    m_commandService.RegisterCommand(
                        Command.HelpCheckForUpdate,
                        StandardMenu.Help, 
                        StandardCommandGroup.HelpUpdate,
                        "Check for update...".Localize(),
                        "Check for product update".Localize(), 
                        Keys.None,
                        null,
                        CommandVisibility.Menu,
                        this);
                }

                RegisterSettings();
            }
        }
示例#2
0
        /// <summary>
        /// Initializes plugin</summary>
        /// <returns>true, iff plugin was initialized correctly</returns>
        void IInitializable.Initialize()
        {
            // check for assembly mapping attribute.
            // this attribute is used for bug-reporting and checking for update.
            var assembly = Assembly.GetEntryAssembly();
            var mapAttr  =
                (ProjectMappingAttribute)Attribute.GetCustomAttribute(assembly, typeof(ProjectMappingAttribute));

            m_assemblyMappingFound = (mapAttr != null && mapAttr.Mapping != null && mapAttr.Mapping.Trim().Length != 0);

            if (m_assemblyMappingFound)
            {
                // check for new update
                m_updateCheck = new VersionCheck();
                m_updateCheck.CheckComplete += updateCheck_CheckComplete;

                if (m_commandService != null)
                {
                    m_commandService.RegisterCommand(
                        Command.HelpCheckForUpdate,
                        StandardMenu.Help,
                        StandardCommandGroup.HelpUpdate,
                        "Check for update...".Localize(),
                        "Check for product update".Localize(),
                        Keys.None,
                        null,
                        CommandVisibility.Menu,
                        this);
                }

                RegisterSettings();
            }
        }