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; }
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); }
public bool Equals(LexReversal other) { if (!base.Equals(other)) { return(false); } if (Type != other.Type) { return(false); } return(true); }
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 } }
public bool Equals(LexReversal other) { if (!base.Equals(other)) return false; if (Type != other.Type) return false; return true; }