public ArgInfo(object arg) { if (arg == null) { kind = ArgKind.Null; return; } if (arg is IOutArg outArg) { kind = ArgKind.Out; type = outArg.Type; return; } if (arg is IRefArg refArg) { kind = ArgKind.Ref; type = refArg.Type; return; } if (arg is HostType) { kind = ArgKind.ByValue; type = typeof(HostType); return; } if (arg is HostMethod) { kind = ArgKind.ByValue; type = typeof(HostMethod); return; } if (arg is HostIndexedProperty) { kind = ArgKind.ByValue; type = typeof(HostIndexedProperty); return; } if (arg is ScriptMethod) { kind = ArgKind.ByValue; type = typeof(ScriptMethod); return; } if (arg is HostTarget hostTarget) { kind = ArgKind.ByValue; type = hostTarget.Type; return; } kind = ArgKind.ByValue; type = arg.GetType(); }
public ArgInfo(object arg) { if (arg == null) { kind = ArgKind.Null; return; } var outArg = arg as IOutArg; if (outArg != null) { kind = ArgKind.Out; type = outArg.Type; return; } var refArg = arg as IRefArg; if (refArg != null) { kind = ArgKind.Ref; type = refArg.Type; return; } var hostType = arg as HostType; if (hostType != null) { kind = ArgKind.ByValue; type = typeof(HostType); return; } var hostMethod = arg as HostMethod; if (hostMethod != null) { kind = ArgKind.ByValue; type = typeof(HostMethod); return; } var hostIndexedProperty = arg as HostIndexedProperty; if (hostIndexedProperty != null) { kind = ArgKind.ByValue; type = typeof(HostIndexedProperty); return; } var scriptMethod = arg as ScriptMethod; if (scriptMethod != null) { kind = ArgKind.ByValue; type = typeof(ScriptMethod); return; } var hostTarget = arg as HostTarget; if (hostTarget != null) { kind = ArgKind.ByValue; type = hostTarget.Type; return; } kind = ArgKind.ByValue; type = arg.GetType(); }
public InstructionAttribute(string explain, string instr, ArgKind arg) { Explain = explain; Instr = instr; Arg = arg; }