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


C# CodeLanguage.ToString方法代码示例

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


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

示例1: GetCodeMap

		public virtual ICodeMap GetCodeMap(CodeLanguage codeLanguage)
		{
			if (IsFixed("GetCodeMap_" + codeLanguage.ToString() ))
			{
				return (ICodeMap) GetFixedValue("GetCodeMap_" + codeLanguage.ToString());
			}
			foreach (ICodeMap codeMap in this.m_CodeMaps)
			{
				if (codeMap.CodeLanguage.Equals(codeLanguage))
				{
					if (IsFixed())
					{
						SetFixedValue("GetCodeMap_" + codeLanguage.ToString(), codeMap);
					}
					return codeMap;
				}
			}
			return null;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:19,代码来源:ClassMap.cs

示例2: SaveSVCFile

 public static void SaveSVCFile(string ns, string syncSvcTypeName, string codeBehindFileName, string fileName, CodeLanguage option)
 {
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat(Constants.ServiceSyncServicSVCFileContents, option.ToString().ToLowerInvariant(), ns, 
         syncSvcTypeName, new FileInfo(codeBehindFileName).Name, 
         AssemblyName.GetAssemblyName(Assembly.GetCallingAssembly().Location).Version.ToString());
     using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter writer = new StreamWriter(fs))
         {
             writer.Write(builder.ToString());
             writer.Flush();
         }
     }
 }
开发者ID:dkmehta,项目名称:SyncWinRT,代码行数:15,代码来源:CodeDomUtility.cs

示例3: GenerateFileName

 public static string GenerateFileName(string scopeName, DirectoryInfo dirInfo, string filePrefix, string fileSuffix, CodeLanguage option)
 {
     // Check to create the directory if it doesnt exist.
     if (!dirInfo.Exists)
     {
         dirInfo.Create();
     }
     return Path.Combine(
         dirInfo.FullName, 
         string.Format("{0}{1}.{2}", string.IsNullOrEmpty(filePrefix) ? scopeName : filePrefix, fileSuffix,  option.ToString().ToLowerInvariant())
         );
 }
开发者ID:dkmehta,项目名称:SyncWinRT,代码行数:12,代码来源:CodeDomUtility.cs

示例4: SaveCompileUnitToFile

        /// <summary>
        /// Takes the CodeCompileUnit and generates code for the specified language options
        /// and saves it to a file.
        /// </summary>
        /// <param name="cc">Actual CodeCompileUnit</param>
        /// <param name="option">Language Option</param>
        /// <param name="fileName">File name where the code will be saved</param>
        public static void SaveCompileUnitToFile(CodeCompileUnit cc, CodeLanguage option, string fileName)
        {
            CodeDomProvider csprovider = CodeDomProvider.CreateProvider(option.ToString());
            StringWriter builder = new StringWriter();
            csprovider.GenerateCodeFromCompileUnit(cc, builder, null);

            using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter writer = new StreamWriter(fs))
                {
                    writer.Write(builder.ToString());
                    writer.Flush();
                }
            }

        }
开发者ID:dkmehta,项目名称:SyncWinRT,代码行数:23,代码来源:CodeDomUtility.cs


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