Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Design / BaseTemplatedMobileComponentEditor.cs / 1305376 / BaseTemplatedMobileComponentEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.Design; ////// [ 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 abstract class BaseTemplatedMobileComponentEditor : WindowsFormsComponentEditor { private int _initialPage; ////// Provides the /// base component editor for Mobile Templated controls. /// ////// /// /// The index of the initial page. /// internal BaseTemplatedMobileComponentEditor(int initialPage) { this._initialPage = initialPage; } ////// Initializes a new instance of ///. /// /// /// /// The/// Edits a component. /// ///parent. /// /// /// /// /// The component to edit. /// public override bool EditComponent(ITypeDescriptorContext context, Object obj, IWin32Window parent) { bool result = false; bool inTemplateMode = false; Debug.Assert(obj is IComponent, "Expected obj to be an IComponent"); IComponent comp = (IComponent)obj; ISite compSite = comp.Site; if (compSite != null) { IDesignerHost designerHost = (IDesignerHost)compSite.GetService(typeof(IDesignerHost)); IDesigner compDesigner = designerHost.GetDesigner(comp); Debug.Assert(compDesigner is TemplatedControlDesigner, "Expected component to have a TemplatedControlDesigner"); TemplatedControlDesigner tplDesigner = (TemplatedControlDesigner) compDesigner; inTemplateMode = tplDesigner.InTemplateMode; } if (inTemplateMode == false) { result = base.EditComponent(context, obj, parent); } else { MessageBox.Show(SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorMessage), SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorTitle), MessageBoxButtons.OK, MessageBoxIcon.Information); } return result; } /// /// ////// Gets the index of the initial component editor page. /// ////// protected override int GetInitialComponentEditorPageIndex() { return _initialPage; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// The index of the initial page. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.Design; ////// [ 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 abstract class BaseTemplatedMobileComponentEditor : WindowsFormsComponentEditor { private int _initialPage; ////// Provides the /// base component editor for Mobile Templated controls. /// ////// /// /// The index of the initial page. /// internal BaseTemplatedMobileComponentEditor(int initialPage) { this._initialPage = initialPage; } ////// Initializes a new instance of ///. /// /// /// /// The/// Edits a component. /// ///parent. /// /// /// /// /// The component to edit. /// public override bool EditComponent(ITypeDescriptorContext context, Object obj, IWin32Window parent) { bool result = false; bool inTemplateMode = false; Debug.Assert(obj is IComponent, "Expected obj to be an IComponent"); IComponent comp = (IComponent)obj; ISite compSite = comp.Site; if (compSite != null) { IDesignerHost designerHost = (IDesignerHost)compSite.GetService(typeof(IDesignerHost)); IDesigner compDesigner = designerHost.GetDesigner(comp); Debug.Assert(compDesigner is TemplatedControlDesigner, "Expected component to have a TemplatedControlDesigner"); TemplatedControlDesigner tplDesigner = (TemplatedControlDesigner) compDesigner; inTemplateMode = tplDesigner.InTemplateMode; } if (inTemplateMode == false) { result = base.EditComponent(context, obj, parent); } else { MessageBox.Show(SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorMessage), SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorTitle), MessageBoxButtons.OK, MessageBoxIcon.Information); } return result; } /// /// ////// Gets the index of the initial component editor page. /// ////// protected override int GetInitialComponentEditorPageIndex() { return _initialPage; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// The index of the initial page. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransformationRules.cs
- CodeDirectionExpression.cs
- WriteTimeStream.cs
- EasingQuaternionKeyFrame.cs
- LocatorGroup.cs
- SmiEventSink_Default.cs
- LightweightEntityWrapper.cs
- IndicFontClient.cs
- DesignerOptionService.cs
- OracleDateTime.cs
- Polyline.cs
- MergablePropertyAttribute.cs
- StreamResourceInfo.cs
- dataSvcMapFileLoader.cs
- OutputCacheProfileCollection.cs
- TableHeaderCell.cs
- RectConverter.cs
- Geometry3D.cs
- ConstraintManager.cs
- TextTreeUndo.cs
- InvokeGenerator.cs
- ConfigurationErrorsException.cs
- _ListenerResponseStream.cs
- DbMetaDataCollectionNames.cs
- DesignerTransaction.cs
- Ray3DHitTestResult.cs
- StyleCollection.cs
- WebPartCloseVerb.cs
- TCPClient.cs
- SqlFunctionAttribute.cs
- VoiceInfo.cs
- SmtpDigestAuthenticationModule.cs
- CodeTypeMemberCollection.cs
- BitStream.cs
- ComplusTypeValidator.cs
- ModelPropertyImpl.cs
- ButtonFlatAdapter.cs
- PasswordRecovery.cs
- EntityKeyElement.cs
- X509CertificateValidator.cs
- CustomValidator.cs
- ResourcePermissionBaseEntry.cs
- OperatorExpressions.cs
- ObjectDataSourceSelectingEventArgs.cs
- SiteMapNodeCollection.cs
- OleDbFactory.cs
- BrowserCapabilitiesCompiler.cs
- LineProperties.cs
- DataRowChangeEvent.cs
- XamlSerializerUtil.cs
- SchemaLookupTable.cs
- MetadataPropertyvalue.cs
- NoResizeSelectionBorderGlyph.cs
- _ShellExpression.cs
- SelectorAutomationPeer.cs
- WindowsNonControl.cs
- XsltLoader.cs
- DurableInstance.cs
- ExpandableObjectConverter.cs
- EncryptRequest.cs
- SmiGettersStream.cs
- DockProviderWrapper.cs
- Panel.cs
- RemotingAttributes.cs
- ActivityBuilder.cs
- _ShellExpression.cs
- ButtonBase.cs
- SqlCacheDependencySection.cs
- ObjectListItemCollection.cs
- LicenseManager.cs
- StickyNoteContentControl.cs
- OleDbCommandBuilder.cs
- CheckBox.cs
- StringToken.cs
- StorageAssociationTypeMapping.cs
- SourceSwitch.cs
- WindowsFormsHelpers.cs
- CacheForPrimitiveTypes.cs
- BuilderElements.cs
- IndexingContentUnit.cs
- SystemResourceHost.cs
- AccessViolationException.cs
- FixedPageProcessor.cs
- InvalidProgramException.cs
- IndexedString.cs
- EnlistmentTraceIdentifier.cs
- VectorCollectionConverter.cs
- UpDownEvent.cs
- DiscreteKeyFrames.cs
- _CookieModule.cs
- WebServiceAttribute.cs
- ConfigXmlWhitespace.cs
- ParameterBinding.cs
- OleDbDataAdapter.cs
- OleDbConnectionInternal.cs
- WebBrowserPermission.cs
- SnapshotChangeTrackingStrategy.cs
- ThemeDirectoryCompiler.cs
- GeometryModel3D.cs
- ApplicationManager.cs