Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / BaseDataListComponentEditor.cs / 1 / BaseDataListComponentEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Web.UI.Design.WebControls.ListControls; using System.Web.UI.WebControls; using System.Windows.Forms; using System.Windows.Forms.Design; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public abstract class BaseDataListComponentEditor : WindowsFormsComponentEditor { private int initialPage; ////// Provides the /// base component editor for Web Forms DataGrid and DataList controls. /// ////// /// public BaseDataListComponentEditor(int initialPage) { this.initialPage = initialPage; } ////// Initializes a new instance of ///. /// /// /// 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 BaseDataList to have a TemplatedControlDesigner"); TemplatedControlDesigner tplDesigner = (TemplatedControlDesigner)compDesigner; inTemplateMode = tplDesigner.InTemplateModeInternal; } if (inTemplateMode == false) { Type[] pageControlTypes = GetComponentEditorPages(); if ((pageControlTypes != null) && (pageControlTypes.Length != 0)) { ComponentEditorForm form = new ComponentEditorForm(obj, pageControlTypes); // Set RightToLeft mode based on resource file string rtlText = SR.GetString(SR.RTL); if (!String.Equals(rtlText, "RTL_False", StringComparison.Ordinal)) { form.RightToLeft = RightToLeft.Yes; form.RightToLeftLayout = true; } if (form.ShowForm(parent, GetInitialComponentEditorPageIndex()) == DialogResult.OK) result = true; } } else { RTLAwareMessageBox.Show(null, SR.GetString(SR.BDL_TemplateModePropBuilder), SR.GetString(SR.BDL_PropertyBuilder), MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 0); } return result; } ////// Edits a component. /// ////// /// protected override int GetInitialComponentEditorPageIndex() { return initialPage; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// Gets the index of the initial component editor page. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BeginStoryboard.cs
- ButtonFlatAdapter.cs
- TextLine.cs
- ObjectSecurity.cs
- remotingproxy.cs
- WindowsUpDown.cs
- WaitForChangedResult.cs
- SqlTypesSchemaImporter.cs
- RectAnimation.cs
- FileUtil.cs
- TextBoxAutomationPeer.cs
- DataGridViewAccessibleObject.cs
- TypeKeyValue.cs
- OperationPickerDialog.cs
- PageContentAsyncResult.cs
- SqlCommandSet.cs
- DataBindingHandlerAttribute.cs
- odbcmetadatafactory.cs
- DeviceSpecificDesigner.cs
- ConfigurationValidatorBase.cs
- StringConverter.cs
- DataGridViewComboBoxCell.cs
- Choices.cs
- DescriptionAttribute.cs
- DiscreteKeyFrames.cs
- TextCharacters.cs
- LogWriteRestartAreaAsyncResult.cs
- DrawingVisualDrawingContext.cs
- SqlBulkCopy.cs
- TraceLevelStore.cs
- InvalidEnumArgumentException.cs
- EntitySqlQueryCacheEntry.cs
- CodeDOMUtility.cs
- TypeUnloadedException.cs
- SiteOfOriginPart.cs
- GradientStop.cs
- PrintControllerWithStatusDialog.cs
- DataSourceCacheDurationConverter.cs
- HighlightOverlayGlyph.cs
- FragmentQueryKB.cs
- GridEntryCollection.cs
- CAGDesigner.cs
- RadialGradientBrush.cs
- VisualBasicSettingsConverter.cs
- BulletChrome.cs
- SystemUnicastIPAddressInformation.cs
- BoolExpr.cs
- SafeEventLogWriteHandle.cs
- Confirm.cs
- PersonalizationProviderHelper.cs
- CodeCommentStatement.cs
- ValidationHelper.cs
- ColumnWidthChangingEvent.cs
- SymbolDocumentGenerator.cs
- SignerInfo.cs
- ConfigurationProperty.cs
- FindCriteriaApril2005.cs
- OdbcParameter.cs
- ImportedNamespaceContextItem.cs
- WindowsClientCredential.cs
- ReferencedAssembly.cs
- TimeSpanFormat.cs
- ListItemCollection.cs
- XmlDictionary.cs
- RuntimeHelpers.cs
- ElapsedEventArgs.cs
- NavigationCommands.cs
- TextRenderer.cs
- SharedDp.cs
- SerializationObjectManager.cs
- TypeHelpers.cs
- LicenseManager.cs
- NullableBoolConverter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ServiceOperation.cs
- SspiNegotiationTokenAuthenticatorState.cs
- LabelLiteral.cs
- BindingOperations.cs
- HelloMessageApril2005.cs
- DirectionalLight.cs
- DBDataPermission.cs
- DrawingAttributes.cs
- ProfilePropertyNameValidator.cs
- CharacterString.cs
- SchemaElement.cs
- TryCatch.cs
- TypedTableBaseExtensions.cs
- InputReferenceExpression.cs
- ITextView.cs
- Bitmap.cs
- DataSourceExpression.cs
- Stroke.cs
- SmiEventSink_DeferedProcessing.cs
- GlyphTypeface.cs
- HttpResponseHeader.cs
- EndEvent.cs
- Underline.cs
- EventHandlersStore.cs
- RowBinding.cs
- DynamicPropertyHolder.cs