src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/DomainClasses/EntityDesignerViewModel.cs
/// <summary>
///     Given a DSL Property return the previous sibling.
///     The method will do the following:
///     - Given the DSL Property get its model property from Model XRef.
///     - Loop model property's previous siblings.
///     - For each model property's previous sibling, get the corresponding DSL property from Model XRef.
///     - If the DSL property is not null, return immediately.
///     - If the DSL property is null, check its previous sibling.
/// </summary>
/// <param name="property"></param>
/// <returns></returns>
Given a DSL Property return the previous sibling.
The method will do the following:
Given the DSL Property get its model property from Model XRef.
Loop model property's previous siblings.
For each model property's previous sibling, get the corresponding DSL property from Model XRef.
If the DSL property is not null, return immediately.
If the DSL property is null, check its previous sibling.
Given a DSL Property return the previous sibling . The method will do the following : Given the DSL Property get its model property from Model XRef . Loop model property ' s previous siblings . For each model property ' s previous sibling get the corresponding DSL property from Model XRef . If the DSL property is not null return immediately . If the DSL property is null check its previous sibling .
private PropertyBase FindPreviousProperty(PropertyBase property)
        {
            var modelProperty = ModelXRef.GetExisting(property) as Model.Entity.PropertyBase;
            Debug.Assert(modelProperty != null, "Unable to get Entity Designer Model for :" + property.Name + " from model xref.");
            if (modelProperty != null)
            {
                var previousModelProperty = modelProperty.PreviousSiblingInPropertyXElementOrder;
                while (previousModelProperty != null)
                {
                    var previousProperty = ModelXRef.GetExisting(previousModelProperty) as PropertyBase;
                    if (previousProperty != null)
                    {
                        return previousProperty;
                    }
                    previousModelProperty = previousModelProperty.PreviousSiblingInPropertyXElementOrder;
                }
            }
            return null;
        }
private PropertyBase FindPreviousProperty ( PropertyBase property ) { var modelProperty = ModelXRef . GetExisting ( property ) as Model . Entity . PropertyBase ; Debug . Assert ( modelProperty != null , " " + property . Name + " " ) ; if ( modelProperty != null ) { var previousModelProperty = modelProperty . PreviousSiblingInPropertyXElementOrder ; while ( previousModelProperty != null ) { var previousProperty = ModelXRef . GetExisting ( previousModelProperty ) as PropertyBase ; if ( previousProperty != null ) { return previousProperty ; } previousModelProperty = previousModelProperty . PreviousSiblingInPropertyXElementOrder ; } } return null ; }
Given a DSL Property return the previous sibling.
Given a DSL Property return the previous sibling .
None
property
PropertyBase
None