• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EventLog.EventLogController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DotNetNuke.Services.Log.EventLog.EventLogController的典型用法代码示例。如果您正苦于以下问题:C# EventLogController类的具体用法?C# EventLogController怎么用?C# EventLogController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventLogController类属于DotNetNuke.Services.Log.EventLog命名空间,在下文中一共展示了EventLogController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddModuleInternal

        private void AddModuleInternal(ModuleInfo module)
        {
            var eventLogController = new EventLogController();
            // add module
            if (Null.IsNull(module.ModuleID))
            {
                CreateContentItem(module);

                //Add Module
                module.ModuleID = dataProvider.AddModule(module.ContentItemId,
                                                            module.PortalID,
                                                            module.ModuleDefID,
                                                            module.AllTabs,
                                                            module.StartDate,
                                                            module.EndDate,
                                                            module.InheritViewPermissions,
                                                            module.IsDeleted,
                                                            UserController.GetCurrentUserInfo().UserID);

                //Now we have the ModuleID - update the contentItem
                var contentController = Util.GetContentController();
                contentController.UpdateContentItem(module);

                eventLogController.AddLog(module, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.MODULE_CREATED);

                // set module permissions
                ModulePermissionController.SaveModulePermissions(module);
            }

            //Save ModuleSettings
            UpdateModuleSettings(module);
        }
开发者ID:biganth,项目名称:Curt,代码行数:32,代码来源:ModuleController.cs


示例2: OnEmptyBinClick

        /// <summary>
        /// Permanently removes all deleted tabs and modules
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// Parent tabs will not be deleted. To delete a parent tab all child tabs need to be deleted before.
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004	Created
        /// </history>
        protected void OnEmptyBinClick(Object sender, EventArgs e)
        {
            var objEventLog = new EventLogController();

            foreach (ListItem item in lstModules.Items)
            {
                var objModules = new ModuleController();
                var values = item.Value.Split('-');
                var tabId = int.Parse(values[0]);
                var moduleId = int.Parse(values[1]);

                //delete module
                var objModule = objModules.GetModule(moduleId, tabId, false);
                if (objModule != null)
                {
                    //hard-delete Tab Module Instance
                    objModules.DeleteTabModule(tabId, moduleId, false);
                    objEventLog.AddLog(objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_DELETED);
                }
            }
            foreach (ListItem item in lstTabs.Items)
            {
                var intTabId = int.Parse(item.Value);
                var objTabs = new TabController();
                var objTab = objTabs.GetTab(intTabId, PortalId, false);
                if (objTab != null)
                {
                    DeleteTab(objTab, true);
                }
            }
            BindData();
        }
开发者ID:rickfox,项目名称:Steves,代码行数:43,代码来源:RecycleBin.ascx.cs


示例3: AddMessage

        private void AddMessage(RoleInfo roleInfo, EventLogController.EventLogType logType)
        {
            var eventLogController = new EventLogController();
            eventLogController.AddLog(roleInfo,
                                PortalController.GetCurrentPortalSettings(),
                                UserController.GetCurrentUserInfo().UserID,
                                "",
                                logType);

        }
开发者ID:biganth,项目名称:Curt,代码行数:10,代码来源:RoleControllerImpl.cs


示例4: AddAuthentication

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// AddAuthentication adds a new Authentication System to the Data Store.
 /// </summary>
 /// <param name="authSystem">The new Authentication System to add</param>
 /// <history>
 /// 	[cnurse]	07/10/2007  Created
 /// </history>
 /// -----------------------------------------------------------------------------
 public static int AddAuthentication(AuthenticationInfo authSystem)
 {
     var objEventLog = new EventLogController();
     objEventLog.AddLog(authSystem, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.AUTHENTICATION_CREATED);
     return provider.AddAuthentication(authSystem.PackageID,
                                       authSystem.AuthenticationType,
                                       authSystem.IsEnabled,
                                       authSystem.SettingsControlSrc,
                                       authSystem.LoginControlSrc,
                                       authSystem.LogoffControlSrc,
                                       UserController.GetCurrentUserInfo().UserID);
 }
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:21,代码来源:AuthenticationController.cs


示例5: DeleteLanguagePack

 public static void DeleteLanguagePack(LanguagePackInfo languagePack)
 {
     if (languagePack.PackageType == LanguagePackType.Core)
     {
         Locale language = LocaleController.Instance.GetLocale(languagePack.LanguageID);
         if (language != null)
         {
             Localization.DeleteLanguage(language);
         }
     }
     DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID);
     var objEventLog = new EventLogController();
     objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_DELETED);
 }
开发者ID:biganth,项目名称:Curt,代码行数:14,代码来源:LanguagePackController.cs


示例6: DeleteLanguagePack

        public static void DeleteLanguagePack(LanguagePackInfo languagePack)
        {
            // fix DNN-26330	 Removing a language pack extension removes the language
            // we should not delete language when deleting language pack, as there is just a loose relationship

            //if (languagePack.PackageType == LanguagePackType.Core)
            //{
            //    Locale language = LocaleController.Instance.GetLocale(languagePack.LanguageID);
            //    if (language != null)
            //    {
            //        Localization.DeleteLanguage(language);
            //    }
            //}

            DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID);
            var objEventLog = new EventLogController();
            objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_DELETED);
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:18,代码来源:LanguagePackController.cs


示例7: WritteEventLog

        public static void WritteEventLog(string message, EventLogController.EventLogType type)
        {
            var eventLog = new EventLogController();

            var logInfo = new LogInfo
            {
                LogUserID = Data.Common.CurrentUser.UserID,
                LogPortalID = Data.Common.PortalId,
                LogTypeKey = type.ToString()
            };

            logInfo.AddProperty("PortalId:", Data.Common.PortalId.ToString());
            logInfo.AddProperty("UserId:", Data.Common.CurrentUser.UserID.ToString());
            logInfo.AddProperty("User:", Data.Common.CurrentUser.Username);
            logInfo.AddProperty("Message:", message.Trim());

            eventLog.AddLog(logInfo);
        }
开发者ID:intelequia,项目名称:IntelequiaVault,代码行数:18,代码来源:Common.cs


示例8: AddSchedule

 public static int AddSchedule(string TypeFullName, int TimeLapse, string TimeLapseMeasurement, int RetryTimeLapse, string RetryTimeLapseMeasurement, int RetainHistoryNum, string AttachToEvent,
                               bool CatchUpEnabled, bool Enabled, string ObjectDependencies, string Servers, string FriendlyName)
 {
     var objEventLog = new EventLogController();
     objEventLog.AddLog("TypeFullName", TypeFullName, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, EventLogController.EventLogType.SCHEDULE_CREATED);
     return DataProvider.Instance().AddSchedule(TypeFullName,
                                                TimeLapse,
                                                TimeLapseMeasurement,
                                                RetryTimeLapse,
                                                RetryTimeLapseMeasurement,
                                                RetainHistoryNum,
                                                AttachToEvent,
                                                CatchUpEnabled,
                                                Enabled,
                                                ObjectDependencies,
                                                Servers,
                                                UserController.GetCurrentUserInfo().UserID,
                                                FriendlyName);
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:19,代码来源:SchedulingController.cs


示例9: UpgradeModule

        private static void UpgradeModule(EventMessage message)
        {
            try
            {
                int desktopModuleId = Convert.ToInt32(message.Attributes["DesktopModuleId"]);
                var desktopModule = DesktopModuleController.GetDesktopModule(desktopModuleId, Null.NullInteger);

                string BusinessControllerClass = message.Attributes["BusinessControllerClass"];
                object controller = Reflection.CreateObject(BusinessControllerClass, "");
                var eventLogController = new EventLogController();
                LogInfo eventLogInfo;
                if (controller is IUpgradeable)
                {
					//get the list of applicable versions
                    string[] UpgradeVersions = message.Attributes["UpgradeVersionsList"].Split(',');
                    foreach (string Version in UpgradeVersions)
                    {
						//call the IUpgradeable interface for the module/version
                        string Results = ((IUpgradeable) controller).UpgradeModule(Version);
                        //log the upgrade results
                        eventLogInfo = new LogInfo();
                        eventLogInfo.AddProperty("Module Upgraded", BusinessControllerClass);
                        eventLogInfo.AddProperty("Version", Version);
                        if (!string.IsNullOrEmpty(Results))
                        {
                            eventLogInfo.AddProperty("Results", Results);
                        }
                        eventLogInfo.LogTypeKey = EventLogController.EventLogType.MODULE_UPDATED.ToString();
                        eventLogController.AddLog(eventLogInfo);
                    }
                }
                UpdateSupportedFeatures(controller, Convert.ToInt32(message.Attributes["DesktopModuleId"]));
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:38,代码来源:EventMessageProcessor.cs


示例10: SaveLanguagePack

        public static void SaveLanguagePack(LanguagePackInfo languagePack)
        {
            var objEventLog = new EventLogController();
            if (languagePack.LanguagePackID == Null.NullInteger)
            {
				//Add Language Pack
                languagePack.LanguagePackID = DataProvider.Instance().AddLanguagePack(languagePack.PackageID,
                                                                                      languagePack.LanguageID,
                                                                                      languagePack.DependentPackageID,
                                                                                      UserController.GetCurrentUserInfo().UserID);
                objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_CREATED);
            }
            else
            {
				//Update LanguagePack
                DataProvider.Instance().UpdateLanguagePack(languagePack.LanguagePackID,
                                                           languagePack.PackageID,
                                                           languagePack.LanguageID,
                                                           languagePack.DependentPackageID,
                                                           UserController.GetCurrentUserInfo().UserID);
                objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_UPDATED);
            }
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:23,代码来源:LanguagePackController.cs


示例11: GetConfig

        public static RewriterConfiguration GetConfig()
        {
            var config = new RewriterConfiguration {Rules = new RewriterRuleCollection()};
            FileStream fileReader = null;
            string filePath = "";
            try
            {
                config = (RewriterConfiguration) DataCache.GetCache("RewriterConfig");
                if ((config == null))
                {
                    filePath = Common.Utilities.Config.GetPathToFile(Common.Utilities.Config.ConfigFileType.SiteUrls);

                    //Create a FileStream for the Config file
                    fileReader = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
                    var doc = new XPathDocument(fileReader);
                    config = new RewriterConfiguration {Rules = new RewriterRuleCollection()};
                    foreach (XPathNavigator nav in doc.CreateNavigator().Select("RewriterConfig/Rules/RewriterRule"))
                    {
                        var rule = new RewriterRule {LookFor = nav.SelectSingleNode("LookFor").Value, SendTo = nav.SelectSingleNode("SendTo").Value};
                        config.Rules.Add(rule);
                    }
                    if (File.Exists(filePath))
                    {
						//Set back into Cache
                        DataCache.SetCache("RewriterConfig", config, new DNNCacheDependency(filePath));
                    }
                }
            }
            catch (Exception ex)
            {
				//log it
                var objEventLog = new EventLogController();
                var objEventLogInfo = new LogInfo();
                objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetConfig Failed");
                objEventLogInfo.AddProperty("FilePath", filePath);
                objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);
                objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
                objEventLog.AddLog(objEventLogInfo);
                Logger.Error(objEventLogInfo);

            }
            finally
            {
                if (fileReader != null)
                {
					//Close the Reader
                    fileReader.Close();
                }
            }
            return config;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:51,代码来源:RewriterConfiguration.cs


示例12: AddUserAuthentication

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// AddUserAuthentication adds a new UserAuthentication to the User.
        /// </summary>
        /// <param name="userID">The new Authentication System to add</param>
        /// <param name="authenticationType">The authentication type</param>
        /// <param name="authenticationToken">The authentication token</param>
        /// <history>
        /// 	[cnurse]	07/12/2007  Created
        /// 	[skydnn]    11/14/2013  DNN-4016
        /// </history>
        /// -----------------------------------------------------------------------------
        public static int AddUserAuthentication(int userID, string authenticationType, string authenticationToken)
        {
            var objEventLog = new EventLogController();

            UserAuthenticationInfo userAuth = GetUserAuthentication(userID);

            if (userAuth == null || String.IsNullOrEmpty(userAuth.AuthenticationType))
            {
                objEventLog.AddLog("userID/authenticationType",
                                   userID + "/" + authenticationType,
                                   PortalController.GetCurrentPortalSettings(),
                                   UserController.GetCurrentUserInfo().UserID,
                                   EventLogController.EventLogType.AUTHENTICATION_USER_CREATED);
                return provider.AddUserAuthentication(userID, authenticationType, authenticationToken, UserController.GetCurrentUserInfo().UserID);
            }
            else
            {

                objEventLog.AddLog("userID/authenticationType already exists",
                   userID + "/" + authenticationType,
                   PortalController.GetCurrentPortalSettings(),
                   UserController.GetCurrentUserInfo().UserID,
                   EventLogController.EventLogType.AUTHENTICATION_USER_UPDATED);

                return userAuth.UserAuthenticationID;
            }
        }
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:39,代码来源:AuthenticationController.cs


示例13: LogModuleProviderExceptionInRequest

        /// <summary>
        /// logs an exception related to a module provider once per cache-lifetime
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="status"></param>
        /// <param name="result"></param>
        /// <param name="messages"></param>
        /// <param name="provider"></param>
        public static void LogModuleProviderExceptionInRequest(Exception ex, string status,
                                                                ExtensionUrlProvider provider, 
                                                                UrlAction result,
                                                                List<string> messages)
        {
            if (ex != null)
            {
                string moduleProviderName = "Unknown Provider";
                string moduleProviderVersion = "Unknown Version";
                if (provider != null)
                {
                    moduleProviderName = provider.ProviderConfig.ProviderName;
                    moduleProviderVersion = provider.GetType().Assembly.GetName(false).Version.ToString();
                }
                //this logic prevents a site logging an exception for every request made.  Instead 
                //the exception will be logged once for the life of the cache / application restart or 1 hour, whichever is shorter.
                //create a cache key for this exception type
                string cacheKey = ex.GetType().ToString();
                //see if there is an existing object logged for this exception type
                object existingEx = DataCache.GetCache(cacheKey);
                if (existingEx == null)
                {
                    //if there was no existing object logged for this exception type, this is a new exception
                    DateTime expire = DateTime.Now.AddHours(1);
                    DataCache.SetCache(cacheKey, cacheKey, expire);
                    //just store the cache key - it doesn't really matter
                    //create a log event
                    string productVer = Assembly.GetExecutingAssembly().GetName(false).Version.ToString();
                    var elc = new EventLogController();
                    var logEntry = new LogInfo {LogTypeKey = "GENERAL_EXCEPTION"};
                    logEntry.AddProperty("Url Rewriting Extension Url Provider Exception",
                                         "Exception in Url Rewriting Process");
                    logEntry.AddProperty("Provider Name", moduleProviderName);
                    logEntry.AddProperty("Provider Version", moduleProviderVersion);
                    logEntry.AddProperty("Http Status", status);
                    logEntry.AddProperty("Product Version", productVer);
                    if (result != null)
                    {
                        logEntry.AddProperty("Original Path", result.OriginalPath ?? "null");
                        logEntry.AddProperty("Raw Url", result.RawUrl ?? "null");
                        logEntry.AddProperty("Final Url", result.FinalUrl ?? "null");

                        logEntry.AddProperty("Rewrite Result", !string.IsNullOrEmpty(result.RewritePath)
                                                                     ? result.RewritePath
                                                                     : "[no rewrite]");
                        logEntry.AddProperty("Redirect Location", string.IsNullOrEmpty(result.FinalUrl) 
                                                                    ? "[no redirect]" 
                                                                    : result.FinalUrl);
                        logEntry.AddProperty("Action", result.Action.ToString());
                        logEntry.AddProperty("Reason", result.Reason.ToString());
                        logEntry.AddProperty("Portal Id", result.PortalId.ToString());
                        logEntry.AddProperty("Tab Id", result.TabId.ToString());
                        logEntry.AddProperty("Http Alias", result.PortalAlias != null ? result.PortalAlias.HTTPAlias : "Null");

                        if (result.DebugMessages != null)
                        {
                            int i = 1;
                            foreach (string debugMessage in result.DebugMessages)
                            {
                                string msg = debugMessage;
                                if (debugMessage == null)
                                {
                                    msg = "[message was null]";
                                }
                                logEntry.AddProperty("Debug Message[result] " + i.ToString(), msg);
                                i++;
                            }
                        }
                    }
                    else
                    {
                        logEntry.AddProperty("Result", "Result value null");
                    }
                    if (messages != null)
                    {
                        int i = 1;
                        foreach (string msg in messages)
                        {
                            logEntry.AddProperty("Debug Message[raw] " + i.ToString(), msg);
                            i++;
                        }
                    }
                    logEntry.AddProperty("Exception Type", ex.GetType().ToString());
                    logEntry.AddProperty("Message", ex.Message);
                    logEntry.AddProperty("Stack Trace", ex.StackTrace);
                    if (ex.InnerException != null)
                    {
                        logEntry.AddProperty("Inner Exception Message", ex.InnerException.Message);
                        logEntry.AddProperty("Inner Exception Stacktrace", ex.InnerException.StackTrace);
                    }
                    logEntry.BypassBuffering = true;
                    elc.AddLog(logEntry);
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:101,代码来源:ExtensionUrlProviderController.cs


示例14: UpdateSkinPackage

 public static void UpdateSkinPackage(SkinPackageInfo skinPackage)
 {
     DataProvider.Instance().UpdateSkinPackage(skinPackage.SkinPackageID,
                                               skinPackage.PackageID,
                                               skinPackage.PortalID,
                                               skinPackage.SkinName,
                                               skinPackage.SkinType,
                                               UserController.GetCurrentUserInfo().UserID);
     var eventLogController = new EventLogController();
     eventLogController.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.SKINPACKAGE_UPDATED);
     foreach (KeyValuePair<int, string> kvp in skinPackage.Skins)
     {
         UpdateSkin(kvp.Key, kvp.Value);
     }
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:15,代码来源:SkinController.cs


示例15: UpdateUserProfile

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// UpdateUserProfile persists a user's Profile to the Data Store
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="user">The user to persist to the Data Store.</param>
        /// -----------------------------------------------------------------------------
        public override void UpdateUserProfile(UserInfo user)
        {
            ProfilePropertyDefinitionCollection properties = user.Profile.ProfileProperties;

            //Ensure old and new TimeZone properties are in synch
            var newTimeZone = properties["PreferredTimeZone"];
            var oldTimeZone = properties["TimeZone"];
            if (oldTimeZone != null && newTimeZone != null)
            {   //preference given to new property, if new is changed then old should be updated as well.
                if (newTimeZone.IsDirty && !string.IsNullOrEmpty(newTimeZone.PropertyValue))
                {
                    var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(newTimeZone.PropertyValue);
                    if (timeZoneInfo != null)
                        oldTimeZone.PropertyValue = timeZoneInfo.BaseUtcOffset.TotalMinutes.ToString(CultureInfo.InvariantCulture);
                }
                //however if old is changed, we need to update new as well
                else if (oldTimeZone.IsDirty)
                {
                    int oldOffset;
                    int.TryParse(oldTimeZone.PropertyValue, out oldOffset);
                    newTimeZone.PropertyValue = Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(oldOffset).Id;                    
                }
            }
            
            foreach (ProfilePropertyDefinition profProperty in properties)
            {
                if ((profProperty.PropertyValue != null) && (profProperty.IsDirty))
                {
                    var objSecurity = new PortalSecurity();
                    string propertyValue = objSecurity.InputFilter(profProperty.PropertyValue, PortalSecurity.FilterFlag.NoScripting);
                    _dataProvider.UpdateProfileProperty(Null.NullInteger, user.UserID, profProperty.PropertyDefinitionId, 
                                                propertyValue, (int) profProperty.ProfileVisibility.VisibilityMode, 
                                                profProperty.ProfileVisibility.ExtendedVisibilityString(), DateTime.Now);
                    var objEventLog = new EventLogController();
                    objEventLog.AddLog(user, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", "USERPROFILE_UPDATED");
                }
            }
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:46,代码来源:DNNProfileProvider.cs


示例16: AddSkinPackage

 public static int AddSkinPackage(SkinPackageInfo skinPackage)
 {
     var eventLogController = new EventLogController();
     eventLogController.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.SKINPACKAGE_CREATED);
     return DataProvider.Instance().AddSkinPackage(skinPackage.PackageID, skinPackage.PortalID, skinPackage.SkinName, skinPackage.SkinType, UserController.GetCurrentUserInfo().UserID);
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:6,代码来源:SkinController.cs


示例17: DeleteSkinPackage

 public static void DeleteSkinPackage(SkinPackageInfo skinPackage)
 {
     DataProvider.Instance().DeleteSkinPackage(skinPackage.SkinPackageID);
     var eventLogController = new EventLogController();
     eventLogController.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.SKINPACKAGE_DELETED);
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:6,代码来源:SkinController.cs


示例18: InvalidateDictionary

        public static void InvalidateDictionary(string reason, PageIndexData rebuildData, int portalId)
        {
            //if supplied, store the rebuildData for when the dictionary gets rebuilt
            //this is a way of storing data between dictionary rebuilds
            if (rebuildData != null)
            {
                DataCache.SetCache("rebuildData", rebuildData);
            }

            //add log entry for cache clearance
            var elc = new EventLogController();
            var logValue = new LogInfo { LogTypeKey = "HOST_ALERT" };
            try
            {
                //817 : not clearing items correctly from dictionary
                CacheController.FlushPageIndexFromCache();
            }
            catch (Exception ex)
            {
                //do nothing ; can be from trying to access cache after system restart
                Services.Exceptions.Exceptions.LogException(ex);
            }

            logValue.AddProperty("Url Rewriting Caching Message", "Page Index Cache Cleared.  Reason: " + reason);
            logValue.AddProperty("Thread Id", Thread.CurrentThread.ManagedThreadId.ToString());
            elc.AddLog(logValue);
        }
开发者ID:vsnobbert,项目名称:Dnn.Platform,代码行数:27,代码来源:TabIndexController.cs


示例19: UploadLegacySkin


//.........这里部分代码省略.........
                                objMemoryStream.Write(arrData, 0, intSize);
                                intSize = objZipInputStream.Read(arrData, 0, arrData.Length);
                            }
                            objMemoryStream.Seek(0, SeekOrigin.Begin);
                            strMessage += UploadLegacySkin(rootPath, RootSkin, skinName, objMemoryStream);
                        }
                        else if (objZipEntry.Name.ToLower() == RootContainer.ToLower() + ".zip")
                        {
                            var objMemoryStream = new MemoryStream();
                            intSize = objZipInputStream.Read(arrData, 0, arrData.Length);
                            while (intSize > 0)
                            {
                                objMemoryStream.Write(arrData, 0, intSize);
                                intSize = objZipInputStream.Read(arrData, 0, arrData.Length);
                            }
                            objMemoryStream.Seek(0, SeekOrigin.Begin);
                            strMessage += UploadLegacySkin(rootPath, RootContainer, skinName, objMemoryStream);
                        }
                        else
                        {
                            strFileName = rootPath + skinRoot + "\\" + skinName + "\\" + objZipEntry.Name;

                            //create the directory if it does not exist
                            if (!Directory.Exists(Path.GetDirectoryName(strFileName)))
                            {
                                strMessage += FormatMessage(CREATE_DIR, Path.GetDirectoryName(strFileName), 2, false);
                                Directory.CreateDirectory(Path.GetDirectoryName(strFileName));
                            }
							
							//remove the old file
                            if (File.Exists(strFileName))
                            {
                                File.SetAttributes(strFileName, FileAttributes.Normal);
                                File.Delete(strFileName);
                            }
							
							//create the new file
                            objFileStream = File.Create(strFileName);
							
							//unzip the file
                            strMessage += FormatMessage(WRITE_FILE, Path.GetFileName(strFileName), 2, false);
                            intSize = objZipInputStream.Read(arrData, 0, arrData.Length);
                            while (intSize > 0)
                            {
                                objFileStream.Write(arrData, 0, intSize);
                                intSize = objZipInputStream.Read(arrData, 0, arrData.Length);
                            }
                            objFileStream.Close();

                            //save the skin file
                            switch (Path.GetExtension(strFileName))
                            {
                                case ".htm":
                                case ".html":
                                case ".ascx":
                                case ".css":
                                    if (strFileName.ToLower().IndexOf(Globals.glbAboutPage.ToLower()) < 0)
                                    {
                                        arrSkinFiles.Add(strFileName);
                                    }
                                    break;
                            }
                            break;
                        }
                    }
                    else
                    {
                        strMessage += string.Format(FILE_RESTICTED, objZipEntry.Name, Host.AllowedExtensionWhitelist.ToStorageString(), ",", ", *.").Replace("2", "true");
                    }
                }
                objZipEntry = objZipInputStream.GetNextEntry();
            }
            strMessage += FormatMessage(END_MESSAGE, skinName + ".zip", 1, false);
            objZipInputStream.Close();

            //process the list of skin files
            var NewSkin = new SkinFileProcessor(rootPath, skinRoot, skinName);
            strMessage += NewSkin.ProcessList(arrSkinFiles, SkinParser.Portable);
			
			//log installation event
            try
            {
                var objEventLogInfo = new LogInfo();
                objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
                objEventLogInfo.LogProperties.Add(new LogDetailInfo("Install Skin:", skinName));
                Array arrMessage = strMessage.Split(new[] {"<br />"}, StringSplitOptions.None);
                foreach (string strRow in arrMessage)
                {
                    objEventLogInfo.LogProperties.Add(new LogDetailInfo("Info:", HtmlUtils.StripTags(strRow, true)));
                }
                var objEventLog = new EventLogController();
                objEventLog.AddLog(objEventLogInfo);
            }
            catch (Exception exc)
            {
                Logger.Error(exc);

            }
            return strMessage;
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:101,代码来源:SkinController.cs


示例20: AddToTabDict


//.........这里部分代码省略.........
                        if (dupCheckDict.ContainsKey(dupKey))
                        {
                            DupKeyCheck foundTab = dupCheckDict[dupKey];
                            //a redirected tab will replace a deleted tab
                            if (foundTab.IsDeleted && keyDupAction == UrlEnums.TabKeyPreference.TabRedirected)
                            {
                                replaceTab = true;
                            }
                            if (foundTab.TabIdOriginal == "-1")
                            {
                                replaceTab = true;
                            }
                        }
                    }
                    if (replaceTab && !isDeleted) //don't replace if the incoming tab is deleted
                    {
                        //remove the previous one 
                        tabIndex.Remove(tabKey);
                        //add the new one 
                        tabIndex.Add(tabKey, Globals.glbDefaultPage + rewrittenPath);
                    }
                }
                else
                {
                    //just add the tabkey into the dictionary
                    tabIndex.Add(tabKey, Globals.glbDefaultPage + rewrittenPath);
                }
            }

            //checking for duplicates means throwing an exception when one is found, but this is just logged to the event log
            if (dupCheckDic 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EventLog.LogController类代码示例发布时间:2022-05-24
下一篇:
C# Packages.PackageInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap