Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / DesignTimeValidationFeature.cs / 1305376 / DesignTimeValidationFeature.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System.Runtime; using System.Globalization; using System.Activities.Presentation.Validation; using System.Activities.Validation; using System.Collections.Generic; abstract class DesignTimeValidationFeature : Feature { public override void Initialize(EditingContext context, Type modelType) { if (modelType != this.ApplyTo) { throw FxTrace.Exception.AsError(new InvalidOperationException ( string.Format(CultureInfo.CurrentCulture, SR.DesignTimeValidationFeatureOnlyAppliesToType, this.GetType(), this.ApplyTo, modelType))); } ValidationService validationService = context.Services.GetService(); if (validationService != null) { validationService.Settings.AdditionalConstraints.Add(this.ApplyTo, this.DesignTimeConstraints); } } protected abstract Type ApplyTo { get; } protected abstract IList DesignTimeConstraints { get; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System.Runtime; using System.Globalization; using System.Activities.Presentation.Validation; using System.Activities.Validation; using System.Collections.Generic; abstract class DesignTimeValidationFeature : Feature { public override void Initialize(EditingContext context, Type modelType) { if (modelType != this.ApplyTo) { throw FxTrace.Exception.AsError(new InvalidOperationException ( string.Format(CultureInfo.CurrentCulture, SR.DesignTimeValidationFeatureOnlyAppliesToType, this.GetType(), this.ApplyTo, modelType))); } ValidationService validationService = context.Services.GetService (); if (validationService != null) { validationService.Settings.AdditionalConstraints.Add(this.ApplyTo, this.DesignTimeConstraints); } } protected abstract Type ApplyTo { get; } protected abstract IList DesignTimeConstraints { get; } } } // 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
- DataGridCell.cs
- CompilationLock.cs
- InputDevice.cs
- XamlSerializer.cs
- ProgressBarHighlightConverter.cs
- MdImport.cs
- RoutingChannelExtension.cs
- ClientUtils.cs
- LockCookie.cs
- TextMarkerSource.cs
- future.cs
- Menu.cs
- Constant.cs
- Comparer.cs
- InfoCardArgumentException.cs
- SendMailErrorEventArgs.cs
- ViewKeyConstraint.cs
- PrivacyNoticeElement.cs
- CustomExpression.cs
- HttpListener.cs
- DynamicResourceExtensionConverter.cs
- InputScopeAttribute.cs
- Operators.cs
- OrthographicCamera.cs
- TableRow.cs
- SqlError.cs
- HyperlinkAutomationPeer.cs
- NullableConverter.cs
- VisualTarget.cs
- TextServicesCompartment.cs
- CopyNodeSetAction.cs
- SqlDelegatedTransaction.cs
- UniqueID.cs
- DeadCharTextComposition.cs
- WindowsTab.cs
- XamlGridLengthSerializer.cs
- WebServiceEnumData.cs
- MenuItemAutomationPeer.cs
- GridViewUpdateEventArgs.cs
- UInt32Storage.cs
- StaticFileHandler.cs
- GPRECTF.cs
- WindowsUpDown.cs
- InputLanguageProfileNotifySink.cs
- PriorityRange.cs
- autovalidator.cs
- CodeAttributeDeclaration.cs
- PropertyPath.cs
- FreezableCollection.cs
- DataGridViewCellValidatingEventArgs.cs
- FrameworkTextComposition.cs
- TriggerBase.cs
- XmlNavigatorStack.cs
- AdCreatedEventArgs.cs
- SimpleBitVector32.cs
- WebConfigurationHostFileChange.cs
- SspiNegotiationTokenAuthenticator.cs
- CompiledQueryCacheEntry.cs
- ConnectorMovedEventArgs.cs
- WorkItem.cs
- AnnouncementInnerClientCD1.cs
- SmiContext.cs
- ActivityTrace.cs
- ContainerControlDesigner.cs
- DetectRunnableInstancesTask.cs
- TabletDeviceInfo.cs
- ProcessThreadCollection.cs
- FixedSOMLineRanges.cs
- DataRowChangeEvent.cs
- StringReader.cs
- CodeTypeReference.cs
- BindingGroup.cs
- ProcessInfo.cs
- TypeBuilderInstantiation.cs
- BitmapCache.cs
- PointLight.cs
- XPathEmptyIterator.cs
- ImportContext.cs
- DocumentScope.cs
- XmlQuerySequence.cs
- CopyAction.cs
- ConstructorNeedsTagAttribute.cs
- MessageQueuePermissionEntryCollection.cs
- EventToken.cs
- HttpCookiesSection.cs
- base64Transforms.cs
- BlockCollection.cs
- XXXOnTypeBuilderInstantiation.cs
- ClientRolePrincipal.cs
- PieceNameHelper.cs
- GlobalEventManager.cs
- PageEventArgs.cs
- HttpServerVarsCollection.cs
- XdrBuilder.cs
- PolygonHotSpot.cs
- MeasureData.cs
- ModelUIElement3D.cs
- HistoryEventArgs.cs
- COMException.cs
- ResourceReader.cs