示例#1
0
		public HexBoxWriteEventArgs(HexWriteType type, ulong offs, int size, bool isBeforeWrite, Dictionary<object, object> context = null) {
			this.Type = type;
			this.StartOffset = offs;
			this.EndOffset = size == 0 ? offs : NumberUtils.AddUInt64(offs, (ulong)(size - 1));
			this.Size = size;
			this.IsBeforeWrite = isBeforeWrite;
			this.Context = context ?? new Dictionary<object, object>();
		}
示例#2
0
 public HexBoxWriteEventArgs(HexWriteType type, ulong offs, int size, bool isBeforeWrite, Dictionary <object, object> context = null)
 {
     this.Type          = type;
     this.StartOffset   = offs;
     this.EndOffset     = size == 0 ? offs : NumberUtils.AddUInt64(offs, (ulong)(size - 1));
     this.Size          = size;
     this.IsBeforeWrite = isBeforeWrite;
     this.Context       = context ?? new Dictionary <object, object>();
 }
示例#3
0
		bool TryUpdateOldTextInputCommand(HexWriteType type, HexBox hexBox, HexBoxPosition posBeforeWrite, ulong startOffset, byte[] originalData) {
			if (type != HexWriteType.ByteInput && type != HexWriteType.AsciiInput)
				return false;

			var cmd = (HexBoxUndoCommand)prevTextInputCmd.Target;
			if (cmd == null)
				return false;

			return cmd.TryAppend(hexBox, posBeforeWrite, startOffset, originalData);
		}
示例#4
0
        bool TryUpdateOldTextInputCommand(HexWriteType type, HexBox hexBox, HexBoxPosition posBeforeWrite, ulong startOffset, byte[] originalData)
        {
            if (type != HexWriteType.ByteInput && type != HexWriteType.AsciiInput)
            {
                return(false);
            }

            var cmd = (HexBoxUndoCommand)prevTextInputCmd.Target;

            if (cmd == null)
            {
                return(false);
            }

            return(cmd.TryAppend(hexBox, posBeforeWrite, startOffset, originalData));
        }
示例#5
0
文件: HexBox.cs 项目: lovebanyi/dnSpy
 Dictionary<object, object> NotifyWrite(HexWriteType type, ulong offs, int count, bool isBeforeWrite, Dictionary<object, object> context)
 {
     var ea = new HexBoxWriteEventArgs(type, offs, count, isBeforeWrite, context);
     if (OnWrite != null)
         OnWrite(this, ea);
     return ea.Context;
 }
示例#6
0
文件: HexBox.cs 项目: lovebanyi/dnSpy
 Dictionary<object, object> NotifyBeforeWrite(HexWriteType type, ulong offs, int count)
 {
     return NotifyWrite(type, offs, count, true, null);
 }
示例#7
0
文件: HexBox.cs 项目: lovebanyi/dnSpy
 void NotifyAfterWrite(HexWriteType type, ulong offs, int count, Dictionary<object, object> context)
 {
     NotifyWrite(type, offs, count, false, context);
 }