internal MetadataClass(ApplicationMetadata metadata, string name, int index)
        {
            this.Metadata = metadata;
            this.Name     = name;
            this.Index    = index;
            string str = name.Replace('/', '.');

            this.QTypeName = "InMeta." + str;
            this.IdentName = name.Replace('/', '_');
            int length = str.LastIndexOf(".");

            if (length >= 0)
            {
                this.TypeNamespace = str.Substring(0, length);
                this.TypeName      = str.Substring(length + 1, str.Length - length - 1);
            }
            else
            {
                this.TypeNamespace = string.Empty;
                this.TypeName      = str;
            }
            this.Properties    = new MetadataPropertyList();
            this.AllProperties = new MetadataPropertyList();
            this.Associations  = new MetadataAssociationList();
            this.Owners        = new MetadataAssociationList();
            this.Childs        = new MetadataChildRefList(this);
            this.ObjectViews   = new MetadataObjectViewList(this);
            this.ExternalRefs  = new MetadataAssociationRefList();
        }
Esempio n. 2
0
 public LoadPlan(MetadataClass cls)
 {
     this.Class  = cls;
     this.Data   = new MetadataPropertyList();
     this.Links  = new AssociationRefLoadPlanList();
     this.Childs = new ChildRefLoadPlanList();
     this.Views  = new MetadataObjectViewList(cls);
 }
        internal void LoadNotAssignedProperties()
        {
            this.CheckNotUntypedNull();
            LoadPlan             plan       = new LoadPlan(this.FStorage.Class);
            MetadataPropertyList properties = this.Class.Properties;

            DataProperty[] dataPropertyArray = this.FProperties ?? (this.FProperties = new DataProperty[properties.Count]);
            for (int index = 0; index < properties.Count; ++index)
            {
                MetadataProperty propertyMetadata = properties[index];
                if (!propertyMetadata.IsId)
                {
                    DataProperty dataProperty = dataPropertyArray[index];
                    if (dataProperty == null || !dataProperty.IsAssigned)
                    {
                        plan.EnsureProperty(propertyMetadata);
                    }
                }
            }
            this.Session.LoadData(plan, (DataObjectList)null, new DataId[1]
            {
                this.Id
            }, (string)null);
        }