本文整理汇总了C#中dnSpy.Tabs.HexTabState类的典型用法代码示例。如果您正苦于以下问题:C# HexTabState类的具体用法?C# HexTabState怎么用?C# HexTabState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HexTabState类属于dnSpy.Tabs命名空间,在下文中一共展示了HexTabState类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyTo
public void CopyTo(HexTabState tabState) {
tabState.BytesGroupCount = this.BytesGroupCount;
tabState.BytesPerLine = this.BytesPerLine;
tabState.UseHexPrefix = this.UseHexPrefix;
tabState.ShowAscii = this.ShowAscii;
tabState.LowerCaseHex = this.LowerCaseHex;
tabState.AsciiEncoding = this.AsciiEncoding;
tabState.HexBox.HexOffsetSize = this.HexOffsetSize;
tabState.HexBox.UseRelativeOffsets = this.UseRelativeOffsets;
tabState.HexBox.BaseOffset = this.BaseOffset;
tabState.HexBox.StartOffset = this.StartOffset ?? tabState.DocumentStartOffset;
tabState.HexBox.EndOffset = this.EndOffset ?? tabState.DocumentEndOffset;
}
示例2: LocalHexSettings
public LocalHexSettings(HexTabState tabState) {
this.BytesGroupCount = tabState.BytesGroupCount;
this.BytesPerLine = tabState.BytesPerLine;
this.UseHexPrefix = tabState.UseHexPrefix;
this.ShowAscii = tabState.ShowAscii;
this.LowerCaseHex = tabState.LowerCaseHex;
this.AsciiEncoding = tabState.AsciiEncoding;
this.HexOffsetSize = tabState.HexBox.HexOffsetSize;
this.UseRelativeOffsets = tabState.HexBox.UseRelativeOffsets;
this.BaseOffset = tabState.HexBox.BaseOffset;
this.StartOffset = tabState.HexBox.StartOffset == tabState.DocumentStartOffset ? (ulong?)null : tabState.HexBox.StartOffset;
this.EndOffset = tabState.HexBox.EndOffset == tabState.DocumentEndOffset ? (ulong?)null : tabState.HexBox.EndOffset;
}
示例3: CreateNewHexTabState
HexTabState CreateNewHexTabState(TabManager<TabState> tabManager)
{
var tabState = new HexTabState();
return (HexTabState)tabManager.AddNewTabState(tabState);
}
示例4: Execute
protected override void Execute(HexTabState tabState)
{
var doc = tabState.HexBox.Document;
if (doc == null)
return;
var sel = tabState.HexBox.Selection;
if (sel == null)
return;
var dialog = new WF.SaveFileDialog() {
Filter = PickFilenameConstants.AnyFilenameFilter,
RestoreDirectory = true,
ValidateNames = true,
};
if (dialog.ShowDialog() != WF.DialogResult.OK)
return;
var filename = dialog.FileName;
try {
using (var file = File.Create(filename))
Write(doc, file, sel.Value.StartOffset, sel.Value.EndOffset);
}
catch (Exception ex) {
MainWindow.Instance.ShowMessageBox(string.Format("Could not save '{0}'\nERROR: {1}", filename, ex.Message));
}
}
示例5: IsEnabled
protected override bool IsEnabled(HexTabState tabState)
{
return tabState.HexBox.CanPasteUtf8();
}
示例6: Initialize
protected override void Initialize(HexTabState tabState, MenuItem menuItem)
{
foreach (var info in subMenus) {
var mi = new MenuItem {
Header = info.Item2,
IsChecked = info.Item1 == tabState.BytesPerLine,
};
var tmpInfo = info;
mi.Click += (s, e) => tabState.BytesPerLine = tmpInfo.Item1;
menuItem.Items.Add(mi);
}
}
示例7: Execute2
static void Execute2(HexTabState tabState)
{
if (!CanExecute(tabState))
return;
var data = GetBlobData(ClipboardUtils.GetData());
if (data != null)
tabState.HexBox.Paste(data);
}
示例8: IsVisible
protected override bool IsVisible(HexTabState tabState)
{
return CanExecute(tabState);
}
示例9: CanExecute
static bool CanExecute(HexTabState tabState)
{
return tabState != null;
}
示例10: CreateHexTabState
HexTabState CreateHexTabState(HexTabState tabState, SavedHexTabState savedHexTabState)
{
tabState.Restore(savedHexTabState);
return InitializeHexDocument(tabState, savedHexTabState.FileName);
}
示例11: InitializeHexDocument
HexTabState InitializeHexDocument(HexTabState tabState, string filename)
{
var doc = HexDocumentManager.Instance.GetOrCreate(filename);
tabState.SetDocument(doc);
if (doc == null)
ShowIgnorableMessageBox("hex: load doc err", string.Format("Error loading {0}", filename), MessageBoxButton.OK);
return tabState;
}