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


C# ITaskItem.ToString方法代码示例

本文整理汇总了C#中ITaskItem.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ITaskItem.ToString方法的具体用法?C# ITaskItem.ToString怎么用?C# ITaskItem.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITaskItem的用法示例。


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

示例1: AppendFileNameIfNotNull

		public void AppendFileNameIfNotNull (ITaskItem fileItem)
		{
			if (fileItem == null)
				return;
			
			string filename = fileItem.ToString ();
			VerifyThrowNoEmbeddedDoubleQuotes (null, filename);
			AppendSpaceIfNotEmpty ();
			AppendFileNameWithQuoting (filename);
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:10,代码来源:CommandLineBuilder.cs

示例2: GetSpecial

        string GetSpecial(string name, object value, ITaskItem input)
        {
            // ToLower is affected by localization. Need to be careful here.
            name = name.ToLower(new CultureInfo("en-US", false));

            if (value == null)
            {
                if (name == "inputfilename")
                {
                    return Path.GetFileName(input.ItemSpec);
                }
                else if (name == "inputabsdir")
                {
                    return Path.GetDirectoryName(Path.GetFullPath(input.ToString()));
                }
                else if (name == "dependencyfile")
                {
                    return GetSpecial("objectfilename", ObjectFileName, input) + ".d";
                }
                else if (name == "dependencysource")
                {
                    return GetSpecial("objectfilename", ObjectFileName, input);
                }
            }
            
            if (name == "objectfilename")
            {
                if (value.ToString().Last() == '\\' || value.ToString().Last() == '/')
                {
                    return value + DecorateFile(input.ItemSpec, ".obj");
                }
            }
            else if (name == "input")
            {
                return GetFullPath(input.ToString());
            }

            return value == null ? null : value.ToString();
        }
开发者ID:Strongc,项目名称:WinObjC,代码行数:39,代码来源:ClangCompile.cs

示例3: GetSpecial

        string GetSpecial(string name, object value, ITaskItem input)
        {
            if (value == null)
            {
                if (name == "inputfilename")
                {
                    return Path.GetFileName(input.ItemSpec);
                }
                else if (name == "inputabsdir")
                {
                    return Path.GetDirectoryName(Path.GetFullPath(input.ToString()));
                }
                else if (name == "dependencyfile")
                {
                    return GetSpecial("objectfilename", ObjectFileName, input) + ".d";
                }
                else if (name == "dependencysource")
                {
                    return GetSpecial("objectfilename", ObjectFileName, input);
                }
            }

            if (name == "objectfilename")
            {
                if (value.ToString().Last() == '\\' || value.ToString().Last() == '/')
                {
                    return value + DecorateFile(input.ItemSpec, ".obj");
                }
            }
            else if (name == "input")
            {
                return GetFullPath(input.ToString());
            }

            return value == null ? null : value.ToString();
        }
开发者ID:Kevin-Swift,项目名称:WinObjC,代码行数:36,代码来源:ClangCompile.cs

示例4: AppendSwitchIfNotNull

		public void AppendSwitchIfNotNull (string switchName,
						   ITaskItem parameter)
		{
			if (switchName == null)
				throw new ArgumentNullException (null, "Parameter \"switchName\" cannot be null.");
		
			if (parameter == null)
				return;
			
			string value = parameter.ToString ();
			VerifyThrowNoEmbeddedDoubleQuotes (switchName, value);
			AppendSpaceIfNotEmpty ();
			commandLine.Append (switchName);
			AppendTextWithQuoting (value);
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:15,代码来源:CommandLineBuilder.cs

示例5: GenerateCommandLineForSource

        protected string GenerateCommandLineForSource(ITaskItem sourceFile,
                                                      bool fullOutputName=false)
        {
            StringBuilder commandLine = new StringBuilder(GCCUtilities.s_CommandLineLength);

            //build command line from components and add required switches
            string props = xamlParser.Parse(sourceFile, fullOutputName, null);
            commandLine.Append(props);
            commandLine.Append(" -c");

            // Remove rtti items as they are not relevant in C compilation and will 
            // produce warnings
            if (SourceIsC(sourceFile.ToString()))
            {
                commandLine.Replace("-fno-rtti", "");
                commandLine.Replace("-frtti", "");
            }

            if (ConfigurationType == "DynamicLibrary")
            {
                commandLine.Append(" -fPIC");
            }

            return commandLine.ToString();
        }
开发者ID:udiavr,项目名称:nativeclient-sdk,代码行数:25,代码来源:NaClCompile.cs


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