Example #1
0
        public bool IsReferencedBy(IGeneratorArea other)
        {
            if (other == this)
            {
                return(true);
            }

            else if (other == EmptyArea)
            {
                return(false);
            }

            else
            {
                foreach (IGeneratorComponent component in other.Components)
                {
                    if (component.IsReferencing(this))
                    {
                        return(true);
                    }
                }

                return(false);
            }
        }
Example #2
0
        public static void Generate(IGeneratorArea area, string attachedProperties, string elementProperties, int indentation, IGeneratorColorTheme colorTheme, StreamWriter xamlWriter, string visibilityBinding, double width)
        {
            string s             = GeneratorLayout.IndentationString(indentation);
            string Properties    = $" Template=\"{{StaticResource {area.XamlName}}}\"";
            string WidthProperty = double.IsNaN(width) ? "" : $" HorizontalAlignment=\"Center\" Width=\"{width}\"";

            colorTheme.WriteXamlLine(xamlWriter, $"{s}<ContentControl{attachedProperties}{visibilityBinding}{Properties}{elementProperties}{WidthProperty}/>");
        }
Example #3
0
        public override bool Connect(IGeneratorDomain domain)
        {
            bool IsConnected = false;

            if (Area == null)
            {
                IsConnected = true;
                Area        = GeneratorArea.GeneratorAreaMap[BaseArea];
            }

            return(IsConnected);
        }
Example #4
0
        public bool Connect(IGeneratorDomain domain, IGeneratorArea area)
        {
            bool IsConnected = false;

            if (Content == null)
            {
                IsConnected = true;
                Content     = GeneratorPanel.Convert(LayoutBase.Content);
            }

            IsConnected |= Content.Connect(domain, area.Components);

            return(IsConnected);
        }
Example #5
0
        public override bool Connect(IGeneratorDomain domain)
        {
            bool IsConnected = false;

            if (ItemObject == null || ItemObjectProperty == null)
            {
                IsConnected        = true;
                ItemObject         = GeneratorObject.GeneratorObjectMap[BaseContainer.ItemObject];
                ItemObjectProperty = (IGeneratorObjectPropertyItemList)GeneratorObjectProperty.GeneratorObjectPropertyMap[BaseContainer.ItemObjectProperty];
                ItemNestedObject   = GeneratorObject.GeneratorObjectMap[BaseContainer.ItemNestedObject];
                ItemNestedArea     = GeneratorArea.GeneratorAreaMap[BaseContainer.ItemNestedArea];
            }

            return(IsConnected);
        }
Example #6
0
        public override bool IsReferencing(IGeneratorArea other)
        {
            if (Area == other)
            {
                return(true);
            }

            else if (Area == GeneratorArea.EmptyArea)
            {
                return(false);
            }

            else if (other.IsReferencedBy(Area))
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
Example #7
0
        private static void BubbleSort(List <IGeneratorArea> Areas)
        {
            bool IsSorted;

            do
            {
                IsSorted = false;

                for (int i = 0; i < Areas.Count; i++)
                {
                    for (int j = i + 1; j < Areas.Count; j++)
                    {
                        if (Areas[j].IsReferencedBy(Areas[i]))
                        {
                            IGeneratorArea Temp = Areas[i];
                            Areas[i] = Areas[j];
                            Areas[j] = Temp;
                            IsSorted = true;
                        }
                    }
                }
            }while (IsSorted);
        }
Example #8
0
 public virtual bool IsReferencing(IGeneratorArea other)
 {
     return(false);
 }
Example #9
0
 public void Generate(IGeneratorArea area, Dictionary <IGeneratorArea, IGeneratorLayout> areaLayouts, IList <IGeneratorPage> pageList, IGeneratorDesign design, int indentation, IGeneratorPage currentPage, IGeneratorObject currentObject, IGeneratorColorTheme colorTheme, StreamWriter xamlWriter)
 {
     Content.Generate(areaLayouts, pageList, design, indentation, currentPage, currentObject, colorTheme, xamlWriter, "");
 }