Esempio n. 1
0
        private void ConnectItem(IDomain domain, IArea currentArea, IObject currentObject, ref bool IsConnected)
        {
            IObject             Object         = ItemObject;
            IObjectPropertyItem ObjectProperty = ItemObjectProperty;
            IObject             NestedObject   = ItemNestedObject;

            IsConnected        = ItemProperty.ConnectToObjectItem(domain, currentArea, currentObject, ref Object, ref ObjectProperty, ref NestedObject);
            ItemObject         = Object;
            ItemObjectProperty = ObjectProperty;
            ItemNestedObject   = NestedObject;

            ItemObjectProperty?.SetIsRead();
        }
Esempio n. 2
0
        public bool ConnectToObjectItem(IDomain domain, IArea currentArea, IObject currentObject, ref IObject obj, ref IObjectPropertyItem objectProperty, ref IObject ItemObject)
        {
            bool IsConnected = false;

            if ((ObjectSource != null || ObjectPropertySource != null) && (obj == null || objectProperty == null))
            {
                ConnectToObject(domain, currentArea, ObjectSource, ObjectPropertySource, ObjectPropertyKey, ref obj);

                foreach (IObjectProperty Property in obj.Properties)
                {
                    if (Property.NameSource.Name == ObjectPropertySource.Name)
                    {
                        if (Property is IObjectPropertyItem AsObjectPropertyItem)
                        {
                            objectProperty = AsObjectPropertyItem;
                            break;
                        }
                        else
                        {
                            throw new ParsingException(149, ObjectPropertySource.Source, $"'{obj.Name}.{ObjectPropertySource.Name}' must be an item property.");
                        }
                    }
                }

                if (objectProperty == null)
                {
                    throw new ParsingException(141, ObjectPropertySource.Source, $"Unknown property '{ObjectPropertySource.Name}' in object '{obj.Name}'.");
                }

                foreach (IObject Item in domain.Objects)
                {
                    if (Item.Name == objectProperty.ObjectSource.Name)
                    {
                        ItemObject = Item;
                        break;
                    }
                }

                if (ItemObject == null)
                {
                    throw new ParsingException(150, ObjectPropertySource.Source, $"Unknown object '{objectProperty.ObjectSource.Name}' for item '{ObjectPropertySource.Name}'.");
                }

                IsConnected = true;
            }

            return(IsConnected);
        }
Esempio n. 3
0
 public GeneratorObjectPropertyItem(IObjectPropertyItem property, IGeneratorObject obj)
     : base(property, obj)
 {
     BaseProperty = property;
 }