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


C# AvalonEditTextOutput.AddButton方法代码示例

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


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

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

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

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

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

示例5: View

		internal 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(Images.Save, "Save", delegate { Save(null); });
				textView.Show(output, null);
				return true;
			} catch (Exception) {
				return false;
			}
		}
开发者ID:tris2481,项目名称:ILSpy,代码行数:18,代码来源:ResourceEntryNode.cs

示例6: LoadImage

 bool LoadImage(AvalonEditTextOutput output)
 {
     try {
         value.Position = 0;
         BitmapImage image = new BitmapImage();
         image.BeginInit();
         image.StreamSource = value;
         image.EndInit();
         output.AddUIElement(() => new Image { Source = image });
         output.WriteLine();
         output.AddButton(Images.Save, "Save", delegate { Save(null); });
     } catch (Exception) {
         return false;
     }
     return true;
 }
开发者ID:petr-k,项目名称:ILSpy,代码行数:16,代码来源:ResourceEntryNode.cs


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