Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Design / CommandDesigner.cs / 1305376 / CommandDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls { using System; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Web.UI; using System.Web.UI.Design; using System.Web.UI.MobileControls.Adapters; using System.Web.UI.Design.MobileControls.Adapters; ////// ////// The designer for the ////// mobile control. /// [ System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode) ] [Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] internal class CommandDesigner : MobileControlDesigner { private System.Web.UI.MobileControls.Command _command; /// /// /// /// The control element for design. /// ////// Initializes the designer with the component for design. /// ////// ////// This is called by the designer host to establish the component for /// design. /// ///public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.Command, "CommandDesigner.Initialize - Invalid Command Control"); _command = (System.Web.UI.MobileControls.Command) component; base.Initialize(component); } /// /// ////// Returns the design-time HTML of the ////// mobile control /// /// ////// The HTML of the control. /// ///protected override String GetDesignTimeNormalHtml() { Debug.Assert(null != _command.Text); DesignerTextWriter tw; Control[] children = null; String originalText = _command.Text; bool blankText = (originalText.Trim().Length == 0); bool hasControls = _command.HasControls(); if (blankText) { if (hasControls) { children = new Control[_command.Controls.Count]; _command.Controls.CopyTo(children, 0); } _command.Text = "[" + _command.ID + "]"; } try { tw = new DesignerTextWriter(); _command.Adapter.Render(tw); } finally { if (blankText) { _command.Text = originalText; if (hasControls) { foreach (Control c in children) { _command.Controls.Add(c); } } } } return tw.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls { using System; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Web.UI; using System.Web.UI.Design; using System.Web.UI.MobileControls.Adapters; using System.Web.UI.Design.MobileControls.Adapters; ////// ////// The designer for the ////// mobile control. /// [ System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode) ] [Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] internal class CommandDesigner : MobileControlDesigner { private System.Web.UI.MobileControls.Command _command; /// /// /// /// The control element for design. /// ////// Initializes the designer with the component for design. /// ////// ////// This is called by the designer host to establish the component for /// design. /// ///public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.Command, "CommandDesigner.Initialize - Invalid Command Control"); _command = (System.Web.UI.MobileControls.Command) component; base.Initialize(component); } /// /// ////// Returns the design-time HTML of the ////// mobile control /// /// ////// The HTML of the control. /// ///protected override String GetDesignTimeNormalHtml() { Debug.Assert(null != _command.Text); DesignerTextWriter tw; Control[] children = null; String originalText = _command.Text; bool blankText = (originalText.Trim().Length == 0); bool hasControls = _command.HasControls(); if (blankText) { if (hasControls) { children = new Control[_command.Controls.Count]; _command.Controls.CopyTo(children, 0); } _command.Text = "[" + _command.ID + "]"; } try { tw = new DesignerTextWriter(); _command.Adapter.Render(tw); } finally { if (blankText) { _command.Text = originalText; if (hasControls) { foreach (Control c in children) { _command.Controls.Add(c); } } } } return tw.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReadOnlyNameValueCollection.cs
- SafeProcessHandle.cs
- DragEventArgs.cs
- DateTimeParse.cs
- WebBrowserHelper.cs
- RenameRuleObjectDialog.Designer.cs
- PKCS1MaskGenerationMethod.cs
- ConstructorExpr.cs
- XamlPoint3DCollectionSerializer.cs
- ExpressionBuilderCollection.cs
- MouseBinding.cs
- OracleConnection.cs
- TableLayoutRowStyleCollection.cs
- PersianCalendar.cs
- Menu.cs
- HwndStylusInputProvider.cs
- TabletDeviceInfo.cs
- FocusManager.cs
- DictionaryEntry.cs
- TextParaLineResult.cs
- ZoneLinkButton.cs
- ArrayTypeMismatchException.cs
- XMLSchema.cs
- DataObjectFieldAttribute.cs
- TemplatedEditableDesignerRegion.cs
- BrowserCapabilitiesFactoryBase.cs
- JsonByteArrayDataContract.cs
- WindowsPrincipal.cs
- DashStyle.cs
- Duration.cs
- RepeaterItemCollection.cs
- DllNotFoundException.cs
- AssemblyResourceLoader.cs
- HighlightComponent.cs
- SchemaImporterExtension.cs
- BuiltInPermissionSets.cs
- TagMapInfo.cs
- PeerNode.cs
- HashHelper.cs
- DataConnectionHelper.cs
- MetadataItem_Static.cs
- WebContext.cs
- AxHost.cs
- _LoggingObject.cs
- VoiceChangeEventArgs.cs
- EntityProviderFactory.cs
- TextSelection.cs
- CollectionType.cs
- ModelItemDictionaryImpl.cs
- CreateUserErrorEventArgs.cs
- infer.cs
- EnvelopedPkcs7.cs
- MeasurementDCInfo.cs
- ZipArchive.cs
- SchemaNames.cs
- TwoPhaseCommitProxy.cs
- ProfilePropertySettingsCollection.cs
- PrintingPermission.cs
- XmlSerializationReader.cs
- OutputCacheModule.cs
- ValidatorCompatibilityHelper.cs
- QueryCacheManager.cs
- VariableQuery.cs
- ArglessEventHandlerProxy.cs
- CoreSwitches.cs
- _FtpDataStream.cs
- LayoutEngine.cs
- StringBuilder.cs
- HttpModuleCollection.cs
- EventArgs.cs
- BamlTreeMap.cs
- EntityClientCacheEntry.cs
- PrintPreviewDialog.cs
- DataServiceStreamProviderWrapper.cs
- ObsoleteAttribute.cs
- RoleService.cs
- ErrorWebPart.cs
- MenuEventArgs.cs
- InputBinding.cs
- ObjectQueryExecutionPlan.cs
- TreeNodeSelectionProcessor.cs
- X509CertificateCollection.cs
- TargetParameterCountException.cs
- VariableAction.cs
- StrongNameKeyPair.cs
- KeyNotFoundException.cs
- AssociationSet.cs
- StrongNameHelpers.cs
- SizeLimitedCache.cs
- EncryptedType.cs
- RunInstallerAttribute.cs
- SimpleHandlerBuildProvider.cs
- ListBoxDesigner.cs
- RemotingServices.cs
- AnnotationResource.cs
- TableItemProviderWrapper.cs
- ToolStripStatusLabel.cs
- StorageMappingItemLoader.cs
- FontFamilyValueSerializer.cs
- DuplicateWaitObjectException.cs