1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.Workflow.Activities
{
using System;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Drawing.Design;
using System.Diagnostics.CodeAnalysis;
using System.Net.Security;
using System.Reflection;
using System.ServiceModel;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
[Browsable(true)]
[DesignerSerializer(typeof(DependencyObjectCodeDomSerializer), typeof(CodeDomSerializer))]
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public sealed class OperationParameterInfo : DependencyObject
{
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty AttributesProperty =
DependencyProperty.Register("Attributes",
typeof(ParameterAttributes), typeof(OperationParameterInfo),
new PropertyMetadata(DependencyPropertyOptions.Metadata));
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty NameProperty =
DependencyProperty.Register("Name",
typeof(string), typeof(OperationParameterInfo),
new PropertyMetadata(null, DependencyPropertyOptions.Metadata));
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty ParameterTypeProperty =
DependencyProperty.Register("ParameterType",
typeof(Type), typeof(OperationParameterInfo),
new PropertyMetadata(typeof(void), DependencyPropertyOptions.Metadata));
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty PositionProperty =
DependencyProperty.Register("Position",
typeof(int), typeof(OperationParameterInfo),
new PropertyMetadata(-1, DependencyPropertyOptions.Metadata));
public OperationParameterInfo()
{
}
public OperationParameterInfo(string parameterName)
{
SetValue(NameProperty, parameterName);
}
internal OperationParameterInfo(ParameterInfo parameter)
{
if (parameter == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parameter");
}
SetValue(OperationParameterInfo.NameProperty, parameter.Name);
SetValue(OperationParameterInfo.PositionProperty, parameter.Position);
SetValue(OperationParameterInfo.AttributesProperty, parameter.Attributes);
SetValue(OperationParameterInfo.ParameterTypeProperty, parameter.ParameterType);
}
public ParameterAttributes Attributes
{
get
{
return (ParameterAttributes) GetValue(AttributesProperty);
}
set
{
SetValue(AttributesProperty, value);
}
}
public bool IsIn
{
get
{
return ((this.Attributes & ParameterAttributes.In) != 0);
}
}
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
public bool IsLcid
{
get
{
return ((this.Attributes & ParameterAttributes.Lcid) != 0);
}
}
public bool IsOptional
{
get
{
return ((this.Attributes & ParameterAttributes.Optional) != 0);
}
}
public bool IsOut
{
get
{
return ((this.Attributes & ParameterAttributes.Out) != 0);
}
}
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
public bool IsRetval
{
get
{
return ((this.Attributes & ParameterAttributes.Retval) != 0);
}
}
public string Name
{
get
{
return (string) GetValue(NameProperty);
}
set
{
SetValue(NameProperty, value);
}
}
public Type ParameterType
{
get
{
return (Type) GetValue(ParameterTypeProperty);
}
set
{
SetValue(ParameterTypeProperty, value);
}
}
public int Position
{
get
{
return (int) GetValue(PositionProperty);
}
set
{
SetValue(PositionProperty, value);
}
}
public OperationParameterInfo Clone()
{
OperationParameterInfo clonedParameter = new OperationParameterInfo();
clonedParameter.Name = this.Name;
clonedParameter.Attributes = this.Attributes;
clonedParameter.Position = this.Position;
clonedParameter.ParameterType = this.ParameterType;
return clonedParameter;
}
public override bool Equals(object obj)
{
OperationParameterInfo parameter = obj as OperationParameterInfo;
if (parameter == null)
{
return false;
}
if (String.Compare(parameter.Name, this.Name, StringComparison.Ordinal) != 0)
{
return false;
}
if (parameter.Attributes != this.Attributes)
{
return false;
}
if (parameter.Position != this.Position)
{
return false;
}
if (parameter.ParameterType != this.ParameterType)
{
return false;
}
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
|