Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Design / ExtenderHelpers.cs / 1305376 / ExtenderHelpers.cs
#pragma warning disable 1634, 1691
namespace System.Workflow.ComponentModel.Design
{
using System;
using System.IO;
using System.Drawing;
using System.CodeDom;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
using System.ComponentModel;
using System.Globalization;
using System.Drawing.Design;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Collections.Specialized;
using System.ComponentModel.Design.Serialization;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Workflow.ComponentModel.Design;
using System.Runtime.Serialization.Formatters.Binary;
//
#region Class ExtenderHelpers
internal static class ExtenderHelpers
{
internal static void FilterDependencyProperties(IServiceProvider serviceProvider, Activity activity)
{
IExtenderListService extenderListService = serviceProvider.GetService(typeof(IExtenderListService)) as IExtenderListService;
if (extenderListService != null)
{
Dictionary dependencyProperyies = new Dictionary();
foreach (DependencyProperty property in activity.MetaDependencyProperties)
dependencyProperyies.Add(property.Name, property);
List disallowedProperties = new List();
foreach (IExtenderProvider extenderProvider in extenderListService.GetExtenderProviders())
{
if (!extenderProvider.CanExtend(activity))
{
ProvidePropertyAttribute[] propertyAttributes = extenderProvider.GetType().GetCustomAttributes(typeof(ProvidePropertyAttribute), true) as ProvidePropertyAttribute[];
foreach (ProvidePropertyAttribute propertyAttribute in propertyAttributes)
disallowedProperties.Add(propertyAttribute.PropertyName);
}
}
foreach (string propertyName in disallowedProperties)
{
if (dependencyProperyies.ContainsKey(propertyName))
activity.RemoveProperty(dependencyProperyies[propertyName]);
}
}
}
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma warning disable 1634, 1691
namespace System.Workflow.ComponentModel.Design
{
using System;
using System.IO;
using System.Drawing;
using System.CodeDom;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
using System.ComponentModel;
using System.Globalization;
using System.Drawing.Design;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Collections.Specialized;
using System.ComponentModel.Design.Serialization;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Workflow.ComponentModel.Design;
using System.Runtime.Serialization.Formatters.Binary;
//
#region Class ExtenderHelpers
internal static class ExtenderHelpers
{
internal static void FilterDependencyProperties(IServiceProvider serviceProvider, Activity activity)
{
IExtenderListService extenderListService = serviceProvider.GetService(typeof(IExtenderListService)) as IExtenderListService;
if (extenderListService != null)
{
Dictionary dependencyProperyies = new Dictionary();
foreach (DependencyProperty property in activity.MetaDependencyProperties)
dependencyProperyies.Add(property.Name, property);
List disallowedProperties = new List();
foreach (IExtenderProvider extenderProvider in extenderListService.GetExtenderProviders())
{
if (!extenderProvider.CanExtend(activity))
{
ProvidePropertyAttribute[] propertyAttributes = extenderProvider.GetType().GetCustomAttributes(typeof(ProvidePropertyAttribute), true) as ProvidePropertyAttribute[];
foreach (ProvidePropertyAttribute propertyAttribute in propertyAttributes)
disallowedProperties.Add(propertyAttribute.PropertyName);
}
}
foreach (string propertyName in disallowedProperties)
{
if (dependencyProperyies.ContainsKey(propertyName))
activity.RemoveProperty(dependencyProperyies[propertyName]);
}
}
}
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextEditor.cs
- InteropAutomationProvider.cs
- TextRunTypographyProperties.cs
- __Error.cs
- GACMembershipCondition.cs
- IRCollection.cs
- DefaultBinder.cs
- DataTableTypeConverter.cs
- StyleBamlTreeBuilder.cs
- XmlDomTextWriter.cs
- HttpStreams.cs
- SqlInternalConnection.cs
- ADRoleFactory.cs
- Monitor.cs
- HtmlInputHidden.cs
- Utils.cs
- shaperfactoryquerycacheentry.cs
- InputProcessorProfiles.cs
- WebScriptEndpoint.cs
- LinkLabelLinkClickedEvent.cs
- Decoder.cs
- CanonicalFontFamilyReference.cs
- EventsTab.cs
- WindowPatternIdentifiers.cs
- GregorianCalendarHelper.cs
- DependencyPropertyValueSerializer.cs
- BaseCollection.cs
- DataGridViewCell.cs
- ZipFileInfoCollection.cs
- NavigationCommands.cs
- CommandCollectionEditor.cs
- Brush.cs
- ResourceLoader.cs
- FormViewActionList.cs
- BoundingRectTracker.cs
- Timer.cs
- OdbcStatementHandle.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ProtocolViolationException.cs
- FunctionImportMapping.cs
- WindowsListViewSubItem.cs
- EdmScalarPropertyAttribute.cs
- FunctionOverloadResolver.cs
- GeometryCollection.cs
- TargetControlTypeCache.cs
- Pens.cs
- AudioStateChangedEventArgs.cs
- XmlSchemaImport.cs
- Model3D.cs
- DtcInterfaces.cs
- DataGridViewComboBoxCell.cs
- HtmlInputPassword.cs
- TimeSpanValidatorAttribute.cs
- TextTreeRootNode.cs
- QuaternionRotation3D.cs
- InternalBufferOverflowException.cs
- ColorConverter.cs
- ThicknessKeyFrameCollection.cs
- SoapHeaderException.cs
- IdnMapping.cs
- FormatterConverter.cs
- LogEntrySerialization.cs
- RegexFCD.cs
- UshortList2.cs
- EmbeddedMailObject.cs
- FixedFlowMap.cs
- AnnotationElement.cs
- HttpCapabilitiesBase.cs
- RegexInterpreter.cs
- _SpnDictionary.cs
- ThemeConfigurationDialog.cs
- cookiecontainer.cs
- StorageConditionPropertyMapping.cs
- Thickness.cs
- NativeObjectSecurity.cs
- CheckedListBox.cs
- CmsInterop.cs
- TreeView.cs
- ProtocolImporter.cs
- TargetParameterCountException.cs
- TiffBitmapEncoder.cs
- FormsAuthentication.cs
- DESCryptoServiceProvider.cs
- X509SubjectKeyIdentifierClause.cs
- DataGridViewCellPaintingEventArgs.cs
- QueryRewriter.cs
- HtmlInputButton.cs
- DataGridViewToolTip.cs
- DecoderFallback.cs
- ContractUtils.cs
- UserControlAutomationPeer.cs
- BamlStream.cs
- SynchronizingStream.cs
- AncestorChangedEventArgs.cs
- IODescriptionAttribute.cs
- FamilyCollection.cs
- PeerPresenceInfo.cs
- AutoGeneratedFieldProperties.cs
- SerialStream.cs
- DbConnectionFactory.cs