Exemplo n.º 1
0
 internal TemplateNode(FileSourceInfo source, string name, string caseMatch, bool isDefaultCase, IDataType producedType, IDataType reflectedType, TypeNameHelper generatedClassName, Vector <float> clearColor, InstanceType instanceType, IEnumerable <RawProperty> rawProperties = null)
     : base(source, name, generatedClassName, reflectedType, clearColor, instanceType, rawProperties)
 {
     Case          = caseMatch;
     IsDefaultCase = isDefaultCase;
     ProducedType  = producedType;
 }
Exemplo n.º 2
0
        void BindReference(FileSourceInfo src, Node owner, BindableProperty p, Property contextProperty, string value)
        {
            if (p.Facet.ListItemType.FullName.StartsWith("Uno.UX.Property"))
            {
                ParsePropertyReference(src, owner, p, value);
                return;
            }

            if (p.Facet.ListItemType.FullName == "Uno.UX.FileSource")
            {
                ParseBundleFileProperty(src, owner, p, value.Trim('\''));
                return;
            }

            // Prioritize enum literals if the context property is of matching enum type
            if (TryParseEnum(src, owner, p, contextProperty, value))
            {
                return;
            }

            var n = ResolveNode(src, owner, value, p.Facet.ListItemType, x => x.Implements(p.Facet.ListItemType),
                                "The type must be compatible with '" + p.Facet.ListItemType.FullName + "'", x => x.Implements(contextProperty.Facet.ListItemType));

            if (n != null)
            {
                p.Bind(n);
            }
        }
Exemplo n.º 3
0
        public void XmlFileRepository_WriteEmptyFile_ResultFileMatchesReferenceFile()
        {
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Write02\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.WriteEmptyFile(sourceInfo, @"XmlFileRepositoryTest\Write02\ReposTest_EmptyInputFile.xml");
        }
Exemplo n.º 4
0
        public NameTableNode(FileSourceInfo source, HashSet <UXPropertyClass> propClasses, ClassNode self, NameTableNode parentTable, IDataType nameTableType, DocumentScope scope, IEnumerable <RawProperty> rawProperties)
            : base(source, "__g_nametable", nameTableType, InstanceType.Local, rawProperties)
        {
            ParentTable    = parentTable;
            _scope         = scope;
            _nameTableType = nameTableType;
            Entries        = _scope.NodesIncludingRoot.Where(x => x.Scope == scope && x.Name != null && x.InstanceType == InstanceType.Local).Select(x => new NameTableEntry(x.Name, x)).ToArray();

            if (self != null)
            {
                var selfProp = TryFindBindableProperty(self, "This");
                selfProp.Bind(self);

                var propsProp = TryFindBindableProperty(self, "Properties");
                foreach (var p in self.DeclaredUXProperties)
                {
                    var pr = self.Properties.First(x => x.Facet.Name == p.Name);
                    propsProp.Bind(self, pr);
                    propClasses.Add(new UXPropertyClass(pr, self));
                }
            }

            var objs = TryFindBindableProperty(scope.ContainingClass, "Objects");

            BindEntries(objs);
        }
Exemplo n.º 5
0
        public void XmlFileRepository_UpdateWithoutCloning_NoCopyIsCreated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage22\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, false);

            this.UpdateWithoutCloning(sourceInfo);
        }
Exemplo n.º 6
0
        public void XmlFileRepository_FindAll_WithExpressionEmptySource_NoRecordsAreReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindAll05\ReposTest_EmptyInputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindAllWithSpecification_EmptySource(sourceInfo);
        }
Exemplo n.º 7
0
        public void XmlFileRepository_AddDeletedItemWithCloning_CopyIsCreated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage19\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.AddDeletedItemWithCloning(sourceInfo);
        }
Exemplo n.º 8
0
        public void XmlFileRepository_FindFirstWithCloning_CopiesAreCreated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindFirst06\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, true);

            this.FindFirstWithCloning(sourceInfo);
        }
Exemplo n.º 9
0
        public void XmlFileRepository_FindSingleWithoutCloning_NoCopiesAreCreated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindSingle08\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindSingleWithoutCloning(sourceInfo);
        }
Exemplo n.º 10
0
        public void XmlFileRepository_ExecuteWithDefaultSpecification_NullIsReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"CsvFileRepositoryTest\Execute01\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, false);

            this.ExecuteDefaultSpecification(sourceInfo);
        }
Exemplo n.º 11
0
        public void XmlFileRepository_ReadEmptyFile_NoItemsAreRetrieved()
        {
            /* Create the repositiry */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Read02\ReposTest_EmptyInputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.ReadEmptyFile(sourceInfo);
        }
Exemplo n.º 12
0
        public void XmlFileRepository_FindAll_WithNotMatchingSpecification_NoRecordsAreReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindAll04\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindAllWithSpecification_WithoutResults(sourceInfo);
        }
Exemplo n.º 13
0
        public void XmlFileRepository_DeleteMultiple_ItemsAreDeleted()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage08\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.DeleteMultiple_NormalUse(sourceInfo);
        }
Exemplo n.º 14
0
        public void XmlFileRepository_Add_ItemIsStored()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage01\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.Add(sourceInfo);
        }
Exemplo n.º 15
0
        public void XmlFileRepository_UpdateCustomMappedType_ItemIsUpdated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage04\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.UpdateCustomMappedType(sourceInfo);
        }
Exemplo n.º 16
0
        public void XmlFileRepository_SpecificationWithOrderByEmptySource_NoRecordsAreReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Sorting02\ReposTest_EmptyInputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.OrderBy_EmptySource(sourceInfo);
        }
Exemplo n.º 17
0
        public void XmlFileRepository_SpecificationWithOrderBy_ItemsAreCorrectlyOrdered()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Sorting01\ReposTest_SortingFile.xml"), true, 3000, Encoding.UTF8, false);

            this.OrderBy(sourceInfo);
        }
Exemplo n.º 18
0
        public void XmlFileRepository_FindFirst_WithNotMatchingExpressionAndDefault_DefaultIsReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindFirst09\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindFirstWithNotMatchingExpressionAndDefault_DefaultIsReturned(sourceInfo);
        }
Exemplo n.º 19
0
        public void XmlFileRepository_UpdateMultipleWithCloning_CopiesAreCreated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage25\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.UpdateMultipleWithCloning(sourceInfo);
        }
Exemplo n.º 20
0
        public void XmlFileRepository_DeleteMultipleDeleteEntityTwice_OperationIsRolledBack()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage09\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.DeleteMultiple_Exceptions(sourceInfo);
        }
Exemplo n.º 21
0
        public void XmlFileRepository_DeleteAndAdd_ItemsAreStored()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\CombinedStorage04\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.DeleteAdd(sourceInfo);
        }
Exemplo n.º 22
0
        public void XmlFileRepository_FindAll_SpecificationWithMaxResultsExactlyAvailable_AvailableRecordsAreReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindAll07\ReposTest_SortingFile.xml"), true, 3000, Encoding.UTF8, false);

            this.RetrieveExactlyAvailable(sourceInfo);
        }
Exemplo n.º 23
0
        public void XmlFileRepository_ExecuteWithBusinessRule_ExceptionIsThrown()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"CsvFileRepositoryTest\Execute02\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, false);

            this.ExecuteBusinessRule(sourceInfo);
        }
Exemplo n.º 24
0
        internal RawProperty(AST.Property astProp)
        {
            Name      = astProp.Name;
            Value     = astProp.Value;
            Namespace = astProp.Namespace;

            Source = astProp.Source;
        }
Exemplo n.º 25
0
        public void XmlFileRepository_UpdateMultipleCustomMappedTypes_ItemsAreUpdated()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage11\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.UpdateMultipleCustomMappedTypes_NormalUse(sourceInfo);
        }
Exemplo n.º 26
0
        public void XmlFileRepository_FindFirst_WithNotMatchingSpecification_NoRecordIsReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindFirst02\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindFirstWithNotMatchingSpecification_NoRecordIsReturned(sourceInfo);
        }
Exemplo n.º 27
0
        public RawProperty(string name, string value, FileSourceInfo source, string ns = null)
        {
            Name      = name;
            Value     = value;
            Namespace = ns;

            Source = source;
        }
Exemplo n.º 28
0
        public void XmlFileRepository_DeleteAndReset_DeletionIsUndone()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage15\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.Delete_Reset(sourceInfo);
        }
Exemplo n.º 29
0
        public void XmlFileRepository_UpdateMultipleUpdateUnaddedEntity_OperationIsRolledBack()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\Storage12\ReposTest_DataSourceFile.xml"), true, 3000, Encoding.UTF8, true);

            this.UpdateMultiple_Exceptions(sourceInfo);
        }
Exemplo n.º 30
0
        public void XmlFileRepository_FindSingle_WithNotMatchingExpression_NoRecordIsReturned()
        {
            /* Create the repository */
            DataSourceInfo sourceInfo =
                new FileSourceInfo(new FileInfo(@"XmlFileRepositoryTest\FindSingle06\ReposTest_InputFile.xml"), true, 3000, Encoding.UTF8, false);

            this.FindSingleWithNotMatchingExpression_NoRecordIsReturned(sourceInfo);
        }