public void OnSelectedForeignKeyChanged()
 {
     if (SelectedForeignKey == null)
     {
         EntityNonScalarPropertiesIndex = -1;
         return;
     }
     if (EntityNonScalarProperties != null)
     {
         int oldVal = EntityNonScalarPropertiesIndex;
         EntityNonScalarPropertiesIndex = EntityNonScalarProperties.IndexOf(SelectedForeignKey.NavigationName);
         if ((EntityNonScalarPropertiesIndex == oldVal) && (EntityNonScalarPropertiesIndex > -1))
         {
             OnEntityNonScalarPropertiesIndexChanged();
         }
     }
 }
        public void CollectEntityNonScalarProperties()
        {
            EntityNonScalarProperties.Clear();
            EntityNonScalarPropertiesIndex = -1;
            if (SelectedEntity == null)
            {
                return;
            }
            if (SelectedEntity.CodeElementRef == null)
            {
                return;
            }
            List <string> properties = new List <string>();

            (SelectedEntity.CodeElementRef as CodeClass).
            CollectCodeClassAllMappedNonScalarProperties(properties);
            properties.ForEach(s => EntityNonScalarProperties.Add(s));
        }
        public void DoAnalise(string navigationName = null)
        {
            OnForeignKeyTypesIndexChanged();

            if (EntityNonScalarProperties.Count < 1)
            {
                CollectEntityNonScalarProperties();
            }
            if (EntityProperties.Count < 1)
            {
                CollectEntityScalarProperties();
            }
            if (string.IsNullOrEmpty(navigationName))
            {
                return;
            }
            if (EntityNonScalarProperties == null)
            {
                return;
            }
            if (EntityNonScalarProperties == null)
            {
                return;
            }
            int i = EntityNonScalarProperties.IndexOf(navigationName);

            if (i > -1)
            {
                int oldval = EntityNonScalarPropertiesIndex;
                EntityNonScalarPropertiesIndex = i;
                if (oldval == i)
                {
                    OnEntityNonScalarPropertiesIndexChanged();
                }
            }
        }