예제 #1
0
        public override void Load(string fileName)
        {
            using (Stream stream = File.OpenRead(fileName)) {
                hexEditor.HexEditorData.Buffer = ArrayBuffer.Load(stream);
            }

            ContentName  = fileName;
            this.IsDirty = false;
            hexEditor.SetFocus();
        }
예제 #2
0
        public override async Task Load(FileOpenInformation fileOpenInformation)
        {
            var fileName = fileOpenInformation.FileName;

            using (Stream stream = File.OpenRead(fileName)) {
                hexEditor.HexEditorData.Buffer = await ArrayBuffer.LoadAsync(stream);
            }

            ContentName  = fileName;
            this.IsDirty = false;
            hexEditor.SetFocus();
        }
예제 #3
0
        protected override async Task <Control> OnGetViewControlAsync(CancellationToken token, DocumentViewContent view)
        {
            view.Title = GettextCatalog.GetString("Binary");
            hexEditor  = new Mono.MHex.HexEditor();
            await Model.Load();

            hexEditor.HexEditorData.ByteBuffer = ((ByteBufferModel)Model).ByteBuffer;
            hexEditor.HexEditorStyle           = new MonoDevelopHexEditorStyle(hexEditor);
            SetOptions();
            DefaultSourceEditorOptions.Instance.Changed += Instance_Changed;
            hexEditor.HexEditorData.Changed             += delegate {
                this.HasUnsavedChanges = true;
            };
            window = new ScrollView(hexEditor);
            await LoadContent();

            hexEditor.SetFocus();

            return(new XwtControl(window));
        }