當前位置: 首頁>>代碼示例>>C#>>正文


C# Branch.ToString方法代碼示例

本文整理匯總了C#中Branch.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Branch.ToString方法的具體用法?C# Branch.ToString怎麽用?C# Branch.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Branch的用法示例。


在下文中一共展示了Branch.ToString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Heads

        public static HgArguments Heads(Branch branch)
        {
            if (branch == null)
            {
                throw new ArgumentNullException("branch");
            }

            return new HgArguments().Add("heads").Add(branch.ToString());
        }
開發者ID:davidsidlinger,項目名稱:ccnet-hg-nosuck,代碼行數:9,代碼來源:HgArguments.cs

示例2: ChangeBranch

 public static HgArguments ChangeBranch(Branch branch)
 {
     if (branch == null)
     {
         throw new ArgumentNullException("branch");
     }
     if (branch == Branch.NotSpecified)
     {
         throw new ArgumentOutOfRangeException("branch", branch, "Branch must be specified.");
     }
     return new HgArguments().Add("branch").Add(branch.ToString());
 }
開發者ID:davidsidlinger,項目名稱:ccnet-hg-nosuck,代碼行數:12,代碼來源:HgArguments.cs

示例3: OnlyBranch

 public HgArguments OnlyBranch(Branch branch)
 {
     if (branch == null)
     {
         throw new ArgumentNullException("branch");
     }
     return branch != Branch.NotSpecified ? Add("--only-branch", branch.ToString()) : this;
 }
開發者ID:davidsidlinger,項目名稱:ccnet-hg-nosuck,代碼行數:8,代碼來源:HgArguments.cs

示例4: SwitchBranchOLD

        public string SwitchBranchOLD(IrcCommand command)
        {
            string name = command.Parameters[0];
            Branch b;
            bool success = Enum.TryParse(name, out b);

            //Either branch does not exist, or we've selected a private branch in a public channel
            if (!success || (!Constants.PublicBranch[b] && command.Destination != "#reside_priv"))
            {
                Branch[] branches = null;
                if (command.Destination == "#reside_priv")
                {
                    branches = AllBranches.ToArray();
                }
                else
                {
                    branches = AllBranches.Where(x => Constants.PublicBranch[x]).ToArray();
                }

                string bString = "{ ";
                foreach (Branch branch in branches)
                {
                    bString += branch.ToString() + ", ";
                }
                bString = bString.Remove(bString.Length - 2) + " }";
                return "Branch not found: " + name + ". Possible Branches: " + bString;
            }

            if (b == CurrentBranchOLD) return "Already on branch: " + CurrentBranchOLD.ToString();

            CurrentBranchOLD = b;

            return "Switched to " + CurrentBranchOLD.ToString();
        }
開發者ID:Bananamilkshake,項目名稱:lebot,代碼行數:34,代碼來源:RESideStuff.cs


注:本文中的Branch.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。