コード例 #1
0
        public async Task CreateEnumAsync(Models.Enum @enum)
        {
            var coreProject = GetProject("Core");
            var path        = coreProject.GetPath("Metadata", "Enums");

            coreProject.VerifyPathExists("Metadata", "Enums");
            var filePath = System.IO.Path.Combine(path, @enum.Name + MetadataFileExtension);

            await WriteFileAsync(filePath, SerializeMetadata(@enum));
        }
コード例 #2
0
        public async Task UpdateEnumAsync(Models.Enum @enum)
        {
            var existingEnum = (await GetEnumsAsync()).FirstOrDefault(e => e.Id == @enum.Id);

            if (existingEnum == null)
            {
                throw new Exception($"Enum with Id = {@enum.Id} not found");
            }
            var coreProject = GetProject("Core");
            var path        = coreProject.GetPath("Metadata", "Enums");
            var filePath    = System.IO.Path.Combine(path, @enum.Name + MetadataFileExtension);

            await WriteFileAsync(filePath, SerializeMetadata(@enum));

            if (existingEnum.Name != @enum.Name)
            {
                filePath = System.IO.Path.Combine(path, existingEnum.Name + MetadataFileExtension);
                File.Delete(filePath);
            }
        }
コード例 #3
0
 public EnumViewModel(View view, Models.Enum @enum, SolutionAccessor solution)
 {
     View     = view;
     Enum     = @enum;
     Solution = solution;
 }
コード例 #4
0
 public EnumModel(Models.Enum @enum, SolutionAccessor solution)
 {
     Enum     = @enum;
     Solution = solution;
 }