示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public PaAddOnManager()
        {
            try
            {
                Assembly assembly = Assembly.GetExecutingAssembly();
                if (!VerifyAddOnMediatorExists(assembly))
                {
                    return;
                }

                string settingName = Path.GetFileNameWithoutExtension(assembly.Location);
                if (PaApp.SettingsHandler.GetBoolSettingsValue(settingName, "Enabled", true))
                {
                    PaApp.AddMediatorColleague(this);

                    // Register to receive notification after data sources have been loaded.
                    // Use the add-on mediator (as opposed to just responding to the
                    // OnAfterDataSourcesLoaded message) because we want to make sure that
                    // all other add-ons who want to have processed the message. That's
                    // because if some other add-on changes the data in the cache
                    // (i.e. PaSADataSourceAddOn), it may influence what records are
                    // filtered out.
                    AddOnMediator.RegisterForDataSourcesLoadedMsg(1000, this);

                    m_startupFilterName =
                        PaApp.SettingsHandler.GetStringSettingsValue("PaFiltersAddOn", "currfilter", null);
                }
            }
            catch { }
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public PaAddOnManager()
        {
            try
            {
                Assembly assembly = Assembly.GetExecutingAssembly();
                if (!VerifyAddOnMediatorExists(assembly))
                {
                    return;
                }

                string settingName = Path.GetFileNameWithoutExtension(assembly.CodeBase);
                if (PaApp.SettingsHandler.GetBoolSettingsValue(settingName, "Enabled", true))
                {
                    PaApp.AddMediatorColleague(this);

                    // Register to receive notification after data sources have been loaded.
                    // Use the add-on mediator (as opposed to just responding to the
                    // OnAfterDataSourcesLoaded message) because we want to make sure that
                    // all other add-ons who want to have processed the message.
                    AddOnMediator.RegisterForDataSourcesLoadedMsg(100, this);
                }
            }
            catch { }
        }