本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}