/// <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; }
/// <include file='doc\HtmlMobileTextWriter.uex' path='docs/doc[@for="HtmlMobileTextWriter.HtmlMobileTextWriter"]/*' /> public HtmlMobileTextWriter(TextWriter writer, MobileCapabilities device) : base(writer, device) { RenderBold = device.SupportsBold; RenderItalic = device.SupportsItalic; RenderFontSize = device.SupportsFontSize; RenderFontName = device.SupportsFontName; RenderFontColor = device.SupportsFontColor; RenderBodyColor = device.SupportsBodyColor; RenderDivAlign = device.SupportsDivAlign; RenderDivNoWrap = device.SupportsDivNoWrap; RequiresNoBreakInFormatting = device.RequiresNoBreakInFormatting; _currentState = new WriterState(this); }
/// <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 bool Evaluate(MobileCapabilities capabilities) { // Evaluate the <Choice> by first looking to see if it's null, then // checking against evaluators defined in code on the page, then by // consulting the MobileCapabilities object. bool result; if (_deviceFilter != null && _deviceFilter.Length == 0) { // indicates device-independent <choice> clause result = true; } else if (CheckOnPageEvaluator(capabilities, out result)) { // result already been set through the out-bound parameter // above. } else { // The exception message generated by HasCapability() failing is // inappropriate, so we substitute a more specific one. try { result = capabilities.HasCapability(_deviceFilter, _argument); } catch { throw new ArgumentException(SR.GetString( SR.DeviceSpecificChoice_CantFindFilter, _deviceFilter)); } } return result; }
// Return true if specified evaluator exists on the page with the // correct signature. If it does, return result of invoking it in // evaluatorResult. private bool CheckOnPageEvaluator(MobileCapabilities capabilities, out bool evaluatorResult) { evaluatorResult = false; TemplateControl containingTemplateControl = Owner.ClosestTemplateControl; MethodInfo methodInfo = containingTemplateControl.GetType().GetMethod(_deviceFilter, new Type[] { typeof(MobileCapabilities), typeof(String) } ); if (methodInfo == null || methodInfo.ReturnType != typeof(bool)) { return false; } else { evaluatorResult = (bool) methodInfo.Invoke(containingTemplateControl, new Object[] { capabilities, _argument } ); return true; } }
public virtual bool supportsVoiceCalls(MobileCapabilities capabilities, string optionalArgument) { return capabilities.get_CanInitiateVoiceCall(); }
/// <include file='doc\ChtmlMobileTextWriter.uex' path='docs/doc[@for="ChtmlMobileTextWriter.ChtmlMobileTextWriter"]/*' /> public ChtmlMobileTextWriter(TextWriter writer, MobileCapabilities device) : base(writer, device) { }
internal void AddCapabilityDelegate(String delegateName, MobileCapabilities.EvaluateCapabilitiesDelegate evaluator) { _delegateEvaluators[delegateName] = evaluator; }
public virtual bool isMyPalm(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Browser == "MyPalm"); }
public virtual bool prefersWBMP(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.get_PreferredImageMime() == "image/vnd.wap.wbmp"); }
/// <include file='doc\XhtmlMobileTextWriter.uex' path='docs/doc[@for="XhtmlMobileTextWriter.XhtmlMobileTextWriter"]/*' /> public XhtmlMobileTextWriter (TextWriter writer, MobileCapabilities device) : base(writer, device) { _doctypeDeclarations[Doctype.XhtmlBasic] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">"; _doctypeDeclarations[Doctype.XhtmlMobileProfile] = "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; _doctypeDeclarations[Doctype.Wml20] = "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD WML 2.0//EN\" \"http://www.wapforum.org/dtd/wml20.dtd\" >"; }
public virtual bool isWML11(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.get_PreferredRenderingType() == "wml11"); }
public virtual bool prefersGIF(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.get_PreferredImageMime() == "image/gif"); }
public virtual bool isUP4X(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Type == "Phone.com 4.x Browser"); }
public virtual bool isPocketIE(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Browser == "Pocket IE"); }
public virtual bool isNokia7110(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Type == "Nokia 7110"); }
/// <include file='doc\MobileTextWriter.uex' path='docs/doc[@for="MobileTextWriter.MobileTextWriter"]/*' /> public MobileTextWriter(TextWriter writer, MobileCapabilities device) : base(writer) { _multiPartWriter = writer as MultiPartWriter; _device = device; }
public virtual bool supportsColor(MobileCapabilities capabilities, string optionalArgument) { return capabilities.get_IsColor(); }
public virtual bool isGoAmerica(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Browser == "Go.Web"); }
public virtual bool isEricssonR380(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.Type == "Ericsson R380"); }
internal bool FindDelegateEvaluator(String evaluatorName, out MobileCapabilities.EvaluateCapabilitiesDelegate evaluatorDelegate) { evaluatorDelegate = null; MobileCapabilities.EvaluateCapabilitiesDelegate evaluator; evaluator = (MobileCapabilities.EvaluateCapabilitiesDelegate) _delegateEvaluators[evaluatorName]; if(evaluator == null) { return false; } evaluatorDelegate = evaluator; return true; }
public virtual bool supportsJavaScript(MobileCapabilities capabilities, string optionalArgument) { return capabilities.JavaScript; }
public virtual bool supportsCookies(MobileCapabilities capabilities, string optionalArgument) { return capabilities.Cookies; }
public virtual bool isHTML32(MobileCapabilities capabilities, string optionalArgument) { return (capabilities.get_PreferredRenderingType() == "html32"); }