Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / AccessDataSourceDesigner.cs / 1 / AccessDataSourceDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Data; using System.Data.Common; using System.ComponentModel.Design.Data; using System.Design; using System.Diagnostics; using System.Drawing.Design; using System.IO; using System.Web.UI; using System.Web.UI.Design; using System.Web.UI.Design.Util; using System.Web.UI.WebControls; using System.Windows.Forms; using System.Windows.Forms.Design; ////// /// AccessDataSourceDesigner is the designer associated with an AccessDataSource. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public class AccessDataSourceDesigner : SqlDataSourceDesigner { ////// The AccessDataSource associated with this designer. /// private AccessDataSource AccessDataSource { get { return (AccessDataSource)Component; } } ////// /// Implements the designer's version of the DataFile property. /// This is used to shadow the DataFile property of the /// runtime control. /// public string DataFile { get { return AccessDataSource.DataFile; } set { if (value != DataFile) { AccessDataSource.DataFile = value; UpdateDesignTimeHtml(); OnDataSourceChanged(EventArgs.Empty); } } } ////// Creates the appropriate wizard for the Configure Data Source task. /// internal override SqlDataSourceWizardForm CreateConfigureDataSourceWizardForm(IServiceProvider serviceProvider, IDataEnvironment dataEnvironment) { return new AccessDataSourceWizardForm(serviceProvider, this, dataEnvironment); } ////// /// Gets the data source's connection string. This is overridden to replace /// the runtime control's DataFile property with the mapped path so it can /// be used at design time. /// protected override string GetConnectionString() { return GetConnectionString(Component.Site, AccessDataSource); } ////// Helper method to map the DataFile property of an AccessDataSource to /// a physical path in order to get a design-time enabled connection string. /// internal static string GetConnectionString(IServiceProvider serviceProvider, AccessDataSource dataSource) { string originalDataFile = dataSource.DataFile; string connectionString; try { // If filename is missing, abort if (originalDataFile.Length == 0) { return null; } dataSource.DataFile = UrlPath.MapPath(serviceProvider, originalDataFile); // Calling the ConnectionString property will automatically // build the full connection string using the file path connectionString = dataSource.ConnectionString; } finally { dataSource.DataFile = originalDataFile; } return connectionString; } ////// /// Overridden by the designer to shadow various runtime properties /// with corresponding properties that it implements. /// protected override void PreFilterProperties(IDictionary properties) { base.PreFilterProperties(properties); // Shadow runtime DataFile property PropertyDescriptor property = (PropertyDescriptor)properties["DataFile"]; Debug.Assert(property != null); properties["DataFile"] = TypeDescriptor.CreateProperty(GetType(), property, new Attribute[0]); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ChameleonKey.cs
- ExpressionEditorAttribute.cs
- AccessKeyManager.cs
- UnsafeNativeMethodsPenimc.cs
- ExecutorLocksHeldException.cs
- Evidence.cs
- XmlNodeWriter.cs
- ScaleTransform.cs
- ExtractorMetadata.cs
- BufferModesCollection.cs
- EditCommandColumn.cs
- BadImageFormatException.cs
- WebPartsPersonalization.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- NativeMethods.cs
- ToolStripInSituService.cs
- SurrogateDataContract.cs
- WindowsBrush.cs
- isolationinterop.cs
- LinqDataSourceUpdateEventArgs.cs
- EncoderNLS.cs
- PassportAuthenticationModule.cs
- WpfWebRequestHelper.cs
- RightsManagementLicense.cs
- BufferModesCollection.cs
- SvcMapFileLoader.cs
- FtpWebResponse.cs
- Mutex.cs
- ReceiveContent.cs
- SQLInt32Storage.cs
- NonBatchDirectoryCompiler.cs
- FormViewRow.cs
- DataKey.cs
- TripleDESCryptoServiceProvider.cs
- FileSystemEventArgs.cs
- ObservableDictionary.cs
- TextUtf8RawTextWriter.cs
- DbFunctionCommandTree.cs
- SpellerError.cs
- AppearanceEditorPart.cs
- CultureInfo.cs
- baseaxisquery.cs
- StringWriter.cs
- CorrelationHandle.cs
- HostProtectionException.cs
- ToolTipAutomationPeer.cs
- Translator.cs
- UpdateCompiler.cs
- DivideByZeroException.cs
- SafeNativeMethods.cs
- MLangCodePageEncoding.cs
- WeakReferenceEnumerator.cs
- DesignerSerializerAttribute.cs
- Point.cs
- ValidatorUtils.cs
- OleDbReferenceCollection.cs
- WebPartAddingEventArgs.cs
- AnimatedTypeHelpers.cs
- GiveFeedbackEvent.cs
- Preprocessor.cs
- VirtualPathUtility.cs
- URLMembershipCondition.cs
- DataSourceControlBuilder.cs
- RtfFormatStack.cs
- CacheVirtualItemsEvent.cs
- PagesChangedEventArgs.cs
- TextStore.cs
- ExecutionEngineException.cs
- SqlBooleanMismatchVisitor.cs
- NeutralResourcesLanguageAttribute.cs
- ProcessHostConfigUtils.cs
- DataGridViewAccessibleObject.cs
- PointLight.cs
- MobileRedirect.cs
- PersistenceProvider.cs
- ImportContext.cs
- WeakReferenceEnumerator.cs
- Operators.cs
- DaylightTime.cs
- TraceListener.cs
- XsdValidatingReader.cs
- IndentedWriter.cs
- DateTimeOffsetAdapter.cs
- DeviceContexts.cs
- odbcmetadatacolumnnames.cs
- AffineTransform3D.cs
- PersonalizationStateInfoCollection.cs
- CssClassPropertyAttribute.cs
- UnsafeNativeMethodsCLR.cs
- AssociatedControlConverter.cs
- AutomationElementCollection.cs
- TreeViewEvent.cs
- DesignerDataSchemaClass.cs
- SystemFonts.cs
- ConnectionsZone.cs
- CodeDirectoryCompiler.cs
- ArithmeticException.cs
- RoleServiceManager.cs
- DESCryptoServiceProvider.cs
- CodeCommentStatement.cs