示例#1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The Install method installs the UrlProvider component.
        /// </summary>
        /// -----------------------------------------------------------------------------
        public override void Install()
        {
            try
            {
                // Ensure DesktopModule Cache is cleared
                DataCache.RemoveCache(string.Format(DataCache.DesktopModuleCacheKey, Null.NullInteger));

                var desktopModule = DesktopModuleController.GetDesktopModuleByModuleName(this._desktopModuleName, Null.NullInteger);
                if (desktopModule != null)
                {
                    this._extensionUrlProvider.DesktopModuleId = desktopModule.DesktopModuleID;
                }

                // Attempt to get the Desktop Module
                this._installedExtensionUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger)
                                                      .SingleOrDefault(p => p.ProviderType == this._extensionUrlProvider.ProviderType);

                if (this._installedExtensionUrlProvider != null)
                {
                    this._extensionUrlProvider.ExtensionUrlProviderId = this._installedExtensionUrlProvider.ExtensionUrlProviderId;
                }

                ExtensionUrlProviderController.SaveProvider(this._extensionUrlProvider);

                this.Completed = true;
                this.Log.AddInfo(string.Format(Util.URLPROVIDER_Registered, this._extensionUrlProvider.ProviderName));
            }
            catch (Exception ex)
            {
                this.Log.AddFailure(ex);
            }
        }
示例#2
0
        private void DeleteProvider()
        {
            try
            {
                ExtensionUrlProviderInfo tempUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger).Where(p => p.ProviderName == this._extensionUrlProvider.ProviderName && p.ProviderType == this._extensionUrlProvider.ProviderType).FirstOrDefault();
                if (tempUrlProvider != null)
                {
                    ExtensionUrlProviderController.DeleteProvider(tempUrlProvider);

                    this.Log.AddInfo(string.Format(Util.URLPROVIDER_UnRegistered, tempUrlProvider.ProviderName));
                }
            }
            catch (Exception ex)
            {
                this.Log.AddFailure(ex);
            }
        }
示例#3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The ReadManifest method reads the manifest file for the compoent.
        /// </summary>
        /// -----------------------------------------------------------------------------
        public override void ReadManifest(XPathNavigator manifestNav)
        {
            this._extensionUrlProvider = new ExtensionUrlProviderInfo
            {
                ProviderName       = Util.ReadElement(manifestNav, "urlProvider/name", this.Log, Util.URLPROVIDER_NameMissing),
                ProviderType       = Util.ReadElement(manifestNav, "urlProvider/type", this.Log, Util.URLPROVIDER_TypeMissing),
                SettingsControlSrc = Util.ReadElement(manifestNav, "urlProvider/settingsControlSrc"),
                IsActive           = true,
                RedirectAllUrls    = Convert.ToBoolean(Util.ReadElement(manifestNav, "urlProvider/redirectAllUrls", "false")),
                ReplaceAllUrls     = Convert.ToBoolean(Util.ReadElement(manifestNav, "urlProvider/replaceAllUrls", "false")),
                RewriteAllUrls     = Convert.ToBoolean(Util.ReadElement(manifestNav, "urlProvider/rewriteAllUrls", "false")),
            };

            this._desktopModuleName = Util.ReadElement(manifestNav, "urlProvider/desktopModule");
            if (this.Log.Valid)
            {
                this.Log.AddInfo(Util.URLPROVIDER_ReadSuccess);
            }
        }
        private void DeleteProvider()
        {
            try
            {
                //Attempt to get the Desktop Module
                //Attempt to get the Desktop Module
                DesktopModuleInfo desktopModule = DesktopModuleController.GetDesktopModuleByPackageID(Package.PackageID);

                ExtensionUrlProviderInfo tempUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger)
                                                           .SingleOrDefault(p => p.DesktopModuleId == desktopModule.DesktopModuleID);
                if (tempUrlProvider != null)
                {
                    ExtensionUrlProviderController.DeleteProvider(tempUrlProvider);

                    Log.AddInfo(string.Format(Util.URLPROVIDER_UnRegistered, tempUrlProvider.ProviderName));
                }
            }
            catch (Exception ex)
            {
                Log.AddFailure(ex);
            }
        }
示例#5
0
 public SettingHelper(ExtensionUrlProviderInfo settingProvider)
 {
     _provider = settingProvider;
 }