/// <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; }
///////////////////////////////////////////////////////////////////////// // 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); } } }
internal void SavePrivateViewStateInternal() { Object privateState = SavePrivateViewState(); Object adapterState = Adapter.SaveAdapterState(); if (privateState != null || adapterState != null) { privateState = new Object[] { privateState, adapterState }; MobilePage.AddClientViewState(this, privateState); } }
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); } } }
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)); }
/// <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); } }
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); }
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; } }
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(); } }
internal static void RefreshPageView(MobilePage page) { if (page != null) { UpdateRenderingRecursive(page); } }
/// <include file='doc\Form.uex' path='docs/doc[@for="Form.Render"]/*' /> protected override void Render(HtmlTextWriter writer) { MobilePage.EnterFormRender(this); OnRender(writer); MobilePage.ExitFormRender(); }
// used for linking between panels /// <internalonly/> protected void RaisePostBackEvent(String argument) { MobilePage.ActiveForm = MobilePage.GetForm(argument); }
// used for linking between panels void IPostBackEventHandler.RaisePostBackEvent(String argument) { MobilePage.ActiveForm = MobilePage.GetForm(argument); }