本文整理汇总了C#中Parameter类的典型用法代码示例。如果您正苦于以下问题:C# Parameter类的具体用法?C# Parameter怎么用?C# Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Parameter类属于命名空间,在下文中一共展示了Parameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ExtractActualComParameterObject
private Parameter ExtractActualComParameterObject(Parameter parameter)
{
var type = parameter.GetType();
var method = type.GetMethod("GetParm", BindingFlags.Instance | BindingFlags.NonPublic);
var actualParameter = method.Invoke(parameter, null);
return (Parameter) actualParameter;
}
开发者ID:leloulight,项目名称:Core,代码行数:7,代码来源:ComInterfacesTests.cs
示例2: ContainerGetUrlMethod
public ContainerGetUrlMethod()
{
Visibility = Visibility.Private;
Name = "GetUrl";
Parameters = new Parameter[] { };
ReturnType = new Type(new Identifier("System", "Uri"));
}
开发者ID:iambmelt,项目名称:Vipr,代码行数:7,代码来源:ContainerGetUrlMethod.cs
示例3: Method
public Method(MethodDefinition method)
{
Name = method.Name;
NameWithTypes = BuildNameWithTypes(method);
if (method.IsPublic)
Access = "public";
else if (method.IsFamily)
Access = "protected";
if(method.ReturnType.FullName != "System.Void")
ReturnType = method.ReturnType.ToXdgUrl();
XmlNode doc = Xdg.FindXmlDoc(method);
if (doc != null)
{
Summary = doc.GetElementContent("summary");
Remarks = doc.GetElementContent("remarks");
ReturnDocs = doc.GetElementContent("returns");
}
Parameters = new List<Parameter>();
foreach (ParameterDefinition p in method.Parameters)
{
Parameter param = new Parameter();
param.Name = p.Name;
param.Type = p.ParameterType.ToXdgUrl();
if(doc != null)
param.Doc = doc.GetElementContent("param[@name=\""+p.Name+"\"]");
Parameters.Add(param);
}
}
开发者ID:Kortni,项目名称:XDG,代码行数:33,代码来源:Method.cs
示例4: TryInvokeMember
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
{
var functionName = binder.Name;
try
{
// convert arguments to Parameter
var parameters = new Parameter[args.Length];
for (int i = 0; i < args.Length; i++)
{
parameters[i] = new Parameter(args[i]);
}
Function.SetEntRef(_entRef);
result = Function.Call(functionName, typeof(object), parameters);
return true;
}
catch (Exception ex)
{
Log.Error(ex);
result = null;
return false;
}
}
开发者ID:cubedj,项目名称:fourdeltaone,代码行数:28,代码来源:ScriptDynamics.cs
示例5: Parser
static Parser()
{
CreateTrigger = delegate (DependencyObject target, string triggerText) {
if (triggerText == null)
{
return ConventionManager.GetElementConvention(target.GetType()).CreateTrigger();
}
string str = triggerText.Replace("[", string.Empty).Replace("]", string.Empty).Replace("Event", string.Empty).Trim();
return new System.Windows.Interactivity.EventTrigger { EventName = str };
};
InterpretMessageText = (target, text) => new ActionMessage { MethodName = Regex.Replace(text, "^Action", string.Empty).Trim() };
CreateParameter = delegate (DependencyObject target, string parameterText) {
Parameter actualParameter = new Parameter();
if (parameterText.StartsWith("'") && parameterText.EndsWith("'"))
{
actualParameter.Value = parameterText.Substring(1, parameterText.Length - 2);
}
else if (MessageBinder.SpecialValues.ContainsKey(parameterText.ToLower()) || char.IsNumber(parameterText[0]))
{
actualParameter.Value = parameterText;
}
else if (target is FrameworkElement)
{
FrameworkElement fe = (FrameworkElement) target;
string[] nameAndBindingMode = (from x in parameterText.Split(new char[] { ':' }) select x.Trim()).ToArray<string>();
int index = nameAndBindingMode[0].IndexOf('.');
View.ExecuteOnLoad(fe, (, ) => BindParameter(fe, actualParameter, (index == -1) ? nameAndBindingMode[0] : nameAndBindingMode[0].Substring(0, index), (index == -1) ? null : nameAndBindingMode[0].Substring(index + 1), (nameAndBindingMode.Length == 2) ? ((BindingMode) Enum.Parse(typeof(BindingMode), nameAndBindingMode[1], true)) : BindingMode.OneWay));
}
return actualParameter;
};
}
开发者ID:BigBri41,项目名称:TWCTVWindowsPhone,代码行数:31,代码来源:Parser.cs
示例6: SetControl
public void SetControl(Parameter par)
{
NameLabel.InnerText = par.Name;
DescriptionLabel.InnerText = par.Description;
if (par.Type == "System.String")
{
TextInput.Visible = true;
TextInput.Value = par.Value;
}
if (par.Type == "System.Integer")
{
NumInput.Visible = true;
NumInput.Value = par.Value;
}
if (par.Type == "System.Boolean")
{
CheckInput.Visible = true;
if (par.Value == "True")
{
CheckInput.Checked = true;
}
else
{
CheckInput.Checked = false;
}
}
}
开发者ID:glushevsky,项目名称:myproject1,代码行数:27,代码来源:ParameterControl.ascx.cs
示例7: Construct5
public void Construct5()
{
var parameter = new Parameter("param1", 5.0);
Assert.AreEqual("param1", parameter.Name);
Assert.AreEqual(0, parameter.DispId);
Assert.AreEqual("5", parameter.Value);
}
开发者ID:Supermortal,项目名称:MusicianHelper,代码行数:7,代码来源:ParameterFixture.cs
示例8: CreateWithIntTypeAndValue
public void CreateWithIntTypeAndValue()
{
const int newParameterValue = 10;
var parameter = new Parameter<int> {Value = newParameterValue};
Assert.AreEqual(newParameterValue, parameter.Value);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:ParameterTest.cs
示例9: CreateWithBooleanTypeAndValue
public void CreateWithBooleanTypeAndValue()
{
const bool newParameterValue = true;
var parameter = new Parameter<bool> { Value = newParameterValue };
Assert.AreEqual(newParameterValue, parameter.Value);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:ParameterTest.cs
示例10: DefaultValueForIntType
public void DefaultValueForIntType()
{
var defaultParameterValue = new Parameter<int>().DefaultValue;
const int expectedValue = 0;
Assert.AreEqual(expectedValue, defaultParameterValue);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:ParameterTest.cs
示例11: CreateWithIntTypeAndNoValue
public void CreateWithIntTypeAndNoValue()
{
var parameter = new Parameter<int>();
const int expectedValue = 0;
Assert.AreEqual(expectedValue, parameter.Value);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:ParameterTest.cs
示例12: SMART_TARGET_CLOSEST_CREATURE
public SMART_TARGET_CLOSEST_CREATURE()
: base(19, "Closest creature")
{
parameters[0] = new CreatureParameter("CreatureEntry(0any)");
parameters[1] = new Parameter("maxDist");
parameters[2] = new Parameter("dead?");
}
开发者ID:armano2,项目名称:VisualSAIStudio,代码行数:7,代码来源:Targets.cs
示例13: CreateFunctionScalarPropertyTreeCommand
/// <summary>
/// Creates a FunctionScalarProperty element (potentially within multiple ComplexProperty elements) that
/// maps the Property at the bottom of the passed in property chain to the passed in Parameter
/// within the passed in ModificationFunction.
/// </summary>
/// <param name="modificationFunction">ultimate parent for ScalarProperty created by this</param>
/// <param name="propertyChain">property to be inserted, preceded by its ComplexProperty parents if appropriate</param>
/// <param name="navPropPointingToProperty">
/// Optional - if present indicates the Scalar Property at
/// the bottom of the propertyChain was reached via a NavProp (propertyChain will have only 1 Property)
/// </param>
/// <param name="parameter">The sproc parameter to which we will map</param>
internal CreateFunctionScalarPropertyTreeCommand(
ModificationFunction modificationFunction, List<Property> propertyChain,
NavigationProperty navPropPointingToProperty, Parameter parameter, string version)
{
CommandValidation.ValidateModificationFunction(modificationFunction);
CommandValidation.ValidateParameter(parameter);
if (null != navPropPointingToProperty)
{
CommandValidation.ValidateNavigationProperty(navPropPointingToProperty);
}
Debug.Assert(propertyChain.Count > 0, "Properties list should contain at least one element");
_modificationFunction = modificationFunction;
_propertyChain = propertyChain;
_navPropPointingToProperty = navPropPointingToProperty;
if (_navPropPointingToProperty != null)
{
Debug.Assert(
propertyChain.Count == 1,
"When creating a FunctionScalarProperty via a NavigationProperty propertyChain should have only 1 element, but it has "
+ propertyChain.Count);
}
_parameter = parameter;
Debug.Assert(
string.IsNullOrEmpty(version)
|| ModelConstants.FunctionScalarPropertyVersionOriginal.Equals(version, StringComparison.Ordinal)
|| ModelConstants.FunctionScalarPropertyVersionCurrent.Equals(version, StringComparison.Ordinal),
"version should be empty or " + ModelConstants.FunctionScalarPropertyVersionOriginal + " or "
+ ModelConstants.FunctionScalarPropertyVersionCurrent + ". Actual value: " + version);
_version = version;
}
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:43,代码来源:CreateFunctionScalarPropertyTreeCommand.cs
示例14: CheckForEnumValue
private static bool CheckForEnumValue(Parameter parameter, Type desugared)
{
var enumItem = parameter.DefaultArgument.Declaration as Enumeration.Item;
if (enumItem != null)
{
parameter.DefaultArgument.String = string.Format("{0}{1}{2}.{3}",
desugared.IsPrimitiveType() ? "(int) " : string.Empty,
string.IsNullOrEmpty(enumItem.Namespace.Namespace.Name)
? string.Empty
: enumItem.Namespace.Namespace.Name + ".", enumItem.Namespace.Name, enumItem.Name);
return true;
}
var call = parameter.DefaultArgument.Declaration as Function;
if (call != null || parameter.DefaultArgument.Class == StatementClass.BinaryOperator)
{
string @params = regexFunctionParams.Match(parameter.DefaultArgument.String).Groups[1].Value;
if (@params.Contains("::"))
parameter.DefaultArgument.String = regexDoubleColon.Replace(@params, desugared + ".");
else
parameter.DefaultArgument.String = regexName.Replace(@params, desugared + ".$1");
return true;
}
return false;
}
开发者ID:vovkasm,项目名称:CppSharp,代码行数:25,代码来源:HandleDefaultParamValuesPass.cs
示例15: EndBlock
private void EndBlock()
{
AddParameter(parameter);
parameter = new Parameter();
PullParent();
parserState = ParserState.BeginParameterName;
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:Parser.cs
示例16: AddParameter
private void AddParameter(Parameter<API> parameter)
{
ListViewItem item = new ListViewItem(parameter.ToString());
item.Tag = parameter;
parametersListView.Items.Add(item);
}
开发者ID:QuantumConcepts,项目名称:CodeGenerator,代码行数:7,代码来源:EditAPI.cs
示例17: MappedInvocation
public MappedInvocation(NRefactory.ConstructorDeclaration ctor, MethodDefinition baseCtor) {
var parameterTypes = new List<Type>();
var ctorType = ctor.GetActualType();
_parameters = ctor.Parameters
.Select((p, i) => {
return new Parameter(p.Name, p.GetActualType(), i);
})
.ToArray();
_parameterDeclarations = ctor.Parameters.ToArray();
_visitor.VisitConstructorDeclaration(ctor, null);
_outParameters = new List<Parameter>();
parameterTypes = new List<Type>();
_parameters.ForEach((p, i) => {
var type = p.Type;
if (_visitor.Contains(p.Name)) {
if (!type.IsByRef) {
type = type.MakeByRefType();
p = new Parameter(p.Name, type, p.Location);
}
_outParameters.Add(p);
}
parameterTypes.Add(type);
});
VerifyUniqueness(ctorType, parameterTypes);
Parameters = parameterTypes.ToArray();
}
开发者ID:sagifogel,项目名称:NJection.LambdaConverter,代码行数:33,代码来源:MappedInvocation.cs
示例18: OnLoadFromConfig
protected override void OnLoadFromConfig(ConfigNode node)
{
base.OnLoadFromConfig(node);
parameter = ConfigNodeUtil.ParseValue<Parameter>(node, "parameter");
value = ConfigNodeUtil.ParseValue<float>(node, "value");
}
开发者ID:jrossignol,项目名称:Strategia,代码行数:7,代码来源:CareerParameterOverride.cs
示例19: GetServices
public static Schema.KRPC.Services GetServices()
{
var services = new Schema.KRPC.Services ();
foreach (var serviceSignature in Services.Instance.Signatures.Values) {
var service = new Schema.KRPC.Service ();
service.Name = serviceSignature.Name;
foreach (var procedureSignature in serviceSignature.Procedures.Values) {
var procedure = new Procedure ();
procedure.Name = procedureSignature.Name;
if (procedureSignature.HasReturnType)
{
procedure.HasReturnType = true;
procedure.ReturnType = TypeUtils.GetTypeName (procedureSignature.ReturnType);
}
foreach (var parameterSignature in procedureSignature.Parameters) {
var parameter = new Parameter ();
parameter.Name = parameterSignature.Name;
parameter.Type = TypeUtils.GetTypeName (parameterSignature.Type);
if (parameterSignature.HasDefaultArgument)
{
parameter.HasDefaultArgument = true;
parameter.DefaultArgument = parameterSignature.DefaultArgument;
}
procedure.Parameters.Add (parameter);
}
foreach (var attribute in procedureSignature.Attributes) {
procedure.Attributes.Add (attribute);
}
if (procedureSignature.Documentation != "")
procedure.Documentation = procedureSignature.Documentation;
service.Procedures.Add (procedure);
}
foreach (var clsSignature in serviceSignature.Classes.Values) {
var cls = new Class ();
cls.Name = clsSignature.Name;
if (clsSignature.Documentation != "")
cls.Documentation = clsSignature.Documentation;
service.Classes.Add (cls);
}
foreach (var enmSignature in serviceSignature.Enumerations.Values) {
var enm = new Enumeration ();
enm.Name = enmSignature.Name;
if (enmSignature.Documentation != "")
enm.Documentation = enmSignature.Documentation;
foreach (var enmValueSignature in enmSignature.Values) {
var enmValue = new EnumerationValue ();
enmValue.Name = enmValueSignature.Name;
enmValue.Value = enmValueSignature.Value;
if (enmValueSignature.Documentation != "")
enmValue.Documentation = enmValueSignature.Documentation;
enm.Values.Add (enmValue);
}
service.Enumerations.Add (enm);
}
if (serviceSignature.Documentation != "")
service.Documentation = serviceSignature.Documentation;
services.Services_.Add (service);
}
return services;
}
开发者ID:artwhaley,项目名称:krpc,代码行数:60,代码来源:KRPC.cs
示例20: Deserialize
/// <summary>
/// Obtains the type and value of a parameter from an XML Error file.
/// </summary>
/// <param name="reader">XML Error file.</param>
/// <param name="parameter">Parameter to obtain.</param>
/// <returns>Parameter.</returns>
public static Parameter Deserialize(XmlReader reader, Parameter parameter)
{
if (reader.IsStartElement(DTD.Error.ErrorParams.TagErrorParam))
{
if (parameter == null)
{
parameter = new Parameter();
}
// Read Attributes of Node.
parameter.Key = reader.GetAttribute(DTD.Error.ErrorParams.TagKey);
switch (reader.GetAttribute(DTD.Error.ErrorParams.TagType))
{
case ResponseException.ErrorKey:
parameter.Type = ErrorParamType.Key;
break;
case ResponseException.ErrorLiteral:
parameter.Type = ErrorParamType.Literal;
break;
}
if (!reader.IsEmptyElement)
{
parameter.Text = reader.ReadString();
}
else
{
reader.Skip();
}
}
return parameter;
}
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:38,代码来源:Error.Serializer.cs
注:本文中的Parameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论