/// <include file='doc\UpWmlMobileTextWriter.uex' path='docs/doc[@for="UpWmlMobileTextWriter.UpWmlMobileTextWriter"]/*' />
 public UpWmlMobileTextWriter(TextWriter writer, MobileCapabilities device, MobilePage page) 
     : base(writer, device, page)
 {
     _screenWidth = device.ScreenCharactersWidth;
     _screenHeight = device.ScreenCharactersHeight;
     _canRenderMixedSelects = device.CanRenderMixedSelects;
 }
示例#2
0
        /////////////////////////////////////////////////////////////////////////
        //  BEGIN ADAPTER PLUMBING
        /////////////////////////////////////////////////////////////////////////

        protected override void OnInit(EventArgs e)
        {
            MobilePage page      = MobilePage;
            bool       isRuntime = page != null && !page.DesignMode;

            // We don't want to override the properties at design time.
            if (isRuntime)
            {
                ApplyDeviceSpecifics();
            }
            if (Adapter != null)
            {
                Adapter.OnInit(e);
            }
            base.OnInit(e);

            // If we are being created after the first pass
            // then

            if (isRuntime && page.PrivateViewStateLoaded)
            {
                Object privateViewState = ((MobilePage)Page).GetPrivateViewState(this);
                if (privateViewState != null)
                {
                    LoadPrivateViewStateInternal(privateViewState);
                }
            }
        }
示例#3
0
        internal void SavePrivateViewStateInternal()
        {
            Object privateState = SavePrivateViewState();
            Object adapterState = Adapter.SaveAdapterState();

            if (privateState != null || adapterState != null)
            {
                privateState = new Object[] { privateState, adapterState };
                MobilePage.AddClientViewState(this, privateState);
            }
        }
示例#4
0
        internal /*public*/ void Load(MobilePage page, Pair id)
        {
            _state = null;

            SessionViewStateHistory history = (SessionViewStateHistory)page.Session[ViewStateKey];
            if (history != null)
            {
                SessionViewStateHistoryItem historyItem = history.Find(id);
                if (historyItem != null)
                {
                    LoadFrom(historyItem);
                }
            }
        }
示例#5
0
 protected override void OnPreRender(EventArgs e)
 {
     base.OnPreRender(e);
     // If this control will be rendered as an image
     if (MobilePage != null &&
         ImageUrl != String.Empty &&
         MobilePage.Device.SupportsImageSubmit)
     {
         // HTML input controls of type image postback as name.x and
         // name.y which is not associated with this control by default
         // in Page.ProcessPostData().
         MobilePage.RegisterRequiresPostBack(this);
     }
 }
        /// <include file='doc\Command.uex' path='docs/doc[@for="Command.IPostBackEventHandler.RaisePostBackEvent"]/*' />
        /// <internalonly/>
        protected void RaisePostBackEvent(String argument)
        {
            if (CausesValidation)
            {
                MobilePage.Validate();
            }

            // It is legitimate to reset the form back to the first page
            // after a form submit.
            Form.CurrentPage = 1;

            OnClick(EventArgs.Empty);
            OnItemCommand(new CommandEventArgs(CommandName, CommandArgument));
        }
示例#7
0
        internal /*public*/ void Load(MobilePage page, Pair id)
        {
            _state = null;

            SessionViewStateHistory history = (SessionViewStateHistory)page.Session[ViewStateKey];

            if (history != null)
            {
                SessionViewStateHistoryItem historyItem = history.Find(id);
                if (historyItem != null)
                {
                    LoadFrom(historyItem);
                }
            }
        }
示例#8
0
 /// <internalonly/>
 protected void RaisePostBackEvent(String eventArgument)
 {
     if(!ItemsAsLinks)
     {
         // Non-templated list got a click event. There really
         // isn't a command source, so we'll set it to the 
         // default of null.
         int item = Int32.Parse(eventArgument, CultureInfo.InvariantCulture);
         item = TranslateVirtualItemIndex(item);
         OnItemCommand(new ListCommandEventArgs(Items[item], null));
     }
     else
     {
         MobilePage.ActiveForm = MobilePage.GetForm(eventArgument);
     }
 }
示例#9
0
        internal /*public*/ Pair Save(MobilePage page)
        {
            SessionViewStateHistory history = (SessionViewStateHistory)page.Session[ViewStateKey];
            if (history == null)
            {
                history = new SessionViewStateHistory(HttpContext.Current);
                page.Session[ViewStateKey] = history;
            }

            SessionViewStateHistoryItem historyItem = new SessionViewStateHistoryItem();
            SaveTo(historyItem);
            #if TRACE
            historyItem.Url = page.Request.FilePath;
            #endif
            return history.Push(historyItem);
        }
示例#10
0
        internal /*public*/ Pair Save(MobilePage page)
        {
            SessionViewStateHistory history = (SessionViewStateHistory)page.Session[ViewStateKey];

            if (history == null)
            {
                history = new SessionViewStateHistory(HttpContext.Current);
                page.Session[ViewStateKey] = history;
            }

            SessionViewStateHistoryItem historyItem = new SessionViewStateHistoryItem();

            SaveTo(historyItem);
            #if TRACE
            historyItem.Url = page.Request.FilePath;
            #endif
            return(history.Push(historyItem));
        }
        /// <include file='doc\WmlMobileTextWriter.uex' path='docs/doc[@for="WmlMobileTextWriter.WmlMobileTextWriter"]/*' />
        public WmlMobileTextWriter(TextWriter writer, MobileCapabilities device, MobilePage page) 
            : base(writer, device)
        {
            _realInnerWriter = writer;
            _page = page;

            _numberOfSoftkeys = Device.NumberOfSoftkeys;
            if (_numberOfSoftkeys > 2)
            {
                _numberOfSoftkeys = 2;
            }

            // For phones that don't have a back button, assign a softkey.

            if (_numberOfSoftkeys == 2 && !Device.HasBackButton)
            {
                _numberOfSoftkeys = 1;
                _provideBackButton = true;
                _alwaysScrambleClientIDs = _provideBackButton && 
                                                !device.CanRenderOneventAndPrevElementsTogether;
            }
        }
示例#12
0
        internal /*public*/ void Dump(MobilePage page, out ArrayList arr)
        {
            SessionViewStateHistory history;

            if ((page is IRequiresSessionState) && !(page is IReadOnlySessionState))
            {
                history = (SessionViewStateHistory)page.Session[ViewStateKey];
            }
            else
            {
                history = null;
            }

            if (history != null)
            {
                history.Dump(out arr);
            }
            else
            {
                arr = new ArrayList();
            }
        }
示例#13
0
文件: Utils.cs 项目: ikvm/webmatrix
 internal static void RefreshPageView(MobilePage page)
 {
     if (page != null)
     {
         UpdateRenderingRecursive(page);
     }
 }
示例#14
0
 /// <include file='doc\Form.uex' path='docs/doc[@for="Form.Render"]/*' />
 protected override void Render(HtmlTextWriter writer)
 {
     MobilePage.EnterFormRender(this);
     OnRender(writer);
     MobilePage.ExitFormRender();
 }
示例#15
0
 // used for linking between panels
 /// <internalonly/>
 protected void RaisePostBackEvent(String argument)
 {
     MobilePage.ActiveForm = MobilePage.GetForm(argument);
 }
示例#16
0
        internal /*public*/ void Dump(MobilePage page, out ArrayList arr)
        {
            SessionViewStateHistory history;
            if ((page is IRequiresSessionState) && !(page is IReadOnlySessionState))
            {
                history = (SessionViewStateHistory)page.Session[ViewStateKey];
            }
            else
            {
                history = null;
            }

            if (history != null)
            {
                history.Dump(out arr);
            }
            else
            {
                arr = new ArrayList();
            }
        }
示例#17
0
 // used for linking between panels
 void IPostBackEventHandler.RaisePostBackEvent(String argument)
 {
     MobilePage.ActiveForm = MobilePage.GetForm(argument);
 }