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


C# AvalonEditTextOutput.GetDocument方法代码示例

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


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

示例1: TreeView_SelectionChanged

 void TreeView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
    this.textEditor.Clear();
    AvalonEditTextOutput textOutput = new AvalonEditTextOutput();
    //_humDisassembler = new HumanizerDisassembler(textOutput, token);
    foreach (var item in MainWindow.Instance.SelectedNodes)
    {
       var typeTreeNode = item as TypeTreeNode;
       if (typeTreeNode != null)
       {
          ToolSetSettings.Instance.Language.DecompileType(typeTreeNode.TypeDefinition, textOutput, new DecompilationOptions());
          //_humDisassembler.DisassembleType(typeTreeNode.TypeDefinition);
       }
    }
    this.textEditor.SyntaxHighlighting = ToolSetSettings.Instance.Language.SyntaxHighlighting;
    this.textEditor.AppendText(textOutput.GetDocument().Text);
    textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new ICSharpCode.AvalonEdit.Search.SearchInputHandler(textEditor.TextArea));
 }
开发者ID:kiinoo,项目名称:ILSpy,代码行数:18,代码来源:HumanizerPane.xaml.cs

示例2: Decompile

 public ICSharpCode.AvalonEdit.Document.TextDocument Decompile(object obj)
 {
     AvalonEditTextOutput aeto = new AvalonEditTextOutput();
     AstBuilder ast = new AstBuilder(new DecompilerContext(ModuleDefinition.CreateModule("ash", ModuleKind.NetModule)));
     switch (obj.GetType().Name)
     {
         case "AssemblyDefinition":
             ast = new AstBuilder(new DecompilerContext((obj as AssemblyDefinition).MainModule) { Settings = new DecompilerSettings() });
             try { ast.AddAssembly(obj as AssemblyDefinition); }
             catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.FullName); }
             break;
         case "TypeDefinition":
             ast = CreateAstBuilder((obj as TypeDefinition), true);
             try { ast.AddType(obj as TypeDefinition); }
             catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.FullName); }
             break;
         case "MethodDefinition":
             MethodDefinition method = (obj as MethodDefinition);
             ast = CreateAstBuilder(method.DeclaringType, true);
             if (method.IsConstructor && !method.IsStatic && !method.DeclaringType.IsValueType)
             {
                 foreach (var field in method.DeclaringType.Fields)
                     if (field.IsStatic == method.IsStatic)
                     {
                         try { ast.AddField(field); }
                         catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
                     }
                 foreach (var ctor in method.DeclaringType.Methods)
                     if (ctor.IsConstructor && ctor.IsStatic == method.IsStatic)
                     {
                         try { ast.AddMethod(ctor); }
                         catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
                     }
             }
             else
             {
                 try { ast.AddMethod(obj as MethodDefinition); }
                 catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
             }
             break;
         case "PropertyDefinition":
             ast = CreateAstBuilder((obj as PropertyDefinition).DeclaringType, true);
             try { ast.AddProperty(obj as PropertyDefinition); }
             catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
             break;
         case "FieldDefinition":
             ast = CreateAstBuilder((obj as FieldDefinition).DeclaringType, true);
             try { ast.AddField(obj as FieldDefinition); }
             catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
             break;
         case "EventDefinition":
             ast = CreateAstBuilder((obj as EventDefinition).DeclaringType, true);
             try { ast.AddEvent(obj as EventDefinition); }
             catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly " + e.AssemblyReference.Name); }
             break;
         default:
             return new ICSharpCode.AvalonEdit.Document.TextDocument();
     }
     try { ast.GenerateCode(aeto); }
     catch (AssemblyResolutionException e) { MessageBox.Show("Could not load assembly upon code generation:\r" + e.AssemblyReference.FullName); }
     return aeto.GetDocument();
 }
开发者ID:net-shell,项目名称:quantum-vaginer,代码行数:62,代码来源:NetDasm.cs


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