예제 #1
0
 public void AcceptEntryProperties(MetaTableEntry entry)
 {
     foreach (var ep in EntityClassDefinition.Properties)
     {
         if (ep.type.HasFlag(MetaEntityClassPropertyType.value))
         {
             if (entry.HasValueFor(ep))
             {
                 SetSetter(ep.PropertyName, entry.GetOutputValue(ep));
             }
         }
     }
 }
        /// <summary>
        /// Sets the object by entry from MetaTable
        /// </summary>
        /// <param name="entry">The entry.</param>
        /// <param name="input">The input.</param>
        /// <param name="existing">The existing.</param>
        /// <param name="OverwriteExisting">if set to <c>true</c> [overwrite existing].</param>
        /// <returns></returns>
        public Object SetObjectByMetaEntry(MetaTableEntry entry, MetaTable input, Object existing = null, Boolean OverwriteExisting = true)
        {
            if (existing == null)
            {
                existing = type.getInstance(null);
            }

            object[] o = new object[] { };

            foreach (KeyValuePair <MetaTableProperty, PropertyInfo> pair in propertyLinkABs)
            {
                MetaTableProperty metaProperty = input.properties.Get(pair.Key.PropertyName);

                if (metaProperty != null)
                {
                    Object v = entry.GetOutputValue(metaProperty);

                    SetPropertyValue(metaProperty, pair.Value, v, existing, OverwriteExisting);
                }
            }

            return(existing);
        }