Example #1
0
 public MixedCodeDataModel(MixedCodeDataModel that)
 {
     this.program      = that.program;
     this.curPos       = that.curPos;
     this.endPos       = that.endPos;
     this.instructions = that.instructions;
     this.LineCount    = that.LineCount;
 }
Example #2
0
        private void RefreshModel()
        {
            var currentPos = Model.CurrentPosition;
            var model      = new MixedCodeDataModel(program);

            model.MoveToLine(currentPos, 0);
            currentPos   = Model.CurrentPosition;
            this.addrTop = MixedCodeDataModel.PositionAddress(currentPos);
            this.Model   = model;
        }
Example #3
0
        public Address GetAnchorAddress()
        {
            var pt             = GetAnchorMiddlePoint();
            var memoryTextSpan = GetTagFromPoint(pt) as MixedCodeDataModel.MemoryTextSpan;

            if (memoryTextSpan == null || memoryTextSpan.Address == null)
            {
                return(MixedCodeDataModel.PositionAddress(anchorPos.Line));
            }
            return(memoryTextSpan.Address);
        }
Example #4
0
 private void OnTopAddressChanged()
 {
     if (program != null)
     {
         var addrTopPos = MixedCodeDataModel.Position(addrTop, 0);
         Model.MoveToLine(addrTopPos, 0);
         RecomputeLayout();
         UpdateScrollbar();
         Invalidate();
     }
 }
Example #5
0
 public MixedCodeDataModel(MixedCodeDataModel that)
 {
     this.program       = that.program;
     this.imageMap      = that.imageMap;
     this.curPos        = that.curPos;
     this.StartPosition = that.StartPosition;
     this.endPos        = that.endPos;
     this.instructions  = that.instructions;
     this.LineCount     = that.LineCount;
     this.comments      = that.comments;
 }
Example #6
0
 protected override void OnScroll()
 {
     if (Model is MixedCodeDataModel)
     {
         var currentPos = Model.CurrentPosition;
         addrTop = MixedCodeDataModel.PositionAddress(currentPos);
     }
     else
     {
         addrTop = null;
     }
     base.OnScroll();
 }
Example #7
0
 private void OnProgramChanged()
 {
     try
     {
         if (program != null)
         {
             Model = new MixedCodeDataModel(program);
             var currentPos = Model.CurrentPosition;
             addrTop = MixedCodeDataModel.PositionAddress(currentPos);
             return;
         }
     }
     catch (Exception ex)
     {
         Services.RequireService <IDiagnosticsService>().Error(ex, "An error occurred while displaying the program.");
     }
     Model   = new EmptyEditorModel();
     addrTop = null;
 }