当前位置: 首页>>代码示例>>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;未经允许,请勿转载。