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


C# Tabs.HexTabState类代码示例

本文整理汇总了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;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:13,代码来源:LocalHexSettings.cs

示例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;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:13,代码来源:LocalHexSettings.cs

示例3: CreateNewHexTabState

 HexTabState CreateNewHexTabState(TabManager<TabState> tabManager)
 {
     var tabState = new HexTabState();
     return (HexTabState)tabManager.AddNewTabState(tabState);
 }
开发者ID:DeepSkyFire,项目名称:dnSpy,代码行数:5,代码来源:MainWindow.xaml.cs

示例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));
            }
        }
开发者ID:thinkv,项目名称:dnSpy,代码行数:27,代码来源:ContextMenuCommands.cs

示例5: IsEnabled

 protected override bool IsEnabled(HexTabState tabState)
 {
     return tabState.HexBox.CanPasteUtf8();
 }
开发者ID:thinkv,项目名称:dnSpy,代码行数:4,代码来源:ContextMenuCommands.cs

示例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);
     }
 }
开发者ID:thinkv,项目名称:dnSpy,代码行数:12,代码来源:ContextMenuCommands.cs

示例7: Execute2

        static void Execute2(HexTabState tabState)
        {
            if (!CanExecute(tabState))
                return;

            var data = GetBlobData(ClipboardUtils.GetData());
            if (data != null)
                tabState.HexBox.Paste(data);
        }
开发者ID:thinkv,项目名称:dnSpy,代码行数:9,代码来源:ContextMenuCommands.cs

示例8: IsVisible

 protected override bool IsVisible(HexTabState tabState)
 {
     return CanExecute(tabState);
 }
开发者ID:thinkv,项目名称:dnSpy,代码行数:4,代码来源:ContextMenuCommands.cs

示例9: CanExecute

 static bool CanExecute(HexTabState tabState)
 {
     return tabState != null;
 }
开发者ID:thinkv,项目名称:dnSpy,代码行数:4,代码来源:ContextMenuCommands.cs

示例10: CreateHexTabState

 HexTabState CreateHexTabState(HexTabState tabState, SavedHexTabState savedHexTabState)
 {
     tabState.Restore(savedHexTabState);
     return InitializeHexDocument(tabState, savedHexTabState.FileName);
 }
开发者ID:DeepSkyFire,项目名称:dnSpy,代码行数:5,代码来源:MainWindow.xaml.cs

示例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;
 }
开发者ID:DeepSkyFire,项目名称:dnSpy,代码行数:8,代码来源:MainWindow.xaml.cs


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