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
- ImageKeyConverter.cs
- DesignDataSource.cs
- QilTernary.cs
- Journaling.cs
- ThemeableAttribute.cs
- PopupRootAutomationPeer.cs
- CompilationUnit.cs
- SocketException.cs
- EntitySetBase.cs
- WindowsFormsLinkLabel.cs
- BaseProcessor.cs
- ExpressionPrefixAttribute.cs
- SynthesizerStateChangedEventArgs.cs
- FtpWebResponse.cs
- UInt32Converter.cs
- RequestQueryParser.cs
- InterleavedZipPartStream.cs
- TextMetrics.cs
- ContentFileHelper.cs
- MetricEntry.cs
- ToolStripDesignerUtils.cs
- WindowsHyperlink.cs
- FillRuleValidation.cs
- VisualTreeFlattener.cs
- PixelFormats.cs
- BehaviorEditorPart.cs
- ListViewInsertEventArgs.cs
- SrgsElement.cs
- OrderByExpression.cs
- PersonalizableTypeEntry.cs
- safePerfProviderHandle.cs
- AuthenticationConfig.cs
- ListViewItemSelectionChangedEvent.cs
- DBSchemaRow.cs
- ObjectSecurity.cs
- EventRoute.cs
- ToolStripPanel.cs
- Timer.cs
- ToolStripItemEventArgs.cs
- ConfigsHelper.cs
- AffineTransform3D.cs
- TextPenaltyModule.cs
- FunctionCommandText.cs
- DrawingContextWalker.cs
- Hex.cs
- precedingsibling.cs
- DescendentsWalkerBase.cs
- InstanceHandleConflictException.cs
- InvalidAsynchronousStateException.cs
- DataSourceCacheDurationConverter.cs
- FastPropertyAccessor.cs
- CreateParams.cs
- FieldNameLookup.cs
- DataGridViewRowCancelEventArgs.cs
- XmlILAnnotation.cs
- SerializationFieldInfo.cs
- DocumentPageHost.cs
- CompleteWizardStep.cs
- WmfPlaceableFileHeader.cs
- LoginUtil.cs
- Brush.cs
- ScaleTransform.cs
- QueryOperationResponseOfT.cs
- EntityTypeEmitter.cs
- FrugalList.cs
- DSASignatureDeformatter.cs
- UIHelper.cs
- _Win32.cs
- FontStretchConverter.cs
- GeometryGroup.cs
- PropertyGridView.cs
- TextSyndicationContent.cs
- XamlDesignerSerializationManager.cs
- SecurityUtils.cs
- _BaseOverlappedAsyncResult.cs
- PackageRelationshipCollection.cs
- SqlDeflator.cs
- TextBox.cs
- SelectionRangeConverter.cs
- GenericEnumerator.cs
- X500Name.cs
- Serializer.cs
- ValueUnavailableException.cs
- SHA384Managed.cs
- MatrixTransform.cs
- ImageMetadata.cs
- TemplateModeChangedEventArgs.cs
- GraphicsPath.cs
- ScrollBarRenderer.cs
- Util.cs
- SelectedGridItemChangedEvent.cs
- SplitterEvent.cs
- BindingList.cs
- XmlArrayItemAttributes.cs
- VSDExceptions.cs
- WebErrorHandler.cs
- GenericPrincipal.cs
- InvalidProgramException.cs
- CommandPlan.cs
- GZipStream.cs