コード例 #1
0
ファイル: LexReversal.cs プロジェクト: JohnThomson/libpalaso
		public override IPalasoDataObjectProperty Clone()
		{
			var clone = new LexReversal();
			clone.Type = Type;
			//copied directly from MultiText.Clone as we unfortunately can't just call that method and have it do the right thing.
			//If this class were composed of a multitext rather than inheriting this wouldn't be a problem.
			clone.EmbeddedXmlElements = new List<string>(EmbeddedXmlElements);
			clone.Forms = Forms.Select(f => (LanguageForm)f.Clone()).ToArray();
			return clone;
		}
コード例 #2
0
ファイル: LexReversal.cs プロジェクト: smitcham/libpalaso
        public override IPalasoDataObjectProperty Clone()
        {
            var clone = new LexReversal();

            clone.Type = Type;
            //copied directly from MultiText.Clone as we unfortunately can't just call that method and have it do the right thing.
            //If this class were composed of a multitext rather than inheriting this wouldn't be a problem.
            clone.EmbeddedXmlElements = new List <string>(EmbeddedXmlElements);
            clone.Forms = Forms.Select(f => (LanguageForm)f.Clone()).ToArray();
            return(clone);
        }
コード例 #3
0
ファイル: LexReversal.cs プロジェクト: smitcham/libpalaso
 public bool Equals(LexReversal other)
 {
     if (!base.Equals(other))
     {
         return(false);
     }
     if (Type != other.Type)
     {
         return(false);
     }
     return(true);
 }
コード例 #4
0
ファイル: LexReversal.cs プロジェクト: JohnThomson/libpalaso
		public bool Equals(LexReversal other)
		{
			if (!base.Equals(other)) return false;
			if (Type != other.Type) return false;
			return true;
		}
コード例 #5
0
		public void SenseWith2Reversals()
		{
			using (var session = new LiftExportAsFragmentTestSession())
			{
				var sense = new LexSense();
				var reversal = new LexReversal {Type = "revType"};
				reversal.SetAlternative("en", "one");
				sense.Reversals.Add(reversal);
				var reversal2 = new LexReversal();
				reversal2.SetAlternative("en", "two");
				sense.Reversals.Add(reversal2);
				session.LiftWriter.Add(sense);
				session.LiftWriter.End();
				AssertHasOneMatch("sense/reversal/form[@lang='en' and text='one']", session);
				AssertHasOneMatch("sense/reversal/form[@lang='en' and text='two']", session);
				AssertHasOneMatch("sense/reversal[@type='revType']", session);
				AssertHasOneMatch("sense/reversal/@type", session); //only one had a type
			}
		}