コード例 #1
0
ファイル: HCUndoData.cs プロジェクト: qq32qq/HCView-CSharp
        protected void UndoAction_ItemParaFirst(int aItemNo, int aOffset, bool aNewParaFirst)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCItemParaFirstUndoAction vItemAction = new HCItemParaFirstUndoAction();
                    vItemAction.ItemNo       = aItemNo;
                    vItemAction.Offset       = aOffset;
                    vItemAction.OldParaFirst = Items[aItemNo].ParaFirst;
                    vItemAction.NewParaFirst = aNewParaFirst;

                    vUndo.Actions.Add(vItemAction);
                }
            }
        }
コード例 #2
0
        public HCCustomUndoAction ActionAppend(UndoActionTag ATag, int AItemNo, int AOffset)
        {
            HCCustomUndoAction Result = null;

            switch (ATag)
            {
            case UndoActionTag.uatDeleteText:
            case UndoActionTag.uatInsertText:
                Result = new HCTextUndoAction();
                break;

            case UndoActionTag.uatDeleteItem:
            case UndoActionTag.uatInsertItem:
                Result = new HCItemUndoAction();
                break;

            case UndoActionTag.uatItemProperty:
                Result = new HCItemParaFirstUndoAction();
                break;

            case UndoActionTag.uatItemSelf:
                Result = new HCItemSelfUndoAction();
                break;

            default:
                Result = new HCCustomUndoAction();
                break;
            }

            Result.Tag    = ATag;
            Result.ItemNo = AItemNo;
            Result.Offset = AOffset;

            this.Actions.Add(Result);

            return(Result);
        }