Ejemplo n.º 1
0
		public override IPalasoDataObjectProperty Clone()
		{
			var clone = new LexEtymology(Type, Source);
			clone.Gloss = (MultiText)Gloss.Clone();
			clone.Comment = (MultiText)Comment.Clone();
			clone.Traits = new List<LexTrait>(Traits.Select(t=>t.Clone()));
			clone.Fields = new List<LexField>(Fields.Select(f => (LexField)f.Clone()));
			//copies from MultiText
			clone.EmbeddedXmlElements = new List<string>(EmbeddedXmlElements);
			clone.Forms = Forms.Select(f => (LanguageForm) f.Clone()).ToArray();
			return clone;
		}
Ejemplo n.º 2
0
        public override IPalasoDataObjectProperty Clone()
        {
            var clone = new LexEtymology(Type, Source);

            clone.Gloss   = (MultiText)Gloss.Clone();
            clone.Comment = (MultiText)Comment.Clone();
            clone.Traits  = new List <LexTrait>(Traits.Select(t => t.Clone()));
            clone.Fields  = new List <LexField>(Fields.Select(f => (LexField)f.Clone()));
            //copies from MultiText
            clone.EmbeddedXmlElements = new List <string>(EmbeddedXmlElements);
            clone.Forms = Forms.Select(f => (LanguageForm)f.Clone()).ToArray();
            return(clone);
        }
Ejemplo n.º 3
0
		public bool Equals(LexEtymology other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			if (!base.Equals(other)) return false;
			if (!Gloss.Equals(other.Gloss)) return false;
			if (!Comment.Equals(other.Comment)) return false;
			if (!Traits.SequenceEqual(other.Traits)) return false; //order matters because we expose a list interface
			if (!Fields.SequenceEqual(other.Fields)) return false; //order matters because we expose a list interface
			if (!Type.Equals(other.Type)) return false;
			if (!Source.Equals(other.Source)) return false;
			return true;
		}
Ejemplo n.º 4
0
 public bool Equals(LexEtymology other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (!base.Equals(other))
     {
         return(false);
     }
     if (!Gloss.Equals(other.Gloss))
     {
         return(false);
     }
     if (!Comment.Equals(other.Comment))
     {
         return(false);
     }
     if (!Traits.SequenceEqual(other.Traits))
     {
         return(false);                                                 //order matters because we expose a list interface
     }
     if (!Fields.SequenceEqual(other.Fields))
     {
         return(false);                                                 //order matters because we expose a list interface
     }
     if (!Type.Equals(other.Type))
     {
         return(false);
     }
     if (!Source.Equals(other.Source))
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 5
0
		public void EntryWithFullEtymology()
		{
			using (var session = new LiftExportAsFragmentTestSession())
			{
				var e = session.CreateItem();
				var etymology = new LexEtymology("theType", "theSource");
				etymology.SetAlternative("etr", "theProtoform");
				etymology.Gloss.SetAlternative("en", "engloss");
				etymology.Gloss.SetAlternative("fr", "frgloss");
				etymology.Comment.SetAlternative("en", "metathesis?");
				e.Etymologies.Add(etymology);
				session.LiftWriter.Add(e);
				session.LiftWriter.End();
				AssertHasOneMatch("entry/etymology/form[@lang='etr' and text='theProtoform']", session);
				AssertHasOneMatch("entry/etymology[@type='theType' and @source='theSource']", session);

				//handling of comments may change, the issue has been raised on the LIFT google group
				AssertHasOneMatch("entry/etymology/field[@type='comment']/form[@lang='en' and text='metathesis?']", session);
			}
		}
Ejemplo n.º 6
0
		public void EntryWithSimpleEtymology()
		{
			using (var session = new LiftExportAsFragmentTestSession())
			{
				var e = session.CreateItem();
				var etymology = new LexEtymology("theType", "theSource");
				etymology.SetAlternative("etr", "one");
				e.Etymologies.Add(etymology);
				session.LiftWriter.Add(e);
				session.LiftWriter.End();
				AssertHasOneMatch("entry/etymology/form[@lang='etr' and text='one']", session);
				AssertHasOneMatch("entry/etymology[@type='theType' and @source='theSource']", session);
			}
		}