Example #1
0
        private void ConnectPage(IDomain domain, IArea currentArea, IObject currentObject, IComponentProperty navigateProperty)
        {
            IObject Object = GoToObject;
            IObjectPropertyReadonlyString ObjectProperty = GoToObjectProperty;

            navigateProperty.ConnectToObjectReadonlyString(domain, currentArea, currentObject, ref Object, ref ObjectProperty);
            GoToObject         = Object;
            GoToObjectProperty = ObjectProperty;

            GoToObjectProperty.SetIsRead();
        }
Example #2
0
        public bool ConnectToObjectReadonlyString(IDomain domain, IArea currentArea, IObject currentObject, ref IObject obj, ref IObjectPropertyReadonlyString objectProperty)
        {
            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 IObjectPropertyReadonlyString AsObjectPropertyString)
                        {
                            objectProperty = AsObjectPropertyString;
                            break;
                        }
                        else
                        {
                            throw new ParsingException(0, ObjectPropertySource.Source, $"'{obj.Name}.{ObjectPropertySource.Name}' must be a readonly string property.");
                        }
                    }
                }

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

                IsConnected = true;
            }

            return(IsConnected);
        }
 public GeneratorObjectPropertyReadonlyString(IObjectPropertyReadonlyString property, IGeneratorObject obj)
     : base(property, obj)
 {
 }