Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / ParameterBinding.cs / 1305376 / ParameterBinding.cs
namespace System.Workflow.ComponentModel { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.CodeDom; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.Design.Serialization; using System.Workflow.ComponentModel.Design; using System.Workflow.ComponentModel.Compiler; using System.Workflow.ComponentModel.Serialization; [Browsable(true)] [DesignerSerializer(typeof(DependencyObjectCodeDomSerializer), typeof(CodeDomSerializer))] public sealed class WorkflowParameterBinding : DependencyObject { public static readonly DependencyProperty ParameterNameProperty = DependencyProperty.Register("ParameterName", typeof(string), typeof(WorkflowParameterBinding), new PropertyMetadata(DependencyPropertyOptions.Metadata)); public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(object), typeof(WorkflowParameterBinding)); public WorkflowParameterBinding() { } public WorkflowParameterBinding(string parameterName) { SetValue(ParameterNameProperty, parameterName); } [DefaultValue(null)] public object Value { get { return GetValue(ValueProperty); } set { SetValue(ValueProperty, value); } } public string ParameterName { get { return (string)GetValue(ParameterNameProperty); } set { SetValue(ParameterNameProperty, value); } } } [Serializable] public sealed class WorkflowParameterBindingCollection: KeyedCollection{ private Activity ownerActivity = null; public WorkflowParameterBindingCollection(Activity ownerActivity) { if (ownerActivity == null) throw new ArgumentNullException("ownerActivity"); this.ownerActivity = ownerActivity; } public WorkflowParameterBinding GetItem(string key) { return this[key]; } protected override string GetKeyForItem(WorkflowParameterBinding item) { return item.ParameterName; } protected override void ClearItems() { if (!this.ownerActivity.DesignMode) throw new InvalidOperationException(SR.GetString(SR.Error_CanNotChangeAtRuntime)); base.ClearItems(); } protected override void InsertItem(int index, WorkflowParameterBinding item) { if (item == null) throw new ArgumentNullException("item"); if (!this.ownerActivity.DesignMode) throw new InvalidOperationException(SR.GetString(SR.Error_CanNotChangeAtRuntime)); if (Contains(item.ParameterName)) { WorkflowParameterBinding oldItem = this[item.ParameterName]; index = this.IndexOf(oldItem); RemoveItem(index); } base.InsertItem(index, item); } protected override void RemoveItem(int index) { if (!this.ownerActivity.DesignMode) throw new InvalidOperationException(SR.GetString(SR.Error_CanNotChangeAtRuntime)); base.RemoveItem(index); } protected override void SetItem(int index, WorkflowParameterBinding item) { if (item == null) throw new ArgumentNullException("item"); if (!this.ownerActivity.DesignMode) throw new InvalidOperationException(SR.GetString(SR.Error_CanNotChangeAtRuntime)); base.SetItem(index, item); } } } // 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
- KnownBoxes.cs
- DataPointer.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- PageContent.cs
- Grant.cs
- BitmapEffectInputConnector.cs
- XmlEventCache.cs
- ThrowHelper.cs
- DataGridPagingPage.cs
- XPathNodePointer.cs
- RowVisual.cs
- SQLRoleProvider.cs
- NotifyParentPropertyAttribute.cs
- ContainsRowNumberChecker.cs
- AttachedPropertyMethodSelector.cs
- LongSumAggregationOperator.cs
- ObjectDataSourceFilteringEventArgs.cs
- TreePrinter.cs
- StreamGeometry.cs
- PlacementWorkspace.cs
- figurelength.cs
- StringComparer.cs
- Int16Animation.cs
- Message.cs
- TimeSpanOrInfiniteConverter.cs
- SubMenuStyleCollectionEditor.cs
- WebPartVerbCollection.cs
- XPathQilFactory.cs
- PathTooLongException.cs
- DataViewSetting.cs
- SystemParameters.cs
- VisualBasicSettings.cs
- EntityParameterCollection.cs
- PrimitiveCodeDomSerializer.cs
- QueryOpcode.cs
- DataServiceQuery.cs
- DataExpression.cs
- VirtualizedCellInfoCollection.cs
- UpdateRecord.cs
- Vector3dCollection.cs
- EventLogReader.cs
- UInt32Converter.cs
- HttpListenerRequestUriBuilder.cs
- RepeaterCommandEventArgs.cs
- ControlValuePropertyAttribute.cs
- DateTimeStorage.cs
- ButtonRenderer.cs
- CachedCompositeFamily.cs
- DSASignatureDeformatter.cs
- BuilderPropertyEntry.cs
- BrowserCapabilitiesCodeGenerator.cs
- CryptoApi.cs
- GACIdentityPermission.cs
- QuaternionConverter.cs
- ADRoleFactoryConfiguration.cs
- TraceListener.cs
- ProgressPage.cs
- DataContractSerializerElement.cs
- EventHandlerList.cs
- CircleHotSpot.cs
- GcHandle.cs
- _ScatterGatherBuffers.cs
- AdCreatedEventArgs.cs
- DateTimeOffsetAdapter.cs
- InkCanvasSelection.cs
- SqlClientWrapperSmiStreamChars.cs
- TextParagraphCache.cs
- XmlSerializerOperationGenerator.cs
- HtmlHead.cs
- Validator.cs
- Preprocessor.cs
- PersonalizationDictionary.cs
- DbgCompiler.cs
- Style.cs
- HasActivatableWorkflowEvent.cs
- UserInitiatedNavigationPermission.cs
- ADMembershipUser.cs
- SocketConnection.cs
- SystemIPv6InterfaceProperties.cs
- HttpApplicationFactory.cs
- DataConnectionHelper.cs
- XXXInfos.cs
- StreamResourceInfo.cs
- ColorMatrix.cs
- SocketException.cs
- IpcChannelHelper.cs
- CacheModeValueSerializer.cs
- HttpStaticObjectsCollectionWrapper.cs
- TextParaClient.cs
- InputScopeManager.cs
- VirtualPathProvider.cs
- File.cs
- ListMarkerSourceInfo.cs
- XmlSchemaValidationException.cs
- StrokeSerializer.cs
- PageBreakRecord.cs
- TemplateNodeContextMenu.cs
- ETagAttribute.cs
- EnterpriseServicesHelper.cs
- BindingManagerDataErrorEventArgs.cs