本文整理汇总了C#中ArgumentType类的典型用法代码示例。如果您正苦于以下问题:C# ArgumentType类的具体用法?C# ArgumentType怎么用?C# ArgumentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArgumentType类属于命名空间,在下文中一共展示了ArgumentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommandLineArgumentAttribute
internal CommandLineArgumentAttribute(ArgumentType argType, string name)
{
_argumentType = argType;
Name = name;
Shortcut = string.Empty;
Description = string.Empty;
ParameterDescription = string.Empty;
}
示例2: ToggleArgument
// ----------------------------------------------------------------------
public ToggleArgument( ArgumentType argumentType, string name, bool defaultValue )
: base(argumentType | ArgumentType.HasName | ArgumentType.ContainsValue, name, defaultValue)
{
if ( name == null )
{
throw new ArgumentNullException( "name" );
}
}
示例3: OnProcessArgument
protected virtual void OnProcessArgument( ArgumentType type, string value )
{
ProcessArgumentHandler handler = null;
if ( type == ArgumentType.Parameter )
handler = ProcessParameter;
else
handler = ProcessOption;
if ( handler != null ) handler( this, new ProcessArgumentEventArgs( type, value ) );
}
示例4: GenericInst
public Instruction GenericInst(OpCodes code, AddressingModes addrMode, Action<GenericInstruction, int, int> exec, ArgumentType param1type = ArgumentType.None, ArgumentType param2type = ArgumentType.None)
{
var inst = new GenericInstruction(cpu, code, addrMode, param1type != ArgumentType.None) { runFunction = exec };
if (param1type != ArgumentType.None)
{
inst.decodeArgumentsFunction = delegate(GenericInstruction sender, Memory.MemoryBin bin, ref InstructionDecodeContext context, ref int offset, ref int param1, ref int param2)
{
switch (param1type)
{
case ArgumentType.None:
break;
default:
case ArgumentType.I1:
param1 = inst.DecodeInt1Argument(bin, ref offset);
break;
case ArgumentType.I2:
param1 = inst.DecodeInt2Argument(bin, ref offset);
break;
case ArgumentType.I3:
param1 = inst.DecodeInt3Argument(bin, ref offset);
break;
}
switch (param2type)
{
case ArgumentType.None:
break;
default:
case ArgumentType.I1:
param2 = inst.DecodeInt1Argument(bin, ref offset);
break;
case ArgumentType.I2:
param2 = inst.DecodeInt2Argument(bin, ref offset);
break;
case ArgumentType.I3:
param2 = inst.DecodeInt3Argument(bin, ref offset);
break;
}
};
}
return inst;
}
示例5: ParseCommandLine
internal List<string> ParseCommandLine(List<ProgramOption> optionList, string[] args)
{
/* initialize for new parsing */
expectedArgType = ArgumentType.ANY;
ProcessOptions(optionList);
List<string> arguments = new List<string>();
for (int argsPosition = 0; argsPosition < args.Length; argsPosition++) {
string arg = args[argsPosition];
ArgumentType currentArgType = GetArgumentType(arg);
switch (currentArgType) {
case ArgumentType.ARGUMENT:
ParseArgument(arg, arguments);
break;
case ArgumentType.OPTION_SHORT:
ParseShortOption(arg);
break;
case ArgumentType.OPTION_LONG:
bool continueParsing = ParseLongOption(arg);
if (!continueParsing) {
arguments.AddRange(args.Skip(argsPosition + 1));
argsPosition = args.Length;
}
break;
default:
/* should not happen as GetArgumentType(arg) returns only one from the above options (cases) */
throw new NotSupportedException("Unexpected currentArgType");
}
}
Log("\nPLAIN ARGUMENTS:");
Log(string.Join("\n", arguments.ToArray()));
return arguments;// as they are local variable for now (and not private parser field), we dont need to: new List<string>(arguments);
}
示例6: GetArgumentExpression
private static Expression GetArgumentExpression(CallSignature signature, ArgumentType kind, ref int unusedCount, DynamicMetaObject/*!*/[]/*!*/ args) {
int index = signature.IndexOf(kind);
if (index != -1) {
unusedCount--;
return args[index].Expression;
}
return AstUtils.Constant(null);
}
示例7: ArgumentAttribute
/// <summary>
/// Allows control of command line parsing.
/// </summary>
/// <param name="type"> Specifies the error checking to be done on the argument. </param>
public ArgumentAttribute(ArgumentType type)
{
_type = type;
}
示例8: ProcessArgumentEventArgs
public ProcessArgumentEventArgs( ArgumentType type, string value )
: this(type, value, "")
{
}
示例9: ArgumentAttribute
/// <summary>
/// Allows control of command line parsing.
/// </summary>
/// <param name="type"> Specifies the error checking to be done on the argument. </param>
public ArgumentAttribute(ArgumentType type)
{
this.type = type;
}
示例10: CommandLineArgument
/// <summary>
/// Creates a new CommandLineArgument instance
/// </summary>
/// <param name="name">The name of the argument</param>
/// <param name="type">The argument type</param>
public CommandLineArgument(string name, ArgumentType type)
: this(name)
{
m_type = type;
}
示例11: ArgumentInstance
public ArgumentInstance(AbstractConstraint constraint, object value)
{
Constraint = constraint;
Type = ArgumentType.ArgumentRef;
ReturnValue = value;
}
示例12: ValueArgument
// ----------------------------------------------------------------------
public ValueArgument( ArgumentType argumentType )
: base(argumentType | ArgumentType.ContainsValue, null, null)
{
}
示例13: NamedValueArgument
// ----------------------------------------------------------------------
public NamedValueArgument( ArgumentType argumentType, string name, object defaultValue )
: base(argumentType | ArgumentType.ContainsValue | ArgumentType.HasName, name, defaultValue)
{
}
示例14: LocalizedArgumentAttribute
/// <summary>
/// Allows control of command line parsing.
/// </summary>
/// <param name="type"> Specifies the error checking to be done on the argument. </param>
public LocalizedArgumentAttribute(ArgumentType type) : base(type)
{
}
示例15: Variable
public Variable(string name, ArgumentType type)
{
this.name = name;
this.type = type;
}