• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TextView.AvalonEditTextOutput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AvalonEditTextOutput类属于ICSharpCode.ILSpy.TextView命名空间,在下文中一共展示了AvalonEditTextOutput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: View

		public override bool View(DecompilerTextView textView)
		{
			try {
				AvalonEditTextOutput output = new AvalonEditTextOutput();
				Data.Position = 0;
				BitmapImage image = new BitmapImage();

				//HACK: windows imaging does not understand that .cur files have the same layout as .ico
				// so load to data, and modify the ResourceType in the header to make look like an icon...
				byte[] curData = ((MemoryStream)Data).ToArray();
				curData[2] = 1;
				using (Stream stream = new MemoryStream(curData)) {
					image.BeginInit();
					image.StreamSource = stream;
					image.EndInit();
				}

				output.AddUIElement(() => new Image { Source = image });
				output.WriteLine();
				output.AddButton(Images.Save, "Save", delegate {
					Save(null);
				});
				textView.ShowNode(output, this, null);
				return true;
			}
			catch (Exception) {
				return false;
			}
		}
开发者ID:rmattuschka,项目名称:ILSpy,代码行数:29,代码来源:CursorResourceEntryNode.cs


示例2: View

		public override bool View(DecompilerTextView textView)
		{
			AvalonEditTextOutput output = new AvalonEditTextOutput();
			IHighlightingDefinition highlighting = null;
			
			textView.RunWithCancellation(
				token => Task.Factory.StartNew(
					() => {
						try {
							// cache read XAML because stream will be closed after first read
							if (xml == null) {
								using (var reader = new StreamReader(Data)) {
									xml = reader.ReadToEnd();
								}
							}
							output.Write(xml);
							highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml");
						}
						catch (Exception ex) {
							output.Write(ex.ToString());
						}
						return output;
					}, token)
			).Then(t => textView.ShowNode(t, this, highlighting)).HandleExceptions();
			return true;
		}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:26,代码来源:XmlResourceNode.cs


示例3: View

 public override bool View(DecompilerTextView textView)
 {
   try
   {
     AvalonEditTextOutput output = new AvalonEditTextOutput();
     Data.Position = 0;
     IconBitmapDecoder decoder = new IconBitmapDecoder(Data, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.None);
     foreach (var frame in decoder.Frames)
     {
       output.Write(String.Format("{0}x{1}, {2} bit: ", frame.PixelHeight, frame.PixelWidth, frame.Thumbnail.Format.BitsPerPixel));
       AddIcon(output, frame);
       output.WriteLine();
     }
     output.AddButton(Images.Save, "Save", delegate
     {
       Save(null);
     });
     textView.ShowNode(output, this);
     return true;
   }
   catch (Exception)
   {
     return false;
   }
 }
开发者ID:Gobiner,项目名称:ILSpy,代码行数:25,代码来源:IconResourceEntryNode.cs


示例4: LoadBaml

		bool LoadBaml(AvalonEditTextOutput output)
		{
			var asm = this.Ancestors().OfType<AssemblyTreeNode>().FirstOrDefault().LoadedAssembly;
			Data.Position = 0;
			XDocument xamlDocument = LoadIntoDocument(asm.GetAssemblyResolver(), asm.AssemblyDefinition, Data);
			output.Write(xamlDocument.ToString());
			return true;
		}
开发者ID:rmattuschka,项目名称:ILSpy,代码行数:8,代码来源:BamlResourceEntryNode.cs


示例5: View

		public override bool View(DecompilerTextView textView) {
			if (resElem.ResourceData.Code == ResourceTypeCode.String) {
				var output = new AvalonEditTextOutput();
				output.Write((string)((BuiltInResourceData)resElem.ResourceData).Data, TextTokenType.Text);
				textView.ShowNode(output, this, null);
				return true;
			}
			if (resElem.ResourceData.Code == ResourceTypeCode.ByteArray || resElem.ResourceData.Code == ResourceTypeCode.Stream) {
				var data = (byte[])((BuiltInResourceData)resElem.ResourceData).Data;
				return ResourceTreeNode.View(this, textView, new MemoryStream(data), Name);
			}

			return base.View(textView);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:14,代码来源:BuiltInResourceElementTreeNode.cs


示例6: Display

		public static void Display(DecompilerTextView textView) {
			AvalonEditTextOutput output = new AvalonEditTextOutput();
			output.WriteLine(string.Format("dnSpy version {0}", currentVersion.ToString()), TextTokenType.Text);
			var decVer = typeof(ICSharpCode.Decompiler.Ast.AstBuilder).Assembly.GetName().Version;
			output.WriteLine(string.Format("ILSpy Decompiler version {0}.{1}.{2}", decVer.Major, decVer.Minor, decVer.Build), TextTokenType.Text);
			if (checkForUpdateCode)
				output.AddUIElement(
					delegate {
						StackPanel stackPanel = new StackPanel();
						stackPanel.HorizontalAlignment = HorizontalAlignment.Center;
						stackPanel.Orientation = Orientation.Horizontal;
						if (latestAvailableVersion == null) {
							AddUpdateCheckButton(stackPanel, textView);
						}
						else {
						// we already retrieved the latest version sometime earlier
						ShowAvailableVersion(latestAvailableVersion, stackPanel);
						}
						CheckBox checkBox = new CheckBox();
						checkBox.Margin = new Thickness(4);
						checkBox.Content = "Automatically check for updates every week";
						UpdateSettings settings = new UpdateSettings(DNSpySettings.Load());
						checkBox.SetBinding(CheckBox.IsCheckedProperty, new Binding("AutomaticUpdateCheckEnabled") { Source = settings });
						return new StackPanel {
							Margin = new Thickness(0, 4, 0, 0),
							Cursor = Cursors.Arrow,
							Children = { stackPanel, checkBox }
						};
					});
			if (checkForUpdateCode)
				output.WriteLine();
			foreach (var plugin in App.CompositionContainer.GetExportedValues<IAboutPageAddition>())
				plugin.Write(output);
			output.WriteLine();
			using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(dnSpy.StartUpClass), "README.txt")) {
				using (StreamReader r = new StreamReader(s)) {
					string line;
					while ((line = r.ReadLine()) != null) {
						output.WriteLine(line, TextTokenType.Text);
					}
				}
			}
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("SharpDevelop", "http://www.icsharpcode.net/opensource/sd/"));
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("MIT License", "resource:license.txt"));
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("LGPL", "resource:LGPL.txt"));
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("COPYING", "resource:COPYING"));
			textView.ShowText(output);
			MainWindow.Instance.SetTitle(textView, "About");
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:49,代码来源:AboutPage.cs


示例7: Display

		public static void Display(DecompilerTextView textView)
		{
			AvalonEditTextOutput output = new AvalonEditTextOutput();
			output.WriteLine("ILSpy version " + RevisionClass.FullVersion);
			output.AddUIElement(
				delegate {
					StackPanel stackPanel = new StackPanel();
					stackPanel.HorizontalAlignment = HorizontalAlignment.Center;
					stackPanel.Orientation = Orientation.Horizontal;
					if (latestAvailableVersion == null) {
						AddUpdateCheckButton(stackPanel, textView);
					} else {
						// we already retrieved the latest version sometime earlier
						ShowAvailableVersion(latestAvailableVersion, stackPanel);
					}
					CheckBox checkBox = new CheckBox();
					checkBox.Margin = new Thickness(4);
					checkBox.Content = "Automatically check for updates every week";
					UpdateSettings settings = new UpdateSettings(ILSpySettings.Load());
					checkBox.SetBinding(CheckBox.IsCheckedProperty, new Binding("AutomaticUpdateCheckEnabled") { Source = settings });
					return new StackPanel {
						Margin = new Thickness(0, 4, 0, 0),
						Cursor = Cursors.Arrow,
						Children = { stackPanel, checkBox }
					};
				});
			output.WriteLine();
			foreach (var plugin in App.CompositionContainer.GetExportedValues<IAboutPageAddition>())
				plugin.Write(output);
			output.WriteLine();
			using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), "README.txt")) {
				using (StreamReader r = new StreamReader(s)) {
					string line;
					while ((line = r.ReadLine()) != null) {
						output.WriteLine(line);
					}
				}
			}
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("SharpDevelop", "http://www.icsharpcode.net/opensource/sd/"));
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("MIT License", "resource:license.txt"));
			output.AddVisualLineElementGenerator(new MyLinkElementGenerator("LGPL", "resource:LGPL.txt"));
			textView.ShowText(output);
			
			//reset icon bar
			textView.manager.Bookmarks.Clear();
		}
开发者ID:Netring,项目名称:ILSpy,代码行数:46,代码来源:AboutPage.cs


示例8: 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


示例9: View

		public override bool View(DecompilerTextView textView)
		{
			IHighlightingDefinition highlighting = null;
			
			textView.RunWithCancellation(
				token => Task.Factory.StartNew(
					() => {
						AvalonEditTextOutput output = new AvalonEditTextOutput();
						try {
							if (LoadBaml(output))
								highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml");
						} catch (Exception ex) {
							output.Write(ex.ToString());
						}
						return output;
					}, token))
				.Then(output => textView.ShowNode(output, this, highlighting))
				.HandleExceptions();
			return true;
		}
开发者ID:DKeeper1523,项目名称:ilspy_yh,代码行数:20,代码来源:BamlResourceEntryNode.cs


示例10: View

 public override bool View(DecompilerTextView textView)
 {
     try {
         AvalonEditTextOutput output = new AvalonEditTextOutput();
         Data.Position = 0;
         BitmapImage image = new BitmapImage();
         image.BeginInit();
         image.StreamSource = Data;
         image.EndInit();
         output.AddUIElement(() => new Image { Source = image });
         output.WriteLine();
         output.AddButton(ImageCache.Instance.GetImage("Save", BackgroundType.Button), "Save", delegate {
             Save(null);
         });
         textView.ShowNode(output, this);
         return true;
     }
     catch (Exception) {
         return false;
     }
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:21,代码来源:ImageResourceEntryNode.cs


示例11: Display

 public static void Display(DecompilerTextView textView)
 {
     AvalonEditTextOutput output = new AvalonEditTextOutput();
     output.WriteLine("ILSpy version " + RevisionClass.FullVersion);
     output.AddUIElement(
         delegate {
             StackPanel stackPanel = new StackPanel();
             stackPanel.HorizontalAlignment = HorizontalAlignment.Center;
             stackPanel.Orientation = Orientation.Horizontal;
             if (latestAvailableVersion == null) {
                 AddUpdateCheckButton(stackPanel, textView);
             } else {
                 // we already retrieved the latest version sometime earlier
                 ShowAvailableVersion(latestAvailableVersion, stackPanel);
             }
             CheckBox checkBox = new CheckBox();
             checkBox.Margin = new Thickness(4);
             checkBox.Content = "Automatically check for updates every week";
             UpdateSettings settings = new UpdateSettings(ILSpySettings.Load());
             checkBox.SetBinding(CheckBox.IsCheckedProperty, new Binding("AutomaticUpdateCheckEnabled") { Source = settings });
             return new StackPanel {
                 Margin = new Thickness(0, 4, 0, 0),
                 Cursor = Cursors.Arrow,
                 Children = { stackPanel, checkBox }
             };
         });
     output.WriteLine();
     output.WriteLine();
     using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), "README.txt")) {
         using (StreamReader r = new StreamReader(s)) {
             string line;
             while ((line = r.ReadLine()) != null)
                 output.WriteLine(line);
         }
     }
     textView.Show(output);
 }
开发者ID:richardschneider,项目名称:ILSpy,代码行数:37,代码来源:AboutPage.cs


示例12: View

		public override bool View(DecompilerTextView textView) {
			AvalonEditTextOutput output = new AvalonEditTextOutput();
			IHighlightingDefinition highlighting = null;
			var lang = MainWindow.Instance.CurrentLanguage;

			textView.RunWithCancellation(
				token => Task.Factory.StartNew(
					() => {
						try {
							bamlData.Position = 0;
							var document = BamlReader.ReadDocument(bamlData, token);
							if (BamlSettings.Instance.DisassembleBaml)
								Disassemble(module, document, lang, output, out highlighting, token);
							else
								Decompile(module, document, lang, output, out highlighting, token);
						}
						catch (Exception ex) {
							output.Write(ex.ToString(), TextTokenType.Text);
						}
						return output;
					}, token)
				).Then(t => textView.ShowNode(t, this, highlighting)).HandleExceptions();
			return true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:24,代码来源:BamlResourceNode.cs


示例13: View

        internal override bool View(DecompilerTextView textView)
        {
            AvalonEditTextOutput output = new AvalonEditTextOutput();
            IHighlightingDefinition highlighting = null;

            if (LoadImage(output)) {
                textView.Show(output, highlighting);
            } else {
                textView.RunWithCancellation(
                    token => Task.Factory.StartNew(
                        () => {
                            try {
                                if (LoadBaml(output))
                                    highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml");
                            } catch (Exception ex) {
                                output.Write(ex.ToString());
                            }
                            return output;
                        }),
                    t => textView.Show(t.Result, highlighting)
                );
            }
            return true;
        }
开发者ID:petr-k,项目名称:ILSpy,代码行数:24,代码来源:ResourceEntryNode.cs


示例14: View

        public override bool View(DecompilerTextView textView)
        {
            try {
                AvalonEditTextOutput output = new AvalonEditTextOutput();
                Data.Position = 0;
                BitmapImage image = new BitmapImage();

                //HACK: windows imaging does not understand that .cur files have the same layout as .ico
                // so load to data, and modify the ResourceType in the header to make look like an icon...
                MemoryStream s = Data as MemoryStream;
                if (null == s)
                {
                    // data was stored in another stream type (e.g. PinnedBufferedMemoryStream)
                    s = new MemoryStream();
                    Data.CopyTo(s);
                }
                byte[] curData = s.ToArray();
                curData[2] = 1;
                using (Stream stream = new MemoryStream(curData)) {
                    image.BeginInit();
                    image.StreamSource = stream;
                    image.EndInit();
                }

                output.AddUIElement(() => new Image { Source = image });
                output.WriteLine();
                output.AddButton(ImageCache.Instance.GetImage("Save", BackgroundType.Button), "Save", delegate {
                    Save(null);
                });
                textView.ShowNode(output, this);
                return true;
            }
            catch (Exception) {
                return false;
            }
        }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:36,代码来源:CursorResourceEntryNode.cs


示例15: View

		internal override bool View(DecompilerTextView textView)
		{
			EmbeddedResource er = r as EmbeddedResource;
			if (er != null) {
				Stream s = er.GetResourceStream();
				if (s != null && s.Length < DecompilerTextView.DefaultOutputLengthLimit) {
					s.Position = 0;
					FileType type = GuessFileType.DetectFileType(s);
					if (type != FileType.Binary) {
						s.Position = 0;
						AvalonEditTextOutput output = new AvalonEditTextOutput();
						output.Write(FileReader.OpenStream(s, Encoding.UTF8).ReadToEnd());
						string ext;
						if (type == FileType.Xml)
							ext = ".xml";
						else
							ext = Path.GetExtension(DecompilerTextView.CleanUpName(er.Name));
						textView.Show(output, HighlightingManager.Instance.GetDefinitionByExtension(ext));
						return true;
					}
				}
			}
			return false;
		}
开发者ID:tris2481,项目名称:ILSpy,代码行数:24,代码来源:ResourceTreeNode.cs


示例16: HandleCommandLineArgumentsAfterShowList

		void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args)
		{
			if (args.NavigateTo != null) {
				bool found = false;
				if (args.NavigateTo.StartsWith("N:", StringComparison.Ordinal)) {
					string namespaceName = args.NavigateTo.Substring(2);
					foreach (LoadedAssembly asm in commandLineLoadedAssemblies) {
						AssemblyTreeNode asmNode = assemblyListTreeNode.FindAssemblyNode(asm);
						if (asmNode != null) {
							NamespaceTreeNode nsNode = asmNode.FindNamespaceNode(namespaceName);
							if (nsNode != null) {
								found = true;
								SelectNode(nsNode);
								break;
							}
						}
					}
				} else {
					foreach (LoadedAssembly asm in commandLineLoadedAssemblies) {
						ModuleDefinition def = asm.ModuleDefinition;
						if (def != null) {
							MemberReference mr = XmlDocKeyProvider.FindMemberByKey(def, args.NavigateTo);
							if (mr != null) {
								found = true;
								JumpToReference(mr);
								break;
							}
						}
					}
				}
				if (!found) {
					AvalonEditTextOutput output = new AvalonEditTextOutput();
					output.Write(string.Format("Cannot find '{0}' in command line specified assemblies.", args.NavigateTo));
					decompilerTextView.ShowText(output);
				}
			} else if (commandLineLoadedAssemblies.Count == 1) {
				// NavigateTo == null and an assembly was given on the command-line:
				// Select the newly loaded assembly
				JumpToReference(commandLineLoadedAssemblies[0].ModuleDefinition);
			}
			if (args.Search != null)
			{
				SearchPane.Instance.SearchTerm = args.Search;
				SearchPane.Instance.Show();
			}
			if (!string.IsNullOrEmpty(args.SaveDirectory)) {
				foreach (var x in commandLineLoadedAssemblies) {
					x.ContinueWhenLoaded( (Task<ModuleDefinition> moduleTask) => {
						OnExportAssembly(moduleTask, args.SaveDirectory);
					}, TaskScheduler.FromCurrentSynchronizationContext());
				}
			}
			commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore
		}
开发者ID:buraksarica,项目名称:ILSpy,代码行数:54,代码来源:MainWindow.xaml.cs


示例17: AddUpdateCheckButton

		static void AddUpdateCheckButton(StackPanel stackPanel, DecompilerTextView textView) {
			Button button = new Button();
			button.Content = "Check for updates";
			button.Cursor = Cursors.Arrow;
			stackPanel.Children.Add(button);

			button.Click += delegate {
				button.Content = "Checking...";
				button.IsEnabled = false;
				GetLatestVersionAsync().ContinueWith(
					delegate (Task<AvailableVersionInfo> task) {
						try {
							stackPanel.Children.Clear();
							ShowAvailableVersion(task.Result, stackPanel);
						}
						catch (Exception ex) {
							AvalonEditTextOutput exceptionOutput = new AvalonEditTextOutput();
							exceptionOutput.WriteLine(ex.ToString(), TextTokenType.Text);
							textView.ShowText(exceptionOutput);
						}
					}, TaskScheduler.FromCurrentSynchronizationContext());
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:23,代码来源:AboutPage.cs


示例18: LoadBaml

		bool LoadBaml(AvalonEditTextOutput output)
		{
			var asm = this.Ancestors().OfType<AssemblyTreeNode>().FirstOrDefault().LoadedAssembly;
			
			AppDomain bamlDecompilerAppDomain = null;
			try {
				BamlDecompiler decompiler = CreateBamlDecompilerInAppDomain(ref bamlDecompilerAppDomain, asm.FileName);
				
				MemoryStream bamlStream = new MemoryStream();
				data.Position = 0;
				data.CopyTo(bamlStream);
				
				output.Write(decompiler.DecompileBaml(bamlStream, asm.FileName));
				return true;
			} finally {
				if (bamlDecompilerAppDomain != null)
					AppDomain.Unload(bamlDecompilerAppDomain);
			}
		}
开发者ID:tanujmathur,项目名称:ILSpy,代码行数:19,代码来源:BamlDecompiler.cs


示例19: HandleCommandLineArgumentsAfterShowList

		void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args) {
			if (args.NavigateTo != null) {
				bool found = false;
				if (args.NavigateTo.StartsWith("N:", StringComparison.Ordinal)) {
					string namespaceName = args.NavigateTo.Substring(2);
					foreach (DnSpyFile asm in commandLineLoadedFiles) {
						AssemblyTreeNode asmNode = dnSpyFileListTreeNode.FindAssemblyNode(asm);
						if (asmNode != null) {
							NamespaceTreeNode nsNode = asmNode.FindNamespaceNode(namespaceName);
							if (nsNode != null) {
								found = true;
								SelectNode(nsNode);
								break;
							}
						}
					}
				}
				else {
					foreach (DnSpyFile asm in commandLineLoadedFiles) {
						ModuleDef def = asm.ModuleDef;
						if (def != null) {
							IMemberRef mr = XmlDocKeyProvider.FindMemberByKey(def, args.NavigateTo);
							if (mr != null) {
								found = true;
								JumpToReference(mr);
								break;
							}
						}
					}
				}
				if (!found) {
					AvalonEditTextOutput output = new AvalonEditTextOutput();
					output.Write(string.Format("Cannot find '{0}' in command line specified assemblies.", args.NavigateTo), TextTokenType.Text);
					SafeActiveTextView.ShowText(output);
				}
			}
			else if (commandLineLoadedFiles.Count == 1) {
				// NavigateTo == null and an assembly was given on the command-line:
				// Select the newly loaded assembly
				JumpToReference(commandLineLoadedFiles[0].ModuleDef);
			}
			if (args.Search != null) {
				SearchPane.Instance.SearchTerm = args.Search;
				SearchPane.Instance.Show();
			}
			if (!string.IsNullOrEmpty(args.SaveDirectory)) {
				foreach (var x in commandLineLoadedFiles)
					OnExportAssembly(x, args.SaveDirectory);
			}
			commandLineLoadedFiles.Clear(); // clear references once we don't need them anymore
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:51,代码来源:MainWindow.xaml.cs


示例20: HandleCommandLineArgumentsAfterShowList

		void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args)
		{
			if (args.NavigateTo != null) {
				bool found = false;
				if (args.NavigateTo.StartsWith("N:", StringComparison.Ordinal)) {
					string namespaceName = args.NavigateTo.Substring(2);
					foreach (LoadedAssembly asm in commandLineLoadedAssemblies) {
						AssemblyTreeNode asmNode = assemblyListTreeNode.FindAssemblyNode(asm);
						if (asmNode != null) {
							NamespaceTreeNode nsNode = asmNode.FindNamespaceNode(namespaceName);
							if (nsNode != null) {
								found = true;
								SelectNode(nsNode);
								break;
							}
						}
					}
				} else {
					foreach (LoadedAssembly asm in commandLineLoadedAssemblies) {
						AssemblyDefinition def = asm.AssemblyDefinition;
						if (def != null) {
							MemberReference mr = XmlDocKeyProvider.FindMemberByKey(def.MainModule, args.NavigateTo);
							if (mr != null) {
								found = true;
								JumpToReference(mr);
								break;
							}
						}
					}
				}
				if (!found) {
					AvalonEditTextOutput output = new AvalonEditTextOutput();
					output.Write("Cannot find " + args.NavigateTo);
					decompilerTextView.ShowText(output);
				}
			}
			commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore
		}
开发者ID:jiguixin,项目名称:ILSpy,代码行数:38,代码来源:MainWindow.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextView.DecompilerTextView类代码示例发布时间:2022-05-26
下一篇:
C# ILSpy.TextViewContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap