コード例 #1
0
        public override void Clear()
        {
            base.Clear();

            fCertaintyAssessment = -1;
            fDescription.Clear();
            fPage = string.Empty;
        }
コード例 #2
0
        public override void Clear()
        {
            base.Clear();

            fCertaintyAssessment = -1;
            fData.Clear();
            fDescription.Clear();
            fPage = string.Empty;
            fText.Clear();
            fNotes.Clear();
            fMultimediaLinks.Clear();
        }
コード例 #3
0
        public override void Clear()
        {
            base.Clear();

            fLines.Clear();
            fAddressLine1      = string.Empty;
            fAddressLine2      = string.Empty;
            fAddressLine3      = string.Empty;
            fAddressCity       = string.Empty;
            fAddressState      = string.Empty;
            fAddressPostalCode = string.Empty;
            fAddressCountry    = string.Empty;

            fPhoneList.Clear();
            fEmailList.Clear();
            fFaxList.Clear();
            fWWWList.Clear();
        }
コード例 #4
0
ファイル: GDMNotes.cs プロジェクト: Akeloya/GEDKeeper
        public override string ParseString(string strValue)
        {
            string result = base.ParseString(strValue);

            if (!IsPointer)
            {
                fLines.Clear();
                if (!string.IsNullOrEmpty(result))
                {
                    fLines.Add(result);
                }
                result = string.Empty;
            }
            return(result);
        }
コード例 #5
0
ファイル: GDMLinesTests.cs プロジェクト: m-kosina/GEDKeeper
        public void Test_Common()
        {
            string[] list = new string[] { "The", "string", "list", "test" };

            var strList0 = new GDMLines();

            strList0.Text = "The string list test";
            Assert.AreEqual("The string list test", strList0.Text);

            GDMLines strList = new GDMLines(list);

            Assert.AreEqual("The", strList[0]);
            Assert.AreEqual("string", strList[1]);
            Assert.AreEqual("list", strList[2]);
            Assert.AreEqual("test", strList[3]);

            Assert.AreEqual(0, strList.IndexOf("The"));
            Assert.AreEqual(1, strList.IndexOf("string"));
            Assert.AreEqual(2, strList.IndexOf("list"));
            Assert.AreEqual(3, strList.IndexOf("test"));
            Assert.AreEqual(-1, strList.IndexOf("abrakadabra"));

            Assert.AreEqual("The\r\nstring\r\nlist\r\ntest", strList.Text);

            var strList1 = new GDMLines("The\r\nstring\r\nlist\r\ntest");

            Assert.AreEqual("The", strList1[0]);
            Assert.AreEqual("string", strList1[1]);
            Assert.AreEqual("list", strList1[2]);
            Assert.AreEqual("test", strList1[3]);

            GDMLines strList2 = new GDMLines();

            strList2.Assign(null);
            strList2.Assign(strList);
            Assert.AreEqual("The", strList2[0]);
            Assert.AreEqual("string", strList2[1]);
            Assert.AreEqual("list", strList2[2]);
            Assert.AreEqual("test", strList2[3]);
            strList2.Clear();

            GDMLines otherList = null;

            Assert.Throws(typeof(ArgumentNullException), () => { strList2.AddRange(otherList); });

            strList2.AddRange(strList);
            Assert.AreEqual("The", strList2[0]);
            Assert.AreEqual("string", strList2[1]);
            Assert.AreEqual("list", strList2[2]);
            Assert.AreEqual("test", strList2[3]);
            Assert.Throws(typeof(ArgumentOutOfRangeException), () => { strList2.RemoveAt(-1); });

            Assert.Throws(typeof(ArgumentOutOfRangeException), () => { object item = strList2[-1]; });
            Assert.Throws(typeof(ArgumentOutOfRangeException), () => { strList2[-1] = null; });

            string[] listVals = strList.ToArray();
            Assert.AreEqual("The", listVals[0]);
            Assert.AreEqual("string", listVals[1]);
            Assert.AreEqual("list", listVals[2]);
            Assert.AreEqual("test", listVals[3]);

            strList[2] = "string2";
            Assert.AreEqual("string2", strList[2]);

            strList.Insert(0, "insert test");
            Assert.AreEqual("insert test", strList[0]);
            Assert.Throws(typeof(ArgumentOutOfRangeException), () => { strList.Insert(-1, "insert test2"); }); // List index out of bounds

            strList.Clear();
            Assert.IsTrue(strList.IsEmpty());

            string[] strArr = null;
            Assert.Throws(typeof(ArgumentNullException), () => { strList.AddRange(strArr); });
        }
コード例 #6
0
ファイル: GDMNoteRecord.cs プロジェクト: m-kosina/GEDKeeper
 public override void Clear()
 {
     base.Clear();
     fLines.Clear();
 }