System.Web.UI.Control.IsLoadViewStateByID C# (CSharp) Method

IsLoadViewStateByID() private method

private IsLoadViewStateByID ( ) : bool
return bool
		bool IsLoadViewStateByID ()
		{
			if (loadViewStateByIDCache == null)
				loadViewStateByIDCache = new Dictionary <Type, bool> ();

			bool ret;
			Type myType = GetType ();
			if (loadViewStateByIDCache.TryGetValue (myType, out ret))
				return ret;

			System.ComponentModel.AttributeCollection attrs = TypeDescriptor.GetAttributes (myType);
			if (attrs != null || attrs.Count > 0) {
				ret = false;
				foreach (Attribute attr in attrs) {
					if (attr is ViewStateModeByIdAttribute) {
						ret = true;
						break;
					}
				}
			} else
				ret = false;
			
			loadViewStateByIDCache.Add (myType, ret);
			return ret;
		}