当前位置: 首页>>代码示例>>C#>>正文


C# Arguments类代码示例

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


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

示例1: GenerateBuildVersion

 public void GenerateBuildVersion()
 {
     var arguments = new Arguments();
     var versionBuilder = new ContinuaCi(arguments);
     var continuaCiVersion = versionBuilder.GenerateSetVersionMessage("0.0.0-Beta4.7");
     Assert.AreEqual("@@continua[setBuildVersion value='0.0.0-Beta4.7']", continuaCiVersion);
 }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:7,代码来源:ContinuaCiTests.cs

示例2: mouseClick

 /// <summary>
 /// Waits until the mouse is clicked, then start another coroutine.
 /// </summary>
 /// <returns></returns>
 IEnumerator mouseClick(Arguments args)
 {
     while (!Input.GetMouseButtonDown(0)) yield return null;
     args.speed = _speed; // Use the correct speed.
     args.startPosition = Input.mousePosition; // Get first mouse position
     StartCoroutine(mouseRelease(args)); // wait for release button, then continue
 }
开发者ID:Godball,项目名称:godball,代码行数:11,代码来源:Gust.cs

示例3: Run

        public static void Run(Arguments arguments, IFileSystem fileSystem)
        {
            Logger.WriteInfo(string.Format("Running on {0}.", runningOnMono ? "Mono" : "Windows"));

            var noFetch = arguments.NoFetch;
            var authentication = arguments.Authentication;
            var targetPath = arguments.TargetPath;
            var targetUrl = arguments.TargetUrl;
            var dynamicRepositoryLocation = arguments.DynamicRepositoryLocation;
            var targetBranch = arguments.TargetBranch;
            var commitId = arguments.CommitId;
            var overrideConfig = arguments.HasOverrideConfig ? arguments.OverrideConfig : null;

            var executeCore = new ExecuteCore(fileSystem);
            var variables = executeCore.ExecuteGitVersion(targetUrl, dynamicRepositoryLocation, authentication, targetBranch, noFetch, targetPath, commitId, overrideConfig);

            if (arguments.Output == OutputType.BuildServer)
            {
                foreach (var buildServer in BuildServerList.GetApplicableBuildServers())
                {
                    buildServer.WriteIntegration(Console.WriteLine, variables);
                }
            }

            if (arguments.Output == OutputType.Json)
            {
                switch (arguments.ShowVariable)
                {
                    case null:
                        Console.WriteLine(JsonOutputFormatter.ToJson(variables));
                        break;

                    default:
                        string part;
                        if (!variables.TryGetValue(arguments.ShowVariable, out part))
                        {
                            throw new WarningException(string.Format("'{0}' variable does not exist", arguments.ShowVariable));
                        }
                        Console.WriteLine(part);
                        break;
                }
            }

            using (var assemblyInfoUpdate = new AssemblyInfoFileUpdate(arguments, targetPath, variables, fileSystem))
            {
                var execRun = RunExecCommandIfNeeded(arguments, targetPath, variables);
                var msbuildRun = RunMsBuildIfNeeded(arguments, targetPath, variables);
                if (!execRun && !msbuildRun)
                {
                    assemblyInfoUpdate.DoNotRestoreAssemblyInfo();
                    //TODO Put warning back
                    //if (!context.CurrentBuildServer.IsRunningInBuildAgent())
                    //{
                    //    Console.WriteLine("WARNING: Not running in build server and /ProjectFile or /Exec arguments not passed");
                    //    Console.WriteLine();
                    //    Console.WriteLine("Run GitVersion.exe /? for help");
                    //}
                }
            }
        }
开发者ID:qetza,项目名称:GitVersion,代码行数:60,代码来源:SpecifiedArgumentRunner.cs

示例4: Promise

 public Promise(Arguments args)
 {
     m_promiseTask = new Task<JSObject>(() =>
     {
         return Undefined;
     });
 }
开发者ID:Oceanswave,项目名称:SkraprSharp,代码行数:7,代码来源:Promise.cs

示例5: GetOptions

 private static OptionSet GetOptions(Arguments outputArguments)
 {
     return new OptionSet
     {
         { "h|?|help",
             "Show this help message and exit.",
             v => outputArguments.ShowHelp = v != null },
         { "i|input=",
             "The input XML file (required)",
             v => outputArguments.InputFile = v },
         { "o|output=",
             "The output SNG file",
             v => outputArguments.OutputFile = v },
         { "console",
             "Generate a big-endian (console) file instead of little-endian (PC)",
             v => { if (v != null) outputArguments.Platform = new Platform(GamePlatform.XBox360, GameVersion.None); /*Same as PS3*/ }},
         { "vocal",
             "Generate from a vocal XML file instead of a guitar XML file",
             v => { if (v != null) outputArguments.ArrangementType = ArrangementType.Vocal; }},
         { "bass",
             "Generate from a bass XML file instead of a guitar XML file",
             v => { if (v != null) outputArguments.ArrangementType = ArrangementType.Bass; }},
         { "tuning=",
             "Use an alternate tuning for this song file."
             + " Tuning parameter should be comma-separated offsets from standard EADGBe tuning."
             + " For example, Drop D looks like: tuning=-2,0,0,0,0,0",
             v => outputArguments.Tuning = ParseTuning(v) }
     };
 }
开发者ID:aequitas,项目名称:rocksmith-custom-song-toolkit,代码行数:29,代码来源:Program.cs

示例6: Execute

    public override bool Execute(Arguments arguments)
    {
      var downloader = new RatingDownloader();
      var filename = arguments["f"];

      var ratedCards = Cards.All.Select(x => x.Name)
        .Select(x => new RatedCard {Name = x})
        .ToList();

      if (File.Exists(filename))
      {
        Console.WriteLine("Reading existing ratings from {0}...", filename);
        ReadExistingRatings(filename, ratedCards);
      }

      foreach (var ratedCard in ratedCards)
      {
        ratedCard.Rating = ratedCard.Rating ?? downloader.TryDownloadRating(ratedCard.Name) ?? 3.0m;
      }

      using (var writer = new StreamWriter(filename))
      {
        foreach (var ratedCard in ratedCards)
        {
          writer.WriteLine("{0};{1}",
            ratedCard.Rating.GetValueOrDefault()
              .ToString("f", CultureInfo.InvariantCulture), ratedCard.Name);
        }
      }

      return true;
    }
开发者ID:leloulight,项目名称:magicgrove,代码行数:32,代码来源:WriteCardRatings.cs

示例7: Argument

        public Argument(PythonBoss pyBoss, long address, PythonDictionary spec, Process process, int depth, Arguments parent, string namePrefix)
        {
            Address = address;
            this.process = process;
            _pyBoss = pyBoss;
            _parent = parent;
            NamePrefix = namePrefix;

            // Parse the spec for this argument
            // stackspec: [{"name": "socket",
            //		      "size": 4,
            //		      "type": None,
            //		      "fuzz": NOFUZZ,
            //            "type_args": None},]

            Fuzz = (bool)spec.get("fuzz");
            Name = (string)spec.get("name");
            _argumentType = (object)spec.get("type");
            if ( spec.ContainsKey("type_args") )
            {
                _typeArgs = spec.get("type_args");
            }

            // Validate required fields
            if (Name == null)
                throw new Exception("ERROR: Argument specification must include 'name' attribute. Failed when parsing name prefix '" + namePrefix + "'.");
            else if (Fuzz == null)
                throw new Exception("ERROR: Argument specification must include 'fuzz' attribute. Failed when parsing type '" + namePrefix + Name + "'.");
            else if (spec.get("size") == null)
                throw new Exception("ERROR: Argument specification must include 'size' attribute. Failed when parsing type '" + namePrefix + Name + "'.");

            if (spec.get("size") is string)
            {
                object sizeArgument = null;
                if (parent.TryGetMemberSearchUp((string)spec.get("size"), out sizeArgument))
                    Size = ((Argument)sizeArgument).ToInt();
                else
                    throw new Exception("ERROR: Unable to load size for type '" + Name + "' from parent member named '" + (string)spec.get("size") + "'. Please make sure this field exists in the parent.");
            }
            else if (spec.get("size") is int)
            {
                Size = (int)spec.get("size");
            }
            else
            {
                throw new Exception("ERROR: Unable to load size for type '" + Name + "'. The size must be of type 'int' or type 'string'. Size is type: '" + spec.get("size").ToString() + "'" );
            }

            // Read the data
            try
            {
                Data = MemoryFunctions.ReadMemory(process.ProcessDotNet, address, (uint)Size);
            }
            catch (Exception e)
            {
                Data = null;
            }

            PointerTarget = null;
        }
开发者ID:Zinterax,项目名称:meddle,代码行数:60,代码来源:Arguments.cs

示例8: RunExample

        /// <summary>
        /// Demonstrate writing bins with replace option. Replace will cause all record bins
        /// to be overwritten.  If an existing bin is not referenced in the replace command,
        /// the bin will be deleted.
        /// <para>
        /// The replace command has a performance advantage over the default put, because 
        /// the server does not have to read the existing record before overwriting it.
        /// </para>
        /// </summary>
        public override void RunExample(AerospikeClient client, Arguments args)
        {
            // Write securities
            console.Info("Write securities");
            Security security = new Security("GE", 26.89);
            security.Write(client, args.writePolicy, args.ns, args.set);

            security = new Security("IBM", 183.6);
            security.Write(client, args.writePolicy, args.ns, args.set);

            // Write account with positions.
            console.Info("Write account with positions");
            List<Position> positions = new List<Position>(2);
            positions.Add(new Position("GE", 1000));
            positions.Add(new Position("IBM", 500));
            Account accountWrite = new Account("123456", positions);
            accountWrite.Write(client, args.writePolicy, args.ns, args.set);

            // Read account/positions and join with securities.
            console.Info("Read accounts, positions and securities");
            Account accountRead = new Account();
            accountRead.Read(client, null, args.ns, args.set, "123456");

            // Validate data
            accountWrite.Validate(accountRead);
            console.Info("Accounts match");
        }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:36,代码来源:GetAndJoin.cs

示例9: Main

        private static void Main(string[] args)
        {
            using (IUnityContainer container = ContainerBuilder.BuildUnityContainer())
            {
                MappingConfiguration.Bootstrap(container);

                var logger = container.Resolve<ILogger>();

                var arguments = new Arguments(args);
                var simulationOptions = CreateSimulationOptions(arguments);

                try
                {
                    SimulationRunner.RunSimulations(simulationOptions, container, logger);
                }
                catch (Exception ex)
                {
                    logger.Log(Tag.Error, ex.GetType().Name + " " + ex.Message);
                    logger.Log(Tag.Error, ex.StackTrace);

                    if (ex.InnerException != null)
                    {
                        logger.Log(Tag.Error, ex.InnerException.GetType().Name + " " + ex.Message);
                        logger.Log(Tag.Error, ex.InnerException.StackTrace);
                    }

                    logger.Log(Tag.Error, "Exiting due to error");
                }
            }
        }
开发者ID:robinweston,项目名称:fantasyfootballrobot,代码行数:30,代码来源:Program.cs

示例10: Main

 static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Arguments = new Arguments(args);
     Application.Run(new PointTracer());
 }
开发者ID:Temoto-kun,项目名称:school-stuff,代码行数:7,代码来源:Program.cs

示例11: GetAssemblyInfoFiles

        static IEnumerable<FileInfo> GetAssemblyInfoFiles(string workingDirectory, Arguments args, IFileSystem fileSystem)
        {
            if (args.UpdateAssemblyInfoFileName != null && args.UpdateAssemblyInfoFileName.Any(x => !string.IsNullOrWhiteSpace(x)))
            {
                foreach (var item in args.UpdateAssemblyInfoFileName)
                {
                    var fullPath = Path.Combine(workingDirectory, item);

                    if (EnsureVersionAssemblyInfoFile(args, fileSystem, fullPath))
                    {
                        yield return new FileInfo(fullPath);
                    }
                }
            }
            else
            {
                foreach (var item in fileSystem.DirectoryGetFiles(workingDirectory, "AssemblyInfo.*", SearchOption.AllDirectories))
                {
                    var assemblyInfoFile = new FileInfo(item);

                    if (AssemblyVersionInfoTemplates.IsSupported(assemblyInfoFile.Extension))
                        yield return assemblyInfoFile;
                }
            }
        }
开发者ID:qetza,项目名称:GitVersion,代码行数:25,代码来源:AssemblyInfoFileUpdate.cs

示例12: RunPutGet

        private void RunPutGet(AsyncClient client, Arguments args, Key key, Bin bin)
        {
            console.Info("Put: namespace={0} set={1} key={2} value={3}",
                key.ns, key.setName, key.userKey, bin.value);

            client.Put(args.writePolicy, new WriteHandler(this, client, args.writePolicy, key, bin), key, bin);
        }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:7,代码来源:AsyncPutGet.cs

示例13: ParseArgument

 private void ParseArgument(string option, string[] args, ref int i, Arguments result)
 {
     if ("--recursive" == option || "-r" == option)
     {
         result.Recursive = true;
     }
     else if ("--monitor" == option || "-m" == option)
     {
         result.Monitor = true;
     }
     else if ("--quiet" == option || "-q" == option)
     {
         result.Quiet = true;
     }
     else if ("--event" == option || "-e" == option)
     {
         result.Events = new List<string>(Value(args, ++i, "event").Split(','));
     }
     else if ("--format" == option)
     {
         result.Format = TokenizeFormat(Value(args, ++i, "format"));
     }
     else if (Directory.Exists(option))
     {
         result.Paths.Add(System.IO.Path.GetFullPath(option));
     }
 }
开发者ID:ashi009,项目名称:inotify-win,代码行数:27,代码来源:ArgumentParser.cs

示例14: LoadArguments

        private static void LoadArguments(string[] args)
        {
            _arguments = new Arguments();
            if (args.Length == 0)
            {
                _arguments.CommandType = CommandType.Help;
                return;
            }
            for (var i = 0; i < args.Length; i++)
            {
                var value = args[i];
                if (i == 0)
                {
                    if (value == "-help")
                    {
                        _arguments.CommandType = CommandType.Help;
                    }
                    if (value == "-test")
                    {
                        _arguments.CommandType = CommandType.Test;
                    }
                }

                if (!string.IsNullOrWhiteSpace(value) && i == 1)
                    _arguments.Parameter = value;
            }
        }
开发者ID:vladdnc,项目名称:Algorithms-NET,代码行数:27,代码来源:Program.cs

示例15: TryGetDirectories

        public bool TryGetDirectories(string[] args, out Arguments arguments)
        {
            arguments = new Arguments();

              string source = string.Empty;
              string target = string.Empty;
              if (!args.Any())
            return false;
              if (args.Length %2 != 0)
            return false;
              for (var i = 0; i < args.Length; i += 2)
              {
            if (args[i].Substring(0, 8).ToLower() == "-source:")
              source = args[i].Substring(8);
            if (args[i].Substring(0, 8).ToLower() == "-target:")
              target = args[i].Substring(8);
            if (args[i+1].Substring(0, 8).ToLower() == "-source:")
              source = args[i+1].Substring(8);
            if (args[i+1].Substring(0, 8).ToLower() == "-target:")
              target = args[i+1].Substring(8);
            if ((source != target) && (source != string.Empty) && (target != string.Empty))
              arguments.SourceTargetPairs.Add(new SourceTargetPair {Source = source, Target = target});
            else
              return false;
            source = target = string.Empty;
              }
              return true;
        }
开发者ID:Hammerheim,项目名称:Upbeat-File-Sync,代码行数:28,代码来源:ArgumentExtractor.cs


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