tracepersonalizationprovider.cs

来自「asp.net 2.0 WebPart应用. 使用Web部件创建模块化的Web」· CS 代码 · 共 134 行

CS
134
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace MsdnMag.Samples
{

	public class TracePersonalizationProvider : SqlPersonalizationProvider
	{
		public override PersonalizationStateInfoCollection FindState(PersonalizationScope scope, PersonalizationStateQuery query, int pageIndex, int pageSize, out int totalRecords)
		{
			HttpContext.Current.Trace.Write("FindState called");
			return base.FindState(scope, query, pageIndex, pageSize, out totalRecords);
		}

		public override string ApplicationName
		{
			get
			{
				HttpContext.Current.Trace.Write("ApplicationName.get called");
				return base.ApplicationName;
			}
			set
			{
				HttpContext.Current.Trace.Write("ApplicationName.set called");
				base.ApplicationName = value;
			}
		}

		protected override System.Collections.IList CreateSupportedUserCapabilities()
		{
			HttpContext.Current.Trace.Write("CreateSupportedUserCapabilities called");
			return base.CreateSupportedUserCapabilities();
		}

		public override string Description
		{
			get
			{
				HttpContext.Current.Trace.Write("Description.get called");
				return base.Description;
			}
		}

		public override PersonalizationScope DetermineInitialScope(WebPartManager webPartManager, PersonalizationState loadedState)
		{
			HttpContext.Current.Trace.Write("DetermineInitialScope called");
			return base.DetermineInitialScope(webPartManager, loadedState);
		}

		public override System.Collections.IDictionary DetermineUserCapabilities(WebPartManager webPartManager)
		{
			HttpContext.Current.Trace.Write("DetermineUserCapabilities called");
			return base.DetermineUserCapabilities(webPartManager);
		}

		public override int GetCountOfState(PersonalizationScope scope, PersonalizationStateQuery query)
		{
			HttpContext.Current.Trace.Write("GetCountOfState called");
			return base.GetCountOfState(scope, query);
		}

		public override void Initialize(string name, System.Collections.Specialized.NameValueCollection configSettings)
		{
			HttpContext.Current.Trace.Write("Initialize called");
			base.Initialize(name, configSettings);
		}

		protected override void LoadPersonalizationBlobs(WebPartManager webPartManager, string path, string userName, ref byte[] sharedDataBlob, ref byte[] userDataBlob)
		{
			HttpContext.Current.Trace.Write("LoadPersonalizationBlobs called");
			base.LoadPersonalizationBlobs(webPartManager, path, userName, ref sharedDataBlob, ref userDataBlob);
		}

		public override PersonalizationState LoadPersonalizationState(WebPartManager webPartManager, bool ignoreCurrentUser)
		{
			HttpContext.Current.Trace.Write("Load PersonalizationState called");
			return base.LoadPersonalizationState(webPartManager, ignoreCurrentUser);
		}

		public override string Name
		{
			get
			{
				HttpContext.Current.Trace.Write("Name:get called");
				return base.Name;
			}
		}

		protected override void ResetPersonalizationBlob(WebPartManager webPartManager, string path, string userName)
		{
			HttpContext.Current.Trace.Write("ResetPersonalizationBlob called");
			base.ResetPersonalizationBlob(webPartManager, path, userName);
		}

		public override void ResetPersonalizationState(WebPartManager webPartManager)
		{
			HttpContext.Current.Trace.Write("ResetPersonalizationState called");
			base.ResetPersonalizationState(webPartManager);
		}

		public override int ResetState(PersonalizationScope scope, string[] paths, string[] usernames)
		{
			HttpContext.Current.Trace.Write("ResetState called");
			return base.ResetState(scope, paths, usernames);
		}

		public override int ResetUserState(string path, DateTime userInactiveSinceDate)
		{
			HttpContext.Current.Trace.Write("ResetUserState called");
			return base.ResetUserState(path, userInactiveSinceDate);
		}

		protected override void SavePersonalizationBlob(WebPartManager webPartManager, string path, string userName, byte[] dataBlob)
		{
			HttpContext.Current.Trace.Write("SavePersonalizationBlob called");
			base.SavePersonalizationBlob(webPartManager, path, userName, dataBlob);
		}

		public override void SavePersonalizationState(PersonalizationState state)
		{
			HttpContext.Current.Trace.Write("SavePersonalizationState called");
			base.SavePersonalizationState(state);
		}

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?