Exemple #1
0
        public static void Execute(ITextEditorUIContext uiContext, Lazy <IMethodAnnotations> methodAnnotations)
        {
            if (!CanExecute(uiContext))
            {
                return;
            }

            var copier = new InstructionILBytesCopier();
            var text   = copier.Copy(FindInstructions(uiContext), methodAnnotations);

            if (text.Length > 0)
            {
                Clipboard.SetText(text);
                if (copier.FoundUnknownBytes)
                {
                    Shared.App.MsgBox.Instance.ShowIgnorableMessage(new Guid("141A1744-13CD-4835-A804-08D93D8E0D2B"),
                                                                    dnSpy_AsmEditor_Resources.UnknownBytesMsg,
                                                                    MsgBoxButton.OK);
                }
            }
        }
Exemple #2
0
        public static void Execute(IDocumentViewer documentViewer, Lazy <IMethodAnnotations> methodAnnotations)
        {
            if (!CanExecute(documentViewer))
            {
                return;
            }

            var copier = new InstructionILBytesCopier();
            var text   = copier.Copy(FindInstructions(documentViewer), methodAnnotations);

            if (text.Length > 0)
            {
                try {
                    Clipboard.SetText(text);
                }
                catch (ExternalException) { }
                if (copier.FoundUnknownBytes)
                {
                    MsgBox.Instance.ShowIgnorableMessage(new Guid("141A1744-13CD-4835-A804-08D93D8E0D2B"),
                                                         dnSpy_AsmEditor_Resources.UnknownBytesMsg,
                                                         MsgBoxButton.OK);
                }
            }
        }
		public static void Execute(ITextEditorUIContext uiContext, Lazy<IMethodAnnotations> methodAnnotations) {
			if (!CanExecute(uiContext))
				return;

			var copier = new InstructionILBytesCopier();
			var text = copier.Copy(FindInstructions(uiContext), methodAnnotations);
			if (text.Length > 0) {
				try {
					Clipboard.SetText(text);
				}
				catch (ExternalException) { }
				if (copier.FoundUnknownBytes) {
					Shared.App.MsgBox.Instance.ShowIgnorableMessage(new Guid("141A1744-13CD-4835-A804-08D93D8E0D2B"),
						dnSpy_AsmEditor_Resources.UnknownBytesMsg,
						MsgBoxButton.OK);
				}
			}
		}