public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGDMStructWithSourceCitations;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMSourceCitation aCit = eArgs.ItemData as GDMSourceCitation;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                result = BaseController.ModifySourceCitation(fBaseWin, fUndoman, dataOwner, ref aCit);
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachSourceQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordSourceCitRemove, fDataOwner, aCit);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
            {
                int idx = dataOwner.SourceCitations.IndexOf(aCit);
                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    dataOwner.SourceCitations.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    dataOwner.SourceCitations.Exchange(idx, idx + 1);
                    break;
                }
                result = true;
            }
            break;
            }

            if (result)
            {
                if (eArgs.Action == RecordAction.raAdd)
                {
                    eArgs.ItemData = aCit;
                }

                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #2
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var person = fDataOwner as GDMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || person == null)
            {
                return;
            }

            bool result = false;

            GDMAssociation ast = eArgs.ItemData as GDMAssociation;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                using (var dlg = AppHost.ResolveDialog <IAssociationEditDlg>(fBaseWin)) {
                    bool exists = (ast != null);
                    if (!exists)
                    {
                        ast = new GDMAssociation(person);
                    }

                    dlg.Association = ast;
                    result          = AppHost.Instance.ShowModalX(dlg, false);

                    if (!exists)
                    {
                        if (result)
                        {
                            result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualAssociationAdd, person, ast);
                        }
                        else
                        {
                            ast.Dispose();
                        }
                    }
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_RemoveAssociationQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualAssociationRemove, person, ast);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #3
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGEDCOMStructWithLists;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMNotes notes = eArgs.ItemData as GDMNotes;

            bool result = false;

            GDMNoteRecord noteRec;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                noteRec = fBaseWin.Context.SelectRecord(GDMRecordType.rtNote, null) as GDMNoteRecord;
                if (noteRec != null)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteAdd, (GDMObject)dataOwner, noteRec);
                }
                break;

            case RecordAction.raEdit:
                if (notes != null)
                {
                    noteRec = notes.Value as GDMNoteRecord;
                    result  = BaseController.ModifyNote(fBaseWin, ref noteRec);
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachNoteQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteRemove, (GDMObject)dataOwner, notes);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #4
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var family = fDataOwner as GEDCOMFamilyRecord;

            if (fBaseWin == null || fSheetList == null || family == null)
            {
                return;
            }

            GEDCOMIndividualRecord child = eArgs.ItemData as GEDCOMIndividualRecord;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                child  = fBaseWin.Context.SelectPerson(family.GetHusband(), TargetMode.tmParent, GEDCOMSex.svNone);
                result = (child != null && fBaseWin.Context.IsAvailableRecord(child));
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualParentsAttach, child, family);
                }
                break;

            case RecordAction.raEdit:
                result = (BaseController.ModifyIndividual(fBaseWin, ref child, null, TargetMode.tmNone, GEDCOMSex.svNone));
                break;

            case RecordAction.raDelete:
                result = (child != null && AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachChildQuery)));
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualParentsDetach, child, family);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #5
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var iRec = fDataOwner as GEDCOMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || iRec == null)
            {
                return;
            }

            GEDCOMGroupRecord groupRec = eArgs.ItemData as GEDCOMGroupRecord;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                groupRec = fBaseWin.Context.SelectRecord(GEDCOMRecordType.rtGroup, null) as GEDCOMGroupRecord;
                result   = (groupRec != null);
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otGroupMemberAttach, groupRec, iRec);
                }
                break;

            case RecordAction.raDelete:
                result = (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachGroupQuery)));
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otGroupMemberDetach, groupRec, iRec);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #6
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var grp = fDataOwner as GDMGroupRecord;

            if (fBaseWin == null || fSheetList == null || grp == null)
            {
                return;
            }

            GDMIndividualRecord member = eArgs.ItemData as GDMIndividualRecord;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                member = fBaseWin.Context.SelectPerson(null, TargetMode.tmNone, GDMSex.svUnknown);
                result = (member != null);
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otGroupMemberAttach, grp, member);
                }
                break;

            case RecordAction.raDelete:
                result = (member != null && AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachMemberQuery)));
                if (result)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otGroupMemberDetach, grp, member);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #7
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var research = fDataOwner as GDMResearchRecord;

            if (fBaseWin == null || fSheetList == null || research == null)
            {
                return;
            }

            GDMCommunicationRecord comm = eArgs.ItemData as GDMCommunicationRecord;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                comm   = fBaseWin.Context.SelectRecord(GDMRecordType.rtCommunication, null) as GDMCommunicationRecord;
                result = fUndoman.DoOrdinaryOperation(OperationType.otResearchCommunicationAdd, research, comm);
                break;

            case RecordAction.raEdit:
                result = (comm != null && BaseController.ModifyCommunication(fBaseWin, ref comm));
                break;

            case RecordAction.raDelete:
                if (comm != null && AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachCommunicationQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otResearchCommunicationRemove, research, comm);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #8
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var source = fDataOwner as GDMSourceRecord;

            if (fBaseWin == null || fSheetList == null || source == null)
            {
                return;
            }

            GDMRepositoryCitation cit = eArgs.ItemData as GDMRepositoryCitation;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                GDMRepositoryRecord rep = fBaseWin.Context.SelectRecord(GDMRecordType.rtRepository, null) as GDMRepositoryRecord;
                if (rep != null)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otSourceRepositoryCitationAdd, source, rep);
                }
                break;

            case RecordAction.raDelete:
                if (cit != null && AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachRepositoryQuery)))
                {
                    var repRec = fBaseContext.Tree.GetPtrValue <GDMRepositoryRecord>(cit);
                    result = fUndoman.DoOrdinaryOperation(OperationType.otSourceRepositoryCitationRemove, source, repRec);
                }
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #9
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var iRec = fDataOwner as GEDCOMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || iRec == null)
            {
                return;
            }

            GEDCOMFamilyRecord family = eArgs.ItemData as GEDCOMFamilyRecord;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                result = (BaseController.ModifyFamily(fBaseWin, ref family, TargetMode.tmFamilySpouse, iRec));
                if (result)
                {
                    eArgs.ItemData = family;
                }
                break;

            case RecordAction.raEdit:
                result = (BaseController.ModifyFamily(fBaseWin, ref family, TargetMode.tmNone, null));
                break;

            case RecordAction.raDelete:
                if (family != null && AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachSpouseQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otFamilySpouseDetach, family, iRec);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
            {
                int idx = iRec.IndexOfSpouse(family);

                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    iRec.ExchangeSpouses(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    iRec.ExchangeSpouses(idx, idx + 1);
                    break;
                }

                result = true;
                break;
            }
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #10
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var iRec = fDataOwner as GEDCOMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || iRec == null)
            {
                return;
            }

            GEDCOMPersonalName persName = eArgs.ItemData as GEDCOMPersonalName;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                using (var dlg = AppHost.Container.Resolve <IPersonalNameEditDlg>())
                {
                    dlg.InitDialog(fBaseWin);

                    bool exists = (persName != null);
                    if (!exists)
                    {
                        persName = new GEDCOMPersonalName(fBaseWin.Context.Tree, iRec, "", "");
                    }

                    dlg.PersonalName = persName;
                    result           = AppHost.Instance.ShowModalX(dlg, false);

                    if (!exists)
                    {
                        if (result)
                        {
                            result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualNameAdd, iRec, persName);
                        }
                        else
                        {
                            persName.Dispose();
                        }
                    }
                }
                break;

            case RecordAction.raDelete:
                if (iRec.PersonalNames.Count > 1)
                {
                    result = (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_RemoveNameQuery)));
                    if (result)
                    {
                        result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualNameRemove, iRec, persName);
                    }
                }
                else
                {
                    AppHost.StdDialogs.ShowError(LangMan.LS(LSID.LSID_RemoveNameFailed));
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
                int idx = iRec.PersonalNames.IndexOf(persName);
                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    iRec.PersonalNames.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    iRec.PersonalNames.Exchange(idx, idx + 1);
                    break;
                }
                result = true;
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #11
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var iRec = fDataOwner as GEDCOMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || iRec == null)
            {
                return;
            }

            GEDCOMUserReference userRef = eArgs.ItemData as GEDCOMUserReference;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                using (var dlg = AppHost.Container.Resolve <IUserRefEditDlg>())
                {
                    dlg.InitDialog(fBaseWin);

                    bool exists = (userRef != null);
                    if (!exists)
                    {
                        userRef = new GEDCOMUserReference(fBaseWin.Context.Tree, iRec, "", "");
                    }

                    dlg.UserRef = userRef;
                    result      = AppHost.Instance.ShowModalX(dlg, false);

                    if (!exists)
                    {
                        if (result)
                        {
                            result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualURefAdd, iRec, userRef);
                        }
                        else
                        {
                            userRef.Dispose();
                        }
                    }
                }
                break;

            case RecordAction.raDelete:
            {
                string confirmation =
                    !string.IsNullOrEmpty(userRef.StringValue) ?
                    userRef.StringValue : userRef.ReferenceType;
                confirmation = string.Format(
                    LangMan.LS(LSID.LSID_RemoveUserRefQuery), confirmation);
                if (AppHost.StdDialogs.ShowQuestionYN(confirmation))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualURefRemove, iRec, userRef);
                    fBaseWin.Context.Modified = true;
                }
                break;
            }
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #12
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGEDCOMStructWithLists;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMCustomEvent      evt    = eArgs.ItemData as GDMCustomEvent;
            GDMRecordWithEvents record = dataOwner as GDMRecordWithEvents;

            bool result = false;

            try {
                switch (eArgs.Action)
                {
                case RecordAction.raAdd:
                case RecordAction.raEdit:
                    using (var dlgEventEdit = AppHost.ResolveDialog <IEventEditDlg>(fBaseWin)) {
                        bool exists = (evt != null);

                        GDMCustomEvent newEvent;
                        if (evt != null)
                        {
                            newEvent = evt;
                        }
                        else
                        {
                            if (record is GDMIndividualRecord)
                            {
                                newEvent = new GDMIndividualEvent(record);
                            }
                            else
                            {
                                newEvent = new GDMFamilyEvent(record);
                            }
                        }

                        dlgEventEdit.Event = newEvent;
                        result             = AppHost.Instance.ShowModalX(dlgEventEdit, true);

                        if (!result)
                        {
                            if (!exists)
                            {
                                newEvent.Dispose();
                            }
                        }
                        else
                        {
                            newEvent = dlgEventEdit.Event;

                            if (!exists)
                            {
                                result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventAdd, record, newEvent);
                            }
                            else
                            {
                                if (record is GDMIndividualRecord && newEvent != evt)
                                {
                                    fUndoman.DoOrdinaryOperation(OperationType.otRecordEventRemove, record, evt);
                                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventAdd, record, newEvent);
                                }
                            }

                            evt = newEvent;
                            fBaseWin.Context.CollectEventValues(evt);
                        }
                    }
                    break;

                case RecordAction.raDelete:
                    if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_RemoveEventQuery)))
                    {
                        result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventRemove, record, evt);
                        evt    = null;
                    }
                    break;

                case RecordAction.raMoveUp:
                case RecordAction.raMoveDown:
                {
                    int idx = record.Events.IndexOf(evt);
                    switch (eArgs.Action)
                    {
                    case RecordAction.raMoveUp:
                        record.Events.Exchange(idx - 1, idx);
                        break;

                    case RecordAction.raMoveDown:
                        record.Events.Exchange(idx, idx + 1);
                        break;
                    }
                    result = true;
                }
                break;
                }
            } catch (Exception ex) {
                Logger.LogWrite("EventsListModel.Modify(): " + ex.Message);
                result = false;
            }

            if (result)
            {
                if (eArgs.Action == RecordAction.raAdd)
                {
                    eArgs.ItemData = evt;
                }

                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #13
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGDMStructWithMultimediaLinks;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMMultimediaLink mmLink = eArgs.ItemData as GDMMultimediaLink;

            bool result = false;

            GDMMultimediaRecord mmRec;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                mmRec = fBaseWin.Context.SelectRecord(GDMRecordType.rtMultimedia, new object[0]) as GDMMultimediaRecord;
                if (mmRec != null)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordMediaAdd, (GDMObject)dataOwner, mmRec);
                }
                break;

            case RecordAction.raEdit:
                if (mmLink != null)
                {
                    mmRec  = fBaseContext.Tree.GetPtrValue <GDMMultimediaRecord>(mmLink);
                    result = BaseController.ModifyMedia(fBaseWin, ref mmRec);
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachMultimediaQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordMediaRemove, (GDMObject)dataOwner, mmLink);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
            {
                int idx = dataOwner.MultimediaLinks.IndexOf(mmLink);

                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    dataOwner.MultimediaLinks.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    dataOwner.MultimediaLinks.Exchange(idx, idx + 1);
                    break;
                }

                result = true;
            }
            break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #14
0
 public abstract void Modify(object sender, ModifyEventArgs eArgs);
Пример #15
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var iRec = fDataOwner as GDMIndividualRecord;

            if (fBaseWin == null || fSheetList == null || iRec == null)
            {
                return;
            }

            GDMChildToFamilyLink cfLink = eArgs.ItemData as GDMChildToFamilyLink;

            bool result = false;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                GDMFamilyRecord family = fBaseWin.Context.SelectFamily(iRec);
                if (family != null && family.IndexOfChild(iRec) < 0)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualParentsAttach, iRec, family);
                }
                break;

            case RecordAction.raEdit:
                if (cfLink != null)
                {
                    using (var dlg = AppHost.ResolveDialog <IParentsEditDlg>(fBaseWin)) {
                        dlg.Person = iRec;
                        dlg.Link   = cfLink;
                        result     = AppHost.Instance.ShowModalX(dlg, false);
                    }
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachParentsQuery)))
                {
                    var famRec = fBaseContext.Tree.GetPtrValue(cfLink);
                    result = fUndoman.DoOrdinaryOperation(OperationType.otIndividualParentsDetach, iRec, famRec);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
                int idx = iRec.ChildToFamilyLinks.IndexOf(cfLink);
                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    iRec.ChildToFamilyLinks.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    iRec.ChildToFamilyLinks.Exchange(idx, idx + 1);
                    break;
                }
                result = true;
                break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #16
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGDMStructWithNotes;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMNotes notes = eArgs.ItemData as GDMNotes;

            bool result = false;

            GDMNoteRecord noteRec;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                noteRec = fBaseWin.Context.SelectRecord(GDMRecordType.rtNote, null) as GDMNoteRecord;
                if (noteRec != null)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteAdd, (GDMObject)dataOwner, noteRec);
                    notes  = dataOwner.FindNotes(noteRec);
                }
                break;

            case RecordAction.raEdit:
                if (notes != null)
                {
                    noteRec = fBaseContext.Tree.GetPtrValue <GDMNoteRecord>(notes);
                    result  = BaseController.ModifyNote(fBaseWin, ref noteRec);
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachNoteQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteRemove, (GDMObject)dataOwner, notes);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
            {
                int idx = dataOwner.Notes.IndexOf(notes);
                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    dataOwner.Notes.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    dataOwner.Notes.Exchange(idx, idx + 1);
                    break;
                }
                result = true;
            }
            break;
            }

            if (result)
            {
                if (eArgs.Action == RecordAction.raAdd)
                {
                    eArgs.ItemData = notes;
                }

                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }