Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 66 additions & 12 deletions src/SIL.LCModel/DomainImpl/OverridesLing_Lex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
// This file holds the overrides of the generated classes for the Ling module.
// </remarks>

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using SIL.LCModel.Application;
using SIL.LCModel.Core.Cellar;
using SIL.LCModel.Core.KernelInterfaces;
Expand All @@ -27,6 +17,16 @@
using SIL.LCModel.Infrastructure.Impl;
using SIL.LCModel.Utils;
using SIL.ObjectModel;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;

namespace SIL.LCModel.DomainImpl
{
Expand Down Expand Up @@ -7528,7 +7528,7 @@ public int OrderNumber
}
}

internal partial class PhRegularRule
internal partial class PhRegularRule : ICloneableCmObject
{
/// <summary>
/// Gets all of the feature constraints in this rule.
Expand Down Expand Up @@ -7670,6 +7670,34 @@ protected override void RemoveObjectSideEffectsInternal(RemoveObjectEventArgs e)
}
}
}

#region ICloneableCmObject Members
/// ------------------------------------------------------------------------------------
/// <summary>
/// Clones this instance.
/// </summary>
/// <param name="clone">Destination object for clone operation</param>
/// ------------------------------------------------------------------------------------
public void SetCloneProperties(ICmObject clone)
{
IPhRegularRule rule = clone as IPhRegularRule;
if (rule == null)
throw new ApplicationException("Failed to copy regular phonological rule: the target is not a regular phonological rule.");

rule.Description.CopyAlternatives(Description);
rule.Direction = Direction;
rule.Disabled = Disabled;
rule.Name.CopyAlternatives(Name);
// FeatureConstraints is synthetic.
rule.FinalStratumRA = FinalStratumRA;
rule.InitialStratumRA = InitialStratumRA;
rule.RightHandSidesOS.Clear(); // Remove default.
CopyObject<IPhSegRuleRHS>.CloneLcmObjects(RightHandSidesOS, newRhs =>
rule.RightHandSidesOS.Add(newRhs));
CopyObject<IPhSimpleContext>.CloneLcmObjects(StrucDescOS, newDesc =>
rule.StrucDescOS.Add(newDesc));
}
#endregion
}

internal partial class PhSegRuleRHS
Expand Down Expand Up @@ -7734,7 +7762,7 @@ private void CollectInflectionClassesAndSubclasses(List<ICmObject> result, IEnum
}
}

internal partial class PhMetathesisRule
internal partial class PhMetathesisRule : ICloneableCmObject
{
/// <summary>
/// Gets the structural change indices.
Expand Down Expand Up @@ -8135,6 +8163,32 @@ protected override void SetDefaultValuesAfterInit()
base.SetDefaultValuesAfterInit();
SetStrucChangeIndices(new int[] { -1, -1, -1, -1, -1 }, true);
}

#region ICloneableCmObject Members
/// ------------------------------------------------------------------------------------
/// <summary>
/// Clones this instance.
/// </summary>
/// <param name="clone">Destination object for clone operation</param>
/// ------------------------------------------------------------------------------------
public void SetCloneProperties(ICmObject clone)
{
IPhMetathesisRule rule = clone as IPhMetathesisRule;
if (rule == null)
throw new ApplicationException("Failed to copy metathesis phonological rule: the target is not a regular metathesis rule.");

rule.Description.CopyAlternatives(Description);
rule.Direction = Direction;
rule.Disabled = Disabled;
rule.Name.CopyAlternatives(Name);
// FeatureConstraints is synthetic.
rule.FinalStratumRA = FinalStratumRA;
rule.InitialStratumRA = InitialStratumRA;
rule.StrucChange = StrucChange;
CopyObject<IPhSimpleContext>.CloneLcmObjects(StrucDescOS, newDesc =>
rule.StrucDescOS.Add(newDesc));
}
#endregion
}

internal partial class PhIterationContext
Expand Down
Loading