public static bool AddIndividualPortrait(IBaseWindow baseWin, ChangeTracker localUndoman, GEDCOMIndividualRecord iRec) { bool result = false; GEDCOMMultimediaRecord mmRec = baseWin.Context.SelectRecord(GEDCOMRecordType.rtMultimedia, null) as GEDCOMMultimediaRecord; if (mmRec == null) { return(false); } // remove previous portrait link GEDCOMMultimediaLink mmLink = iRec.GetPrimaryMultimediaLink(); if (mmLink != null) { mmLink.IsPrimary = false; } // set new portrait link mmLink = iRec.SetPrimaryMultimediaLink(mmRec); // select portrait area using (var selectDlg = AppHost.Container.Resolve <IPortraitSelectDlg>(baseWin)) { selectDlg.MultimediaLink = mmLink; result = AppHost.Instance.ShowModalX(selectDlg, false); } if (result) { result = localUndoman.DoOrdinaryOperation(OperationType.otIndividualPortraitAttach, iRec, mmLink); } return(result); }
public static bool AddIndividualPortrait(IBaseWindow baseWin, GEDCOMIndividualRecord iRec) { bool result = false; GEDCOMMultimediaRecord mmRec = baseWin.Context.SelectRecord(GEDCOMRecordType.rtMultimedia, null) as GEDCOMMultimediaRecord; if (mmRec == null) { return(false); } // remove previous portrait link GEDCOMMultimediaLink mmLink = iRec.GetPrimaryMultimediaLink(); if (mmLink != null) { mmLink.IsPrimary = false; } // set new portrait link mmLink = iRec.SetPrimaryMultimediaLink(mmRec); // select portrait area using (var selectDlg = AppHost.Container.Resolve <IPortraitSelectDlg>()) { selectDlg.InitDialog(baseWin); selectDlg.MultimediaLink = mmLink; result = AppHost.Instance.ShowModalX(selectDlg, false); } return(result); }
public static bool DeleteIndividualPortrait(IBaseWindow baseWin, ChangeTracker localUndoman, GEDCOMIndividualRecord iRec) { GEDCOMMultimediaLink mmLink = iRec.GetPrimaryMultimediaLink(); if (mmLink != null) { return(localUndoman.DoOrdinaryOperation(OperationType.otIndividualPortraitDetach, iRec, mmLink)); } return(false); }
public static bool DeleteIndividualPortrait(IBaseWindow baseWin, GEDCOMIndividualRecord iRec) { GEDCOMMultimediaLink mmLink = iRec.GetPrimaryMultimediaLink(); if (mmLink == null) { return(false); } mmLink.IsPrimary = false; return(true); }