public override bool CanAccept(int aOffset, HCItemAction aAction) { bool Result = base.CanAccept(aOffset, aAction); if (Result) { if (this.IsElement) { if (aAction == HCItemAction.hiaInsertChar) { Result = false; } else if ((aAction == HCItemAction.hiaBackDeleteChar) || (aAction == HCItemAction.hiaDeleteChar) || (aAction == HCItemAction.hiaRemove)) { Result = !FEditProtect; } } else { Result = !FEditProtect; } } if (!Result) { User.MessageBeep(0); } return(Result); }
protected override void DoItemAction(int aItemNo, int aOffset, HCItemAction aAction) { switch (aAction) { case HCItemAction.hiaRemove: _AnnotateRemove(aItemNo, aOffset); break; case HCItemAction.hiaInsertChar: _AnnotateInsertChar(aItemNo, aOffset); break; case HCItemAction.hiaBackDeleteChar: _AnnotateBackChar(aItemNo, aOffset); break; case HCItemAction.hiaDeleteChar: _AnnotateDeleteChar(aItemNo, aOffset); break; } }
public virtual bool CanAccept(int aOffset, HCItemAction aAction) { return(true); }