本文整理汇总了C#中System.CodeDom.Compiler.CodeDomProvider.Parse方法的典型用法代码示例。如果您正苦于以下问题:C# CodeDomProvider.Parse方法的具体用法?C# CodeDomProvider.Parse怎么用?C# CodeDomProvider.Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.CodeDom.Compiler.CodeDomProvider
的用法示例。
在下文中一共展示了CodeDomProvider.Parse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisposeGenerateState
///-------------------------------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
///-------------------------------------------------------------------------------------------------------------
void IVsCodeBehindCodeGenerator.BeginGenerate(string document, string codeBehindFile, string className_Full, bool create)
{
DisposeGenerateState();
_itemCode = VsHierarchyItem.CreateFromMoniker(codeBehindFile, _hierarchy);
_itemDesigner = GetDesignerItem(_itemCode, false);
_create = create;
_className_Full = className_Full;
if (_itemCode != null)
{
// Get the CodeDomProvider for the language (MergedCodeDomProvider C#/VB)
_codeDomProvider = CreateCodeDomProvider(_itemCode.VsItemID);
if (_codeDomProvider != null)
{
// Get the field names so we can preserve location and access
bool caseSensitive = IsCaseSensitive(_codeDomProvider);
_codeFields = GetFieldNames(_itemCode, _className_Full, caseSensitive, false, 30);
_designerFields = GetFieldNames(_itemDesigner, _className_Full, caseSensitive, false, 0);
// Generate the class
string designerContents = _itemDesigner.GetDocumentText();
TextReader reader = new StringReader(designerContents);
_ccu = _codeDomProvider.Parse(reader);
GenerateClass();
}
}
}