Esempio n. 1
0
        void repository_CodeItemCreated(ICodeRepository sender, CodeItem item)
        {
            if (!item.Name.EndsWith(".cs"))
            {
                return;
            }
            if (item.Name.EndsWith(".vogen.cs"))
            {
                return;
            }

            var valueObjects = FindValueObjects(item);

            if (valueObjects.Count == 0)
            {
                return;
            }

            valueObjects = SkipAndWarnValueObjectsWithNoFields(item, valueObjects);

            var generatedItems = CreateTopLevelCode(valueObjects);
            var dependency     = item.SourceOf(Path.GetFileNameWithoutExtension(item.Name) + ".vogen.cs");

            SaveGeneratedCodeToDependency(generatedItems, dependency);
        }
        void repository_CodeItemCreated(ICodeRepository sender, CodeItem item)
        {
            if (!item.Name.EndsWith(".cs")) return;
            if (item.Name.EndsWith(".ctorgen.cs")) return;

            var relations = FindDependencyRelations(item);
            if (relations.Count == 0) return;

            var generatedItems = CreateTopLevelCode(relations);
            var dependency = item.SourceOf(Path.GetFileNameWithoutExtension(item.Name) + ".ctorgen.cs");
            SaveGeneratedCodeToDependency(generatedItems, dependency);
        }
        void repository_CodeItemCreated(ICodeRepository sender, CodeItem item)
        {
            if (!item.Name.EndsWith(".cs")) return;
            if (item.Name.EndsWith(".vogen.cs")) return;

            var valueObjects = FindValueObjects(item);
            if (valueObjects.Count == 0) return;

            valueObjects = SkipAndWarnValueObjectsWithNoFields(item, valueObjects);

            var generatedItems = CreateTopLevelCode(valueObjects);
            var dependency = item.SourceOf(Path.GetFileNameWithoutExtension(item.Name) + ".vogen.cs");
            SaveGeneratedCodeToDependency(generatedItems, dependency);
        }
        void repository_CodeItemCreated(ICodeRepository sender, CodeItem item)
        {
            if (!item.Name.EndsWith(".cs"))
            {
                return;
            }
            if (item.Name.EndsWith(".ctorgen.cs"))
            {
                return;
            }

            var relations = FindDependencyRelations(item);

            if (relations.Count == 0)
            {
                return;
            }

            var generatedItems = CreateTopLevelCode(relations);
            var dependency     = item.SourceOf(Path.GetFileNameWithoutExtension(item.Name) + ".ctorgen.cs");

            SaveGeneratedCodeToDependency(generatedItems, dependency);
        }