本文整理匯總了C#中System.Arguments.MissingValues方法的典型用法代碼示例。如果您正苦於以下問題:C# Arguments.MissingValues方法的具體用法?C# Arguments.MissingValues怎麽用?C# Arguments.MissingValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Arguments
的用法示例。
在下文中一共展示了Arguments.MissingValues方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TryParseArgs
private static bool TryParseArgs(string[] args, out Arguments arguments)
{
arguments = null;
int argsLength = args != null ? args.Length : 0;
if (argsLength == 0)
return false;
int i = 0;
string flag;
string value;
#region get values from command line arguments
while (i < argsLength)
{
if (!TryGetArgValue(ref i, args, i == 0, out flag, out value))
return false;
arguments = arguments ?? new Arguments();
switch(flag)
{
case "--repoFolder":
case "-rf":
case "":
arguments.LocalRepoFolder = value;
PrintArgumentSetFromCmdLine("LocalRepoFolder", arguments.LocalRepoFolder);
break;
case "--developBranch":
case "-db":
arguments.DevelopLocalBranchName = value;
PrintArgumentSetFromCmdLine("DevelopLocalBranchName", arguments.DevelopLocalBranchName);
break;
case "--remoteName":
case "-rn":
arguments.RemoteName = value;
PrintArgumentSetFromCmdLine("RemoteName", arguments.RemoteName);
break;
case "--prFolder":
case "-pf":
arguments.LocalPRRepoFolder = value;
PrintArgumentSetFromCmdLine("LocalPRRepoFolder", arguments.LocalPRRepoFolder);
break;
case "--forkUrl":
case "-fu":
arguments.ForkUrl = value;
PrintArgumentSetFromCmdLine("ForkUrl", arguments.ForkUrl);
break;
case "--forkName":
case "-fn":
arguments.ForkName = value;
PrintArgumentSetFromCmdLine("ForkName", arguments.ForkName);
break;
case "--featureName":
case "-f":
arguments.FeatureName = value;
PrintArgumentSetFromCmdLine("FeatureName", arguments.FeatureName);
break;
}
}
#endregion
if (arguments == null || arguments.MissingValues())
{
#region get missing values from clipboard
if (!Clipboard.ContainsText())
return false;
string clipboardContent = Clipboard.GetText(TextDataFormat.UnicodeText);
clipboardContent = clipboardContent.Trim();
string folderSuffix;
using (var sr = new StringReader(clipboardContent))
{
string line = sr.ReadLine();
if (String.IsNullOrEmpty(line))
return false;
string[] words = line.Split(' ');
if (words.Length != 5)
return false;
folderSuffix = words[3];
arguments = arguments ?? new Arguments();
if (String.IsNullOrEmpty(arguments.DevelopLocalBranchName))
{
arguments.DevelopLocalBranchName = words[4];
//.........這裏部分代碼省略.........