public void GEDCOMUtils_Tests()
        {
            GEDCOMObject obj = new GEDCOMObject();

            obj.ExtData = this;
            Assert.AreEqual(obj.ExtData, this);
            obj.Dispose();

            //

            Assert.AreEqual("I12", GEDCOMUtils.CleanXRef("@I12@"), "CleanXRef(@I12@)");
            Assert.AreEqual("@I12@", GEDCOMUtils.EncloseXRef("I12"), "EncloseXRef(I12)");

            //
            string s1 = " 12345 efgh";
            string s2 = "";

            s2 = GEDCOMUtils.ExtractDelimiter(s1, 0);
            Assert.AreEqual("12345 efgh", s2);

            //

            string s3 = GEDCOMUtils.ExtractDelimiter("    abrvalg", 2);

            Assert.AreEqual("  abrvalg", s3);
        }
Beispiel #2
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            try
            {
                fTask.Priority = (GKResearchPriority)txtPriority.SelectedIndex;
                fTask.StartDate.Assign(GEDCOMDate.CreateByFormattedStr(txtStartDate.Text, true));
                fTask.StopDate.Assign(GEDCOMDate.CreateByFormattedStr(txtStopDate.Text, true));

                GKGoalType gt = (GKGoalType)cmbGoalType.SelectedIndex;
                switch (gt)
                {
                case GKGoalType.gtIndividual:
                case GKGoalType.gtFamily:
                case GKGoalType.gtSource:
                    fTask.Goal = GEDCOMUtils.EncloseXRef(fTempRec.XRef);
                    break;

                case GKGoalType.gtOther:
                    fTask.Goal = txtGoal.Text;
                    break;
                }

                CommitChanges();

                Base.NotifyRecord(fTask, RecordAction.raEdit);

                DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                Logger.LogWrite("TaskEditDlg.btnAccept_Click(): " + ex.Message);
                DialogResult = DialogResult.None;
            }
        }
Beispiel #3
0
        public override void ReplaceXRefs(GDMXRefReplacer map)
        {
            base.ReplaceXRefs(map);

            if (GEDCOMUtils.IsXRef(fGoal))
            {
                fGoal = GEDCOMUtils.EncloseXRef(map.FindNewXRef(GEDCOMUtils.CleanXRef(fGoal)));
            }
        }
        public void SetCorresponder(GKCommunicationDir commDir, GEDCOMIndividualRecord corresponder)
        {
            DeleteTag("FROM");
            DeleteTag("TO");

            if (corresponder != null)
            {
                AddTag(CommunicationTags[(int)commDir], GEDCOMUtils.EncloseXRef(corresponder.XRef), null);
            }
        }
Beispiel #5
0
        public override void ReplaceXRefs(GDMXRefReplacer map)
        {
            base.ReplaceXRefs(map);

            TaskGoalRet goalRet = GetTaskGoal();

            if (goalRet.GoalType != GDMGoalType.gtOther)
            {
                Goal = GEDCOMUtils.EncloseXRef(map.FindNewXRef(GEDCOMUtils.CleanXRef(Goal)));
            }
        }
Beispiel #6
0
 public void Test_XRef_CleanEnclose()
 {
     Assert.AreEqual("I12", GEDCOMUtils.CleanXRef("@I12@"), "CleanXRef(@I12@)");
     Assert.AreEqual("@I12@", GEDCOMUtils.EncloseXRef("I12"), "EncloseXRef(I12)");
 }
Beispiel #7
0
 protected override string GetStringValue()
 {
     return(GEDCOMUtils.EncloseXRef(fXRef));
 }