示例#1
0
		internal override void LoadConfigDefaults ()
		{
			base.LoadConfigDefaults ();
#if NET_2_0
			PagesSection ps = PagesConfig;
#else
			PagesConfiguration ps = PagesConfig;
#endif			

			notBuffer = !ps.Buffer;
			enableSessionState = ps.EnableSessionState;
			enableViewStateMac = ps.EnableViewStateMac;
			smartNavigation = ps.SmartNavigation;
			validateRequest = ps.ValidateRequest;
#if NET_2_0
			string value = ps.MasterPageFile;
			if (value.Length > 0)
				masterPage = new MainDirectiveAttribute <string> (value, true);
			enable_event_validation = ps.EnableEventValidation;
			maxPageStateFieldLength = ps.MaxPageStateFieldLength;
			value = ps.Theme;
			if (value.Length > 0)
				theme = new MainDirectiveAttribute <string> (value, true);
			styleSheetTheme = ps.StyleSheetTheme;
			if (styleSheetTheme.Length == 0)
				styleSheetTheme = null;
			maintainScrollPositionOnPostBack = ps.MaintainScrollPositionOnPostBack;
#endif
		}
示例#2
0
文件: PageParser.cs 项目: mdae/MonoRT
        internal override void LoadConfigDefaults()
        {
            base.LoadConfigDefaults();
#if NET_2_0
            PagesSection ps = PagesConfig;
#else
            PagesConfiguration ps = PagesConfig;
#endif

            notBuffer          = !ps.Buffer;
            enableSessionState = ps.EnableSessionState;
            enableViewStateMac = ps.EnableViewStateMac;
            smartNavigation    = ps.SmartNavigation;
            validateRequest    = ps.ValidateRequest;
#if NET_2_0
            masterPage = ps.MasterPageFile;
            if (masterPage.Length == 0)
            {
                masterPage = null;
            }
            enable_event_validation = ps.EnableEventValidation;
            maxPageStateFieldLength = ps.MaxPageStateFieldLength;
            theme = ps.Theme;
            if (theme.Length == 0)
            {
                theme = null;
            }
            styleSheetTheme = ps.StyleSheetTheme;
            if (styleSheetTheme.Length == 0)
            {
                styleSheetTheme = null;
            }
            maintainScrollPositionOnPostBack = ps.MaintainScrollPositionOnPostBack;
#endif
        }
 private PagesConfiguration(PagesConfiguration original)
 {
     _fBuffer = original._fBuffer;
     _fRequiresSessionState = original._fRequiresSessionState;
     _fReadOnlySessionState = original._fReadOnlySessionState;
     _fEnableViewState      = original._fEnableViewState;
     _fEnableViewStateMac   = original._fEnableViewStateMac;
     _smartNavigation       = original._smartNavigation;
     _validateRequest       = original._validateRequest;
     _fAutoEventWireup      = original._fAutoEventWireup;
     _fAspCompat            = original._fAspCompat;
     _pageBaseType          = original._pageBaseType;
     _userControlBaseType   = original._userControlBaseType;
 }
            internal static object CreateStatic(object inheritedObject, XmlNode node)
            {
                PagesConfiguration inherited = (PagesConfiguration)inheritedObject;
                PagesConfiguration result;

                if (inherited == null)
                {
                    result = new PagesConfiguration();
                }
                else
                {
                    result = new PagesConfiguration(inherited);
                }

                //
                // Handle attributes (if they exist)
                //   - buffer="true/false"
                //   - enableSessionState="true/false/readonly"
                //   - enableViewState="true/false"
                //   - enableViewStateMac="true/false"
                //   - smartNavigation="true/false"
                //   - autoEventWireup="true/false"
                //   - pageBaseType=[typename]
                //   - userControlBaseType=[typename]

                HandlerBase.GetAndRemoveBooleanAttribute(node, "buffer", ref result._fBuffer);
                HandlerBase.GetAndRemoveBooleanAttribute(node, "enableViewState", ref result._fEnableViewState);
                HandlerBase.GetAndRemoveBooleanAttribute(node, "enableViewStateMac", ref result._fEnableViewStateMac);
                HandlerBase.GetAndRemoveBooleanAttribute(node, "smartNavigation", ref result._smartNavigation);
                HandlerBase.GetAndRemoveBooleanAttribute(node, "validateRequest", ref result._validateRequest);
                HandlerBase.GetAndRemoveBooleanAttribute(node, "autoEventWireup", ref result._fAutoEventWireup);

                if (HandlerBase.GetAndRemoveTypeAttribute(node, "pageBaseType", ref result._pageBaseType) != null)
                {
                    CheckBaseType(node, typeof(System.Web.UI.Page), result._pageBaseType);
                }

                if (HandlerBase.GetAndRemoveTypeAttribute(node, "userControlBaseType", ref result._userControlBaseType) != null)
                {
                    CheckBaseType(node, typeof(System.Web.UI.UserControl), result._userControlBaseType);
                }

                int enableSessionState = 0;

                string [] enableSessionStateValues = { "false", "true", "ReadOnly" };
                if (HandlerBase.GetAndRemoveEnumAttribute(node, "enableSessionState", enableSessionStateValues, ref enableSessionState) != null)
                {
                    if (enableSessionState == 0)   // false
                    {
                        result._fRequiresSessionState = false;
                    }
                    else if (enableSessionState == 1)   // true
                    {
                        result._fRequiresSessionState = true;
                        result._fReadOnlySessionState = false;
                    }
                    else if (enableSessionState == 2)   // ReadOnly
                    {
                        result._fReadOnlySessionState = true;
                    }
                }

                HandlerBase.CheckForUnrecognizedAttributes(node);
                HandlerBase.CheckForChildNodes(node);

                return(result);
            }