Code:
/ 4.0 / 4.0 / 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. 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
- FieldToken.cs
- ProtectedConfigurationSection.cs
- XomlCompilerHelpers.cs
- MouseCaptureWithinProperty.cs
- QueryConverter.cs
- ColorKeyFrameCollection.cs
- HtmlAnchor.cs
- ImplicitInputBrush.cs
- Char.cs
- RootAction.cs
- BlurBitmapEffect.cs
- GlyphsSerializer.cs
- InputLanguageSource.cs
- BitSet.cs
- DbParameterHelper.cs
- DesignerEventService.cs
- InstanceDescriptor.cs
- ObjectDataSourceDisposingEventArgs.cs
- ConnectionManagementElement.cs
- CompilerGeneratedAttribute.cs
- DataGridViewSelectedColumnCollection.cs
- SafeLibraryHandle.cs
- BuildManagerHost.cs
- DrawToolTipEventArgs.cs
- XmlTypeAttribute.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- TdsParserSessionPool.cs
- FontStretchConverter.cs
- AssemblyName.cs
- WebBaseEventKeyComparer.cs
- StorageMappingItemLoader.cs
- WindowCollection.cs
- GetCryptoTransformRequest.cs
- TemplateComponentConnector.cs
- SQLRoleProvider.cs
- BufferedGraphics.cs
- PointHitTestParameters.cs
- HandlerBase.cs
- _Events.cs
- Message.cs
- ComboBox.cs
- CollectionContainer.cs
- AlternateViewCollection.cs
- DependencySource.cs
- DeadCharTextComposition.cs
- TypedTableHandler.cs
- RoutedPropertyChangedEventArgs.cs
- BinaryObjectWriter.cs
- ListViewPagedDataSource.cs
- BasePattern.cs
- DesignerTransaction.cs
- WebDisplayNameAttribute.cs
- TreeWalkHelper.cs
- DesignerVerbCollection.cs
- DataGridRowHeaderAutomationPeer.cs
- Button.cs
- Keywords.cs
- HtmlTableRowCollection.cs
- KeyFrames.cs
- Int16.cs
- Attribute.cs
- InputScope.cs
- SystemIPv6InterfaceProperties.cs
- PrintPageEvent.cs
- BasicBrowserDialog.designer.cs
- SqlUtils.cs
- StylusPoint.cs
- PrintDialog.cs
- OutOfProcStateClientManager.cs
- MessageBox.cs
- DaylightTime.cs
- WebPartConnectVerb.cs
- DeferredTextReference.cs
- AuthorizationBehavior.cs
- OutgoingWebResponseContext.cs
- JapaneseCalendar.cs
- TableAutomationPeer.cs
- SoapSchemaMember.cs
- TakeOrSkipQueryOperator.cs
- ByteAnimationUsingKeyFrames.cs
- ViewBase.cs
- TableLayoutPanelDesigner.cs
- MessageCredentialType.cs
- SqlMethodTransformer.cs
- HttpPostedFile.cs
- ELinqQueryState.cs
- JsonFormatGeneratorStatics.cs
- Activator.cs
- PrefixHandle.cs
- RtfFormatStack.cs
- _NegoState.cs
- TimeStampChecker.cs
- QueryResults.cs
- ErrorFormatterPage.cs
- DataGridViewCellParsingEventArgs.cs
- AliasExpr.cs
- ObjectResult.cs
- TransportOutputChannel.cs
- AccessViolationException.cs
- PageContentAsyncResult.cs