• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ArgumentType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ArgumentType的典型用法代码示例。如果您正苦于以下问题:C# ArgumentType类的具体用法?C# ArgumentType怎么用?C# ArgumentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ArgumentType类属于命名空间,在下文中一共展示了ArgumentType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CommandLineArgumentAttribute

 internal CommandLineArgumentAttribute(ArgumentType argType, string name)
 {
     _argumentType = argType;
     Name = name;
     Shortcut = string.Empty;
     Description = string.Empty;
     ParameterDescription = string.Empty;
 }
开发者ID:snugglesftw,项目名称:Crm,代码行数:8,代码来源:CommandLineArgumentAttribute.cs


示例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" );
     }
 }
开发者ID:Shereef,项目名称:RTF-to-HTML-Converter-Class-Library-DLL,代码行数:9,代码来源:ToggleArgument.cs


示例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 ) );
        }
开发者ID:And-G,项目名称:Magellan,代码行数:11,代码来源:ParsedArguments.cs


示例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;
        }
开发者ID:DINKIN,项目名称:snes,代码行数:44,代码来源:InstructionsDecodeTable.cs


示例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);
        }
开发者ID:elenfant,项目名称:mff-programming-practices,代码行数:36,代码来源:ArgumentParser.cs


示例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);
        }
开发者ID:techarch,项目名称:ironruby,代码行数:9,代码来源:MetaOldClass.cs


示例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;
 }
开发者ID:Jacky1,项目名称:cassandra-sharp,代码行数:8,代码来源:CommandLineArguments.cs


示例8: ProcessArgumentEventArgs

 public ProcessArgumentEventArgs( ArgumentType type, string value )
     : this(type, value, "")
 {
 }
开发者ID:And-G,项目名称:Magellan,代码行数:4,代码来源:HandleArgumentEventArgs.cs


示例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;
 }
开发者ID:jaensen,项目名称:BrightstarDB,代码行数:8,代码来源:CommandLineArguments.cs


示例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;
 }
开发者ID:ZlayaZhaba,项目名称:XervBackup,代码行数:10,代码来源:CommandLineArgument.cs


示例11: ArgumentInstance

 public ArgumentInstance(AbstractConstraint constraint, object value)
 {
     Constraint = constraint;
     Type = ArgumentType.ArgumentRef;
     ReturnValue = value;
 }
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:6,代码来源:ArgumentManager.cs


示例12: ValueArgument

 // ----------------------------------------------------------------------
 public ValueArgument( ArgumentType argumentType )
     : base(argumentType | ArgumentType.ContainsValue, null, null)
 {
 }
开发者ID:CodeFork,项目名称:RtfConverter,代码行数:5,代码来源:ValueArgument.cs


示例13: NamedValueArgument

 // ----------------------------------------------------------------------
 public NamedValueArgument( ArgumentType argumentType, string name, object defaultValue )
     : base(argumentType | ArgumentType.ContainsValue | ArgumentType.HasName, name, defaultValue)
 {
 }
开发者ID:BGCX261,项目名称:zoominsumo-svn-to-git,代码行数:5,代码来源:NamedValueArgument.cs


示例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)
 {
 }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:7,代码来源:LocalizedArgumentAttribute.cs


示例15: Variable

 public Variable(string name, ArgumentType type)
 {
     this.name = name;
     this.type = type;
 }
开发者ID:akostiv,项目名称:pub,代码行数:5,代码来源:Variable.cs


示例16: ClassifiedArgument

 public ClassifiedArgument(ArgumentType argumentType, CommandParameterInfo parameterInfo, string value)
 {
     this.ArgumentType = argumentType;
     this.ParameterInfo = parameterInfo;
     this.Value = value;
 }
开发者ID:hakomikan,项目名称:CommandUtility,代码行数:6,代码来源:CommandLineParser.cs


示例17: ArgumentInfo

 public ArgumentInfo(string argName)
 {
     kind = ArgumentType.Named;
     name = argName;
 }
开发者ID:hazama-yuinyan,项目名称:Expresso,代码行数:5,代码来源:ArgumentInfo.cs


示例18: Argument

		// ----------------------------------------------------------------------
		protected Argument( ArgumentType argumentType, string name, object defaultValue )
		{
			this.name = name;
			this.argumentType = argumentType;
			this.defaultValue = defaultValue;
		} // Argument
开发者ID:haimon74,项目名称:KanNaim,代码行数:7,代码来源:Argument.cs


示例19: DefaultArgumentAttribute

 /// <summary>
 /// Indicates that this argument is the default argument.
 /// </summary>
 /// <param name="type"> Specifies the error checking to be done on the argument. </param>
 public DefaultArgumentAttribute(ArgumentType type)
     : base(type)
 {
 }
开发者ID:jaensen,项目名称:BrightstarDB,代码行数:8,代码来源:CommandLineArguments.cs


示例20: Argument

            public Argument(ArgumentAttribute attribute, FieldInfo field, ErrorReporter reporter)
            {
                this.longName = Parser.LongName (attribute, field);
                this.explicitShortName = Parser.ExplicitShortName (attribute);
                this.shortName = Parser.ShortName (attribute, field);
                this.hasHelpText = Parser.HasHelpText (attribute);
                this.helpText = Parser.HelpText (attribute);
                this.defaultValue = Parser.DefaultValue (attribute);
                this.elementType = ElementType (field);
                this.flags = Flags (attribute, field);
                this.field = field;
                this.SeenValue = false;
                this.reporter = reporter;
                this.isDefault = attribute != null && attribute is DefaultArgumentAttribute;

                if (this.IsCollection)
                    this.collectionValues = new ArrayList ();

                Debug.Assert (!String.IsNullOrEmpty (this.longName));
                Debug.Assert (!this.isDefault || !this.ExplicitShortName);
                Debug.Assert (!this.IsCollection || this.AllowMultiple, "Collection arguments must have allow multiple");
                Debug.Assert (!this.Unique || this.IsCollection, "Unique only applicable to collection arguments");
                Debug.Assert (IsValidElementType (this.Type) ||
                              IsCollectionType (this.Type));
                Debug.Assert ((this.IsCollection && IsValidElementType (this.elementType)) ||
                              (!this.IsCollection && this.elementType == null));
                Debug.Assert (!(this.IsRequired && this.HasDefaultValue), "Required arguments cannot have default value");
                Debug.Assert (!this.HasDefaultValue || (this.defaultValue.GetType () == field.FieldType),
                              "Type of default value must match field type");
            }
开发者ID:victorsamun,项目名称:NSimulator,代码行数:30,代码来源:Argument.cs



注:本文中的ArgumentType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ArgumentValues类代码示例发布时间:2022-05-24
下一篇:
C# ArgumentListSyntax类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap