コード例 #1
0
ファイル: VersionUpdateService.cs プロジェクト: sbambach/ATF
        /// <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
ファイル: VersionUpdateService.cs プロジェクト: zparr/ATF
        /// <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();
            }
        }