Beispiel #1
0
 public DynamicProperty(IDeclarationSource source, string cSharpName, DynamicOperationResults result, IDynamicOperation rootOperation)
 {
     Source        = source;
     CSharpName    = cSharpName;
     Result        = result;
     RootOperation = rootOperation;
 }
Beispiel #2
0
        private IComponentPasswordEdit ParseComponentPasswordEdit(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty TextProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "text" && TextProperty == null)
                {
                    TextProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "text")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (TextProperty == null)
            {
                throw new ParsingException(50, sourceStream, "Text not specified.");
            }
            if (TextProperty.FixedValueSource != null || TextProperty.ObjectPropertyKey != null)
            {
                throw new ParsingException(51, sourceStream, "Text must be a string property.");
            }

            return(new ComponentPasswordEdit(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "PasswordEdit"), TextProperty));
        }
Beispiel #3
0
        public override bool Connect(IDomain domain, IArea rootArea, IArea currentArea, IObject currentObject)
        {
            IResource          Resource          = TextResource;
            IObject            Object            = TextObject;
            IObjectProperty    ObjectProperty    = TextObjectProperty;
            IDeclarationSource ObjectPropertyKey = TextKey;
            bool IsConnected = TextProperty.ConnectToResourceOrObject(domain, currentArea, currentObject, ref Resource, ref Object, ref ObjectProperty, ref ObjectPropertyKey);

            if (!(ObjectProperty is IObjectPropertyInteger) &&
                !(ObjectProperty is IObjectPropertyString) &&
                !(ObjectProperty is IObjectPropertyReadonlyString) &&
                !(ObjectProperty is IObjectPropertyEnum) &&
                !(ObjectProperty is IObjectPropertyStringDictionary))
            {
                throw new ParsingException(133, Source.Source, $"Invalid type for property '{Source.Name}'.");
            }

            TextResource       = Resource;
            TextObject         = Object;
            TextObjectProperty = ObjectProperty;
            TextKey            = ObjectPropertyKey;

            TextObjectProperty?.SetIsRead();

            return(IsConnected);
        }
Beispiel #4
0
        private IComponentIndex ParseComponentIndex(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty IndexProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "index" && IndexProperty == null)
                {
                    IndexProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "index")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (IndexProperty == null)
            {
                throw new ParsingException(64, sourceStream, "Index not specified.");
            }
            if (IndexProperty.FixedValueSource != null || IndexProperty.ObjectPropertyKey != null)
            {
                throw new ParsingException(65, sourceStream, "Index must be an integer, state or boolean property.");
            }

            return(new ComponentIndex(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "Index"), IndexProperty));
        }
Beispiel #5
0
        private IComponentArea ParseComponentArea(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty AreaProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "name" && AreaProperty == null)
                {
                    AreaProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "name")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (AreaProperty == null)
            {
                throw new ParsingException(29, sourceStream, "Area name not specified.");
            }
            if (AreaProperty.FixedValueSource == null)
            {
                throw new ParsingException(30, sourceStream, "Area can only be a static name.");
            }

            return(new ComponentArea(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "Area"), AreaProperty.FixedValueSource));
        }
Beispiel #6
0
        private void ListAreas(IArea rootArea, IDeclarationSource declaration, IFormCollection <IArea> usedAreas, Dictionary <IArea, IDeclarationSource> specifiedAreas)
        {
            if (usedAreas.Contains(rootArea))
            {
                usedAreas.Remove(rootArea);
            }

            if (rootArea != Area.EmptyArea)
            {
                if (!specifiedAreas.ContainsKey(rootArea))
                {
                    specifiedAreas.Add(rootArea, declaration);
                }

                foreach (IComponent Component in rootArea.Components)
                {
                    if (Component is IComponentArea AsComponentArea)
                    {
                        ListAreas(AsComponentArea.Area, AsComponentArea.AreaSource, usedAreas, specifiedAreas);
                    }
                    else if (Component is IComponentPopup AsComponentPopup)
                    {
                        ListAreas(AsComponentPopup.Area, AsComponentPopup.AreaSource, usedAreas, specifiedAreas);
                    }
                    else if (Component is IComponentContainer AsComponentContainer)
                    {
                        ListAreas(AsComponentContainer.ItemNestedArea, AsComponentContainer.AreaSource, usedAreas, specifiedAreas);
                    }
                    else if (Component is IComponentContainerList AsComponentContainerList)
                    {
                        ListAreas(AsComponentContainerList.ItemNestedArea, AsComponentContainerList.AreaSource, usedAreas, specifiedAreas);
                    }
                }
            }
        }
Beispiel #7
0
 public ObjectProperty(IDeclarationSource nameSource, string cSharpName, bool isRead, bool isWrite)
 {
     NameSource = nameSource;
     CSharpName = cSharpName;
     IsRead     = isRead;
     IsWrite    = isWrite;
 }
Beispiel #8
0
        private IComponentHtml ParseComponentHtml(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty HtmlProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "html" && HtmlProperty == null)
                {
                    HtmlProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "html")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (HtmlProperty == null)
            {
                throw new ParsingException(0, sourceStream, "Html not specified.");
            }

            return(new ComponentHtml(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "Html"), HtmlProperty));
        }
 public ComponentRadioButton(IDeclarationSource source, string xamlName, IComponentProperty contentProperty, IComponentProperty indexProperty, string groupName, int groupIndex)
     : base(source, xamlName)
 {
     ContentProperty = contentProperty;
     IndexProperty   = indexProperty;
     GroupName       = groupName;
     GroupIndex      = groupIndex;
 }
Beispiel #10
0
 public PageNavigation(IDeclarationSource navigationSource, IDomain domain, IComponentEvent beforeEvent, string goToPageName, bool isExternal, IComponentEvent afterEvent)
 {
     NavigationSource = navigationSource;
     IsExternal       = isExternal;
     ConnectBefore(domain, beforeEvent);
     ConnectPage(domain, goToPageName);
     ConnectAfter(domain, afterEvent);
 }
Beispiel #11
0
 public PageNavigation(IDeclarationSource navigationSource, IDomain domain, IArea currentArea, IObject currentObject, IComponentEvent beforeEvent, IComponentProperty navigateProperty, IComponentEvent afterEvent)
 {
     NavigationSource = navigationSource;
     IsExternal       = true;
     ConnectBefore(domain, beforeEvent);
     ConnectPage(domain, currentArea, currentObject, navigateProperty);
     ConnectAfter(domain, afterEvent);
 }
Beispiel #12
0
 public TestingOperation(IDeclarationSource pageName, IDeclarationSource areaName, IDeclarationSource componentName)
 {
     PageName        = pageName;
     AreaName        = areaName;
     ComponentName   = componentName;
     TestingFileName = pageName.Source.FileName;
     LineIndex       = pageName.Source.LineIndex;
 }
Beispiel #13
0
 public ComponentImage(IDeclarationSource source, string xamlName, IComponentProperty sourceProperty, bool isResourceWidth, double width, bool isResourceHeight, double height)
     : base(source, xamlName)
 {
     SourceProperty   = sourceProperty;
     Width            = width;
     IsResourceWidth  = isResourceWidth;
     Height           = height;
     IsResourceHeight = isResourceHeight;
 }
Beispiel #14
0
 public ComponentEdit(IDeclarationSource source, string xamlName, IComponentProperty textProperty, bool acceptsReturn, string textDecoration, string horizontalScrollBarVisibility, string verticalScrollBarVisibility)
     : base(source, xamlName)
 {
     TextProperty   = textProperty;
     AcceptsReturn  = acceptsReturn;
     TextDecoration = textDecoration;
     HorizontalScrollBarVisibility = horizontalScrollBarVisibility;
     VerticalScrollBarVisibility   = verticalScrollBarVisibility;
 }
Beispiel #15
0
 public ComponentPopup(IDeclarationSource source, string xamlName, IComponentProperty sourceProperty, IComponentProperty sourcePressedProperty, IDeclarationSource areaSource, double width, double height)
     : base(source, xamlName)
 {
     SourceProperty        = sourceProperty;
     SourcePressedProperty = sourcePressedProperty;
     AreaSource            = areaSource;
     Width  = width;
     Height = height;
 }
Beispiel #16
0
        private IPage Parse(string name, IParsingSourceStream sourceStream)
        {
            IComponentEvent    QueryEvent           = null;
            IDeclarationSource AreaSource           = null;
            IParsingSource     AllAreaLayoutsSource = null;
            Dictionary <IDeclarationSource, string> AreaLayoutsPairs = null;
            IDeclarationSource DesignSource = null;
            IDeclarationSource WidthSource  = null;
            IDeclarationSource HeightSource = null;
            bool IsScrollable = false;
            IDeclarationSource BackgroundSource      = null;
            IDeclarationSource BackgroundColorSource = null;
            string             Tag = null;

            while (!sourceStream.EndOfStream)
            {
                sourceStream.ReadLine();
                string Line = sourceStream.Line;
                if (!string.IsNullOrWhiteSpace(Line))
                {
                    ParseComponent(sourceStream, ref QueryEvent, ref AreaSource, ref AllAreaLayoutsSource, ref AreaLayoutsPairs, ref DesignSource, ref WidthSource, ref HeightSource, ref IsScrollable, ref BackgroundSource, ref BackgroundColorSource, ref Tag);
                }
            }

            if (AreaSource == null || string.IsNullOrEmpty(AreaSource.Name))
            {
                throw new ParsingException(109, sourceStream, "Missing area name.");
            }

            if (AreaLayoutsPairs == null)
            {
                throw new ParsingException(110, sourceStream, "Missing default area layout.");
            }

            if (DesignSource == null || string.IsNullOrEmpty(DesignSource.Name))
            {
                throw new ParsingException(111, sourceStream, "Missing design name.");
            }

            if (WidthSource == null || string.IsNullOrEmpty(WidthSource.Name))
            {
                throw new ParsingException(112, sourceStream, "Missing width.");
            }

            if (HeightSource == null || string.IsNullOrEmpty(HeightSource.Name))
            {
                throw new ParsingException(113, sourceStream, "Missing height.");
            }

            if (BackgroundColorSource == null || string.IsNullOrEmpty(BackgroundColorSource.Name))
            {
                throw new ParsingException(114, sourceStream, "Missing background color.");
            }

            return(new Page(name, ParserDomain.ToCSharpName(sourceStream, name + "Page"), ParserDomain.ToXamlName(sourceStream, name, "Page"), QueryEvent, AreaSource, AllAreaLayoutsSource, AreaLayoutsPairs, DesignSource, WidthSource, HeightSource, IsScrollable, BackgroundSource, BackgroundColorSource, Tag));
        }
Beispiel #17
0
 public ComponentButton(IDeclarationSource source, string xamlName, IComponentProperty contentProperty, IComponentEvent beforeEvent, IComponentProperty navigateProperty, bool isExternal, IComponentEvent afterEvent, IComponentProperty closePopupProperty)
     : base(source, xamlName)
 {
     ContentProperty    = contentProperty;
     BeforeEvent        = beforeEvent;
     NavigateProperty   = navigateProperty;
     IsExternal         = isExternal;
     AfterEvent         = afterEvent;
     ClosePopupProperty = closePopupProperty;
 }
Beispiel #18
0
 public void SetIsProvidingCustomPageName(IDeclarationSource componentSource, bool isSet)
 {
     if (!IsProvidingCustomPageName.HasValue)
     {
         IsProvidingCustomPageName = isSet;
     }
     else if (IsProvidingCustomPageName.Value != isSet)
     {
         throw new ParsingException(173, componentSource.Source, "Incompatible use of event.");
     }
 }
Beispiel #19
0
        public bool Connect(IDomain domain, IDynamic currentDynamic, IObject currentObject)
        {
            IObject            Object            = ValueObject;
            IObjectProperty    ObjectProperty    = ValueObjectProperty;
            IDeclarationSource ObjectPropertyKey = ValueKey;
            bool IsConnected = ValueProperty.ConnectToObjectOnly(domain, null, currentObject, ref Object, ref ObjectProperty, ref ObjectPropertyKey);

            ValueObject         = Object;
            ValueObjectProperty = ObjectProperty;
            ValueKey            = ObjectPropertyKey;

            ValueObjectProperty?.SetIsRead();

            return(IsConnected);
        }
Beispiel #20
0
        private void ConnectContent(IDomain domain, IArea currentArea, IObject currentObject, ref bool IsConnected)
        {
            IResource          Resource          = ContentResource;
            IObject            Object            = ContentObject;
            IObjectProperty    ObjectProperty    = ContentObjectProperty;
            IDeclarationSource ObjectPropertyKey = ContentKey;

            IsConnected          |= ContentProperty.ConnectToResourceOrObject(domain, currentArea, currentObject, ref Resource, ref Object, ref ObjectProperty, ref ObjectPropertyKey);
            ContentResource       = Resource;
            ContentObject         = Object;
            ContentObjectProperty = ObjectProperty;
            ContentKey            = ObjectPropertyKey;

            ContentObjectProperty?.SetIsRead();
        }
Beispiel #21
0
 public void SetCurrentObject(IDeclarationSource componentSource, IObject currentObject)
 {
     if (CurrentObject == null && currentObject != null)
     {
         CurrentObject = currentObject;
     }
     else if (CurrentObject != null && currentObject == null)
     {
         throw new ParsingException(154, componentSource.Source, $"Area '{Name}' used in two different contexts.");
     }
     else if (CurrentObject != null && currentObject != null && CurrentObject != currentObject)
     {
         throw new ParsingException(155, componentSource.Source, $"Area '{Name}' used for more than one object.");
     }
 }
Beispiel #22
0
        private IComponentText ParseComponentText(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty TextProperty           = null;
            IComponentProperty TextDecorationProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "text" && TextProperty == null)
                {
                    TextProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name == "decoration" && TextDecorationProperty == null)
                {
                    TextDecorationProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "text" && Info.NameSource.Name != "decoration")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (TextProperty == null)
            {
                throw new ParsingException(38, sourceStream, "Text not specified.");
            }
            if (TextDecorationProperty != null && TextDecorationProperty.FixedValueSource == null)
            {
                throw new ParsingException(39, sourceStream, "Decoration can only be a constant.");
            }

            string TextDecoration = TextDecorationProperty != null ? TextDecorationProperty.FixedValueSource.Name : null;

            if (TextDecoration != null &&
                TextDecoration != Windows.UI.Text.TextDecorations.OverLine.ToString() &&
                TextDecoration != Windows.UI.Text.TextDecorations.Strikethrough.ToString() &&
                TextDecoration != Windows.UI.Text.TextDecorations.Underline.ToString())
            {
                throw new ParsingException(40, sourceStream, $"Invalid decoration for '{nameSource.Name}'.");
            }

            return(new ComponentText(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "Text"), TextProperty, TextDecoration));
        }
Beispiel #23
0
 public Page(string name, string fileName, string xamlName, IComponentEvent queryEvent, IDeclarationSource areaSource, IParsingSource allAreaLayoutsSource, Dictionary <IDeclarationSource, string> areaLayoutPairs, IDeclarationSource designSource, IDeclarationSource widthSource, IDeclarationSource heightSource, bool isScrollable, IDeclarationSource backgroundSource, IDeclarationSource backgroundColorSource, string tag)
 {
     Name                  = name;
     FileName              = fileName;
     XamlName              = xamlName;
     QueryEvent            = queryEvent;
     AreaSource            = areaSource;
     AllAreaLayoutsSource  = allAreaLayoutsSource;
     AreaLayoutPairs       = areaLayoutPairs;
     DesignSource          = designSource;
     WidthSource           = widthSource;
     HeightSource          = heightSource;
     IsScrollable          = isScrollable;
     BackgroundSource      = backgroundSource;
     BackgroundColorSource = backgroundColorSource;
     Tag = tag;
 }
Beispiel #24
0
        private IComponentCheckBox ParseComponentCheckBox(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty ContentProperty = null;
            IComponentProperty CheckedProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "content" && ContentProperty == null)
                {
                    ContentProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name == "checked" && CheckedProperty == null)
                {
                    CheckedProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "content" && Info.NameSource.Name != "checked")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (ContentProperty == null)
            {
                throw new ParsingException(34, sourceStream, "CheckBox content not specified.");
            }
            if (CheckedProperty == null)
            {
                throw new ParsingException(35, sourceStream, "CheckBox checked property not specified.");
            }

            if (CheckedProperty.FixedValueSource != null)
            {
                throw new ParsingException(36, sourceStream, "Checked property cannot be a static name.");
            }
            if (CheckedProperty.ObjectPropertyKey != null)
            {
                throw new ParsingException(37, sourceStream, "Checked property cannot use a key.");
            }

            return(new ComponentCheckBox(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "CheckBox"), ContentProperty, CheckedProperty));
        }
Beispiel #25
0
        private IComponentSelector ParseComponentSelector(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty IndexProperty = null;
            IComponentProperty ItemsProperty = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "index" && IndexProperty == null)
                {
                    IndexProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name == "items" && ItemsProperty == null)
                {
                    ItemsProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "index" && Info.NameSource.Name != "items")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (IndexProperty == null)
            {
                throw new ParsingException(60, sourceStream, "Index not specified.");
            }
            if (IndexProperty.FixedValueSource != null || IndexProperty.ObjectPropertyKey != null)
            {
                throw new ParsingException(61, sourceStream, "Index must be an integer property.");
            }

            if (ItemsProperty == null)
            {
                throw new ParsingException(62, sourceStream, "Items not specified.");
            }
            if (ItemsProperty.FixedValueSource != null || ItemsProperty.ObjectPropertyKey != null)
            {
                throw new ParsingException(63, sourceStream, "Items must be a list property.");
            }

            return(new ComponentSelector(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "Selector"), IndexProperty, ItemsProperty));
        }
Beispiel #26
0
        public static ComponentInfo Parse(IParsingSourceStream sourceStream, string infoText)
        {
            IDeclarationSource NameSource;
            string             MemberValue;

            ParserDomain.ParseStringPair(sourceStream, infoText, '=', out NameSource, out MemberValue);

            if (!MemberValue.Contains("."))
            {
                return new ComponentInfo()
                       {
                           NameSource = NameSource, FixedValueSource = new DeclarationSource(MemberValue, sourceStream), ObjectSource = null, MemberSource = null, KeySource = null
                       }
            }
            ;

            else
            {
                IDeclarationSource ObjectSource;

                string MemberName;
                ParserDomain.ParseStringPair(sourceStream, MemberValue, '.', out ObjectSource, out MemberName);

                string             Key;
                int                StartIndex = MemberName.IndexOf("[");
                int                EndIndex   = MemberName.IndexOf("]");
                IDeclarationSource KeySource;
                if (StartIndex > 0 && EndIndex > StartIndex)
                {
                    Key        = MemberName.Substring(StartIndex + 1, EndIndex - StartIndex - 1);
                    MemberName = MemberName.Substring(0, StartIndex);
                    KeySource  = new DeclarationSource(Key, sourceStream);
                }
                else
                {
                    KeySource = null;
                }

                return(new ComponentInfo()
                {
                    NameSource = NameSource, FixedValueSource = null, ObjectSource = ObjectSource, MemberSource = new DeclarationSource(MemberName, sourceStream), KeySource = KeySource
                });
            }
        }
Beispiel #27
0
        private IComponentContainerList ParseComponentContainerList(IDeclarationSource nameSource, IParsingSourceStream sourceStream, List <ComponentInfo> infoList)
        {
            IComponentProperty ItemListProperty = null;
            IComponentProperty AreaProperty     = null;

            foreach (ComponentInfo Info in infoList)
            {
                if (Info.NameSource.Name == "items" && ItemListProperty == null)
                {
                    ItemListProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name == "area" && AreaProperty == null)
                {
                    AreaProperty = new ComponentProperty(Info);
                }
                else if (Info.NameSource.Name != "items" && Info.NameSource.Name != "area")
                {
                    throw new ParsingException(27, sourceStream, $"Unknown token '{Info.NameSource.Name}'.");
                }
                else
                {
                    throw new ParsingException(28, sourceStream, $"'{Info.NameSource.Name}' is repeated.");
                }
            }

            if (ItemListProperty == null)
            {
                throw new ParsingException(69, sourceStream, "Items not specified.");
            }

            if (AreaProperty == null)
            {
                throw new ParsingException(70, sourceStream, "Area not specified.");
            }
            if (AreaProperty.FixedValueSource == null)
            {
                throw new ParsingException(71, sourceStream, "Area name can only be a static name.");
            }

            return(new ComponentContainerList(nameSource, ParserDomain.ToXamlName(nameSource.Source, nameSource.Name, "ContainerList"), ItemListProperty, AreaProperty.FixedValueSource));
        }
 public ObjectPropertyReadonlyString(IDeclarationSource nameSource, string cSharpName)
     : base(nameSource, cSharpName, false, false)
 {
 }
Beispiel #29
0
        public string GetComponentValue(IGeneratorPage currentPage, IGeneratorObject currentObject, IGeneratorResource resourceValue, IGeneratorObject objectValue, IGeneratorObjectProperty objectPropertyValue, IDeclarationSource key, bool isTwoWays)
        {
            if (resourceValue != null)
            {
                return($"{{StaticResource {resourceValue.XamlName}}}");
            }

            else if (objectValue != null && objectPropertyValue != null)
            {
                string Mode          = isTwoWays ? ", Mode=TwoWay" : "";
                string ObjectBinding = GetObjectBinding(currentObject, objectValue, objectPropertyValue);

                if (key == null)
                {
                    return($"{{Binding {ObjectBinding}{Mode}}}");
                }
                else if (key.Name == GeneratorPage.CurrentPage.Name)
                {
                    return($"{{Binding {ObjectBinding}{Mode}, Converter={{StaticResource convKeyToValue}}, ConverterParameter=page-{ParserDomain.ToKeyName(currentPage.Name)}}}");
                }
                else
                {
                    return($"{{Binding {ObjectBinding}{Mode}, Converter={{StaticResource convKeyToValue}}, ConverterParameter={key.Name}}}");
                }
            }

            else
            {
                throw new InvalidOperationException();
            }
        }
Beispiel #30
0
 public SelectOperation(IDeclarationSource pageName, IDeclarationSource areaName, IDeclarationSource componentName, int index)
     : base(pageName, areaName, componentName)
 {
     Index = index;
 }