コード例 #1
0
ファイル: CMakeMethods.cs プロジェクト: hxhlb/cmaketools
 /// <summary>
 /// Get the Quick Info tip for a given CMake command.
 /// </summary>
 /// <param name="id">The identifier of a CMake command.</param>
 /// <returns>The Quick Info tip.</returns>
 public static string GetCommandQuickInfoTip(CMakeCommandId id)
 {
     if (!_parameters.ContainsKey(id))
     {
         return(null);
     }
     return(string.Format("{0}({1})", CMakeKeywords.GetCommandFromId(id),
                          string.Join(" ", _parameters[id])));
 }
コード例 #2
0
ファイル: CMakeKeywordsTest.cs プロジェクト: hxhlb/cmaketools
 public void TestCommandsAlphabetical()
 {
     for (int i = 1; i < (int)CMakeCommandId.CommandCount; i++)
     {
         string keyword1 = CMakeKeywords.GetCommandFromId((CMakeCommandId)(i - 1));
         string keyword2 = CMakeKeywords.GetCommandFromId((CMakeCommandId)i);
         Assert.IsTrue(keyword1.CompareTo(keyword2) < 0);
     }
 }
コード例 #3
0
 /// <summary>
 /// Get the Quick Info tip for a given CMake subcommand.
 /// </summary>
 /// <param name="id">The identifier of a CMake command.</param>
 /// <param name="subcommand">The name of a subcommand.</param>
 /// <returns>The Quick Info tip.</returns>
 public static string GetSubcommandQuickInfoTip(CMakeCommandId id,
                                                string subcommand)
 {
     if (subcommand == null ||
         !_allSubcommands.ContainsKey(id) ||
         !_allSubcommands[id].ContainsKey(subcommand) ||
         _allSubcommands[id][subcommand] == null)
     {
         return(null);
     }
     if (_allSubcommands[id][subcommand].Length > 0)
     {
         return(string.Format("{0}({1} {2})", CMakeKeywords.GetCommandFromId(id),
                              subcommand, string.Join(" ", _allSubcommands[id][subcommand])));
     }
     else
     {
         return(string.Format("{0}({1})", CMakeKeywords.GetCommandFromId(id),
                              subcommand));
     }
 }
コード例 #4
0
 public override string GetName(int index)
 {
     // Look up the name of the command and combine it with the subcommand.
     return(CMakeKeywords.GetCommandFromId(_id) + "(" + _subcommand);
 }
コード例 #5
0
ファイル: CMakeMethods.cs プロジェクト: hxhlb/cmaketools
 public override string GetName(int index)
 {
     // Look up the name of the command.
     return(CMakeKeywords.GetCommandFromId(_id));
 }