示例#1
0
 public MainBoard(IMainBoardSignil mainBoardSignil, IEnumerable <ICPU>?cPUs, IEnumerable <IDiskDrive>?diskDrives, IPhilote <IMainBoard>?philote)
 {
     MainBoardSignil = mainBoardSignil ?? throw new ArgumentNullException(nameof(mainBoardSignil));
     CPUs            = cPUs;
     DiskDrives      = diskDrives;
     Philote         = philote;
 }
示例#2
0
 public PartitionInfoEx(PartitionFileSystem partitionFileSystem, Information size, IEnumerable <char>?driveLetters, IPhilote <IPartitionInfoEx>?philote)
 {
     PartitionFileSystem = partitionFileSystem;
     Size         = size;
     DriveLetters = driveLetters;
     Philote      = philote;
 }
        public GInvokeGenerateCodeSignil(
            IGAssemblyGroupSignil?gAssemblyGroupSignil = default
            // , IGGlobalSettingsSignil? gGlobalSettingsSignil = default
            , IGSolutionSignil?gSolutionSignil = default
            , string artifactsDirectoryBase    = default
            , string artifactsFileRelativePath = default
            , string[] artifactsFilePaths      = default
            , string temporaryDirectoryBase    = default
            , bool enableProgress    = default
            , bool enablePersistence = default
            , bool enablePickAndSave = default
            , string persistenceMessageFileRelativePath         = default
            , string[] persistenceFilePaths                     = default
            , string pickAndSaveMessageFileRelativePath         = default
            , string[] pickAndSaveFilePaths                     = default
            , IGGenerateCodeProgress?progress                   = default
            , IPersistence <IInsertResultsAbstract>?persistence = default
            , IPickAndSave <IInsertResultsAbstract>?pickAndSave = default
            , string dBConnectionString = default
            , string ormLiteDialectProviderStringDefault = default
            , IEntryPoints entryPoints = default
            )
        {
            // ToDo: use the ATAP normal method of parameter->Property settings
            GAssemblyGroupSignil = gAssemblyGroupSignil;
            //GGlobalSettingsSignil = gGlobalSettingsSignil;
            GSolutionSignil           = gSolutionSignil;
            ArtifactsDirectoryBase    = artifactsDirectoryBase;
            ArtifactsFileRelativePath = artifactsFileRelativePath;
            ArtifactsFilePaths        = artifactsFilePaths;
            TemporaryDirectoryBase    = temporaryDirectoryBase;
            EnableProgress            = enableProgress;
            EnablePersistence         = enablePersistence;
            EnablePickAndSave         = enablePickAndSave;
            Progress    = progress;
            Persistence = persistence;
            PickAndSave = pickAndSave;
            EntryPoints = entryPoints;

            PersistenceMessageFileRelativePath = persistenceMessageFileRelativePath;
            PersistenceFilePaths = persistenceFilePaths;
            PickAndSaveMessageFileRelativePath = pickAndSaveMessageFileRelativePath;
            PickAndSaveFilePaths = pickAndSaveFilePaths;
            DBConnectionString   = dBConnectionString;
            OrmLiteDialectProviderStringDefault = ormLiteDialectProviderStringDefault;
            Philote = new Philote <IGInvokeGenerateCodeSignil>();
        }
示例#4
0
        public static IGClass AddTConstructorAutoPropertyGroup(this IGClass gClass, IPhilote <IGMethod> gMethodId, string gAutoPropertyName, string gType, IPhilote <IGPropertyGroup> gPropertyGroupId = default, string?gAccessors = "{ get;}", string?gVisibility = default)
        {
            var gProperty = new GProperty(gAutoPropertyName.ToUpperFirstChar(), gType, gAccessors, gVisibility);

            if (gClass.GPropertyGroups != null && gClass.GPropertyGroups.ContainsKey(gPropertyGroupId))
            {
                gClass.GPropertyGroups[gPropertyGroupId].GPropertys[gProperty.Philote] = gProperty;
            }
            else
            {
                throw new Exception(string.Format("{0} not found in the PropertyGroups of {1}", gPropertyGroupId.ID.ToString(), gClass.GName));
            }
            IGMethod gMethod = default;

            if (gClass.GMethods != null && gClass.GMethods.ContainsKey(gMethodId))
            {
                gMethod = gClass.GMethods[gMethodId];
            }
            else if (gClass.GMethodGroups != null)
            {
                foreach (var kvp in gClass.GMethodGroups)
                {
                    if (kvp.Value.GMethods.ContainsKey(gMethodId))
                    {
                        var gMethodGroup = kvp.Value;
                        gMethod = gMethodGroup.GMethods[gMethodId];
                    }
                }
            }

            if (gMethod == null)
            {
                throw new Exception(string.Format("{0} not found in the Methods or MethodGroups of {1}", gMethodId.ID.ToString(), gClass.GName));
            }

            GArgument gArgument = new GArgument(gAutoPropertyName.ToLowerFirstChar(), gType);

            gMethod.GDeclaration.GArguments[gArgument.Philote] = gArgument;

            gMethod.GBody.GStatements.Add($"{gAutoPropertyName.ToUpperFirstChar()} = {gAutoPropertyName.ToLowerFirstChar()} ?? throw new ArgumentNullException(nameof({gAutoPropertyName.ToLowerFirstChar()}));");
            return(gClass);
        }
示例#5
0
 public CPU(ICPUSignil cPUSignil, IPhilote <ICPU>?philote)
 {
     CPUSignil = cPUSignil ?? throw new ArgumentNullException(nameof(cPUSignil));
     Philote   = philote;
 }
示例#6
0
 public FSEntityFile(string path, FileInfo?fileInfo, string?hash, IPhilote <IFSEntityAbstract> philote, Exception?exception) : base(path, philote, exception)
 {
     FileInfo = fileInfo;
     Hash     = hash;
 }
示例#7
0
 public FSEntityDirectory(string path, DirectoryInfo?directoryInfo, IPhilote <IFSEntityAbstract> philote, Exception?exception) : base(path, philote, exception)
 {
     DirectoryInfo = directoryInfo;
 }
示例#8
0
 public FSEntityAbstract(string path, IPhilote <IFSEntityAbstract> philote, Exception?exception)
 {
     Path      = path ?? throw new ArgumentNullException(nameof(path));
     Philote   = philote ?? throw new ArgumentNullException(nameof(philote));
     Exception = exception;
 }
示例#9
0
 public FSEntityAbstract(string path, IPhilote <IFSEntityAbstract> philote) : this(path, philote, null)
 {
 }
示例#10
0
 public FSEntityArchiveFile(string path, FileInfo?fileInfo, string?hash, IPhilote <IFSEntityAbstract> philote, Exception?exception) : base(path, fileInfo, hash, philote, exception)
 {
 }
示例#11
0
        public static IGClass AddTConstructorAutoPropertyGroup(this IGClass gClass, IPhilote <IGMethod> gMethodId, string gAutoPropertyName, IPhilote <IGPropertyGroup> gPropertyGroupId)
        {
            string gType = "I" + gAutoPropertyName;

            return(gClass.AddTConstructorAutoPropertyGroup(gMethodId, gAutoPropertyName, gType, gPropertyGroupId));
        }
 public ComputerSoftwareProgram(IComputerSoftwareProgramSignil computerSoftwareProgramSignil, IPhilote <IComputerSoftwareProgram>?philote)
 {
     ComputerSoftwareProgramSignil = computerSoftwareProgramSignil ?? throw new ArgumentNullException(nameof(computerSoftwareProgramSignil));
     Philote = philote;
 }
        public static IGClass AddTLocalizerConstructorAutoPropertyGroup(this IGClass gClass, IPhilote <IGMethod> gMethodId, string gAutoPropertyName, string assemblyUnitName, IPhilote <IGPropertyGroup> gPropertyGroupId = default, string?gAccessors = "{ get; }", string?gVisibility = default)
        {
            IGMethod gMethod = default;

            if (gClass.GMethods != null && gClass.GMethods.ContainsKey(gMethodId))
            {
                gMethod = gClass.GMethods[gMethodId];
            }
            else if (gClass.GMethodGroups != null)
            {
                foreach (var kvp in gClass.GMethodGroups)
                {
                    if (kvp.Value.GMethods.ContainsKey(gMethodId))
                    {
                        //GMethodGroup gMethodGroup = kvp.Value;
                        gMethod = kvp.Value.GMethods[gMethodId];
                    }
                }
            }
            if (gMethod == null)
            {
                throw new Exception(string.Format("{0} not found in the Constructors, Methods or MethodGroups of {1}", gMethodId.ID.ToString(), gClass.GName));
            }

            var       gMethodDeclaration = gMethod.GDeclaration;
            string    gName     = gMethodDeclaration.GName;
            GProperty gProperty = new GProperty(gName: $"{gAutoPropertyName}", gType: $"IStringLocalizer", gAccessors: gAccessors);

            if (gClass.GPropertyGroups != null && gClass.GPropertyGroups.ContainsKey(gPropertyGroupId))
            {
                gClass.GPropertyGroups[gPropertyGroupId].GPropertys[gProperty.Philote] = gProperty;
            }
            else
            {
                throw new Exception(string.Format("{0} not found in the PropertyGroups of {1}", gPropertyGroupId.ID.ToString(), gClass.GName));
            }

            //gMethod.GBody.StatementList.Add($"{gAutoPropertyName} = StringLocalizerFactory.Create(nameof({assemblyUnitName}.Resources), \"{assemblyUnitName}\");");
            gMethod.GBody.GStatements.Add($"{gAutoPropertyName} = StringLocalizerFactory.Create(nameof(Resources), \"{assemblyUnitName}\");");
            return(gClass);
        }
示例#14
0
 public DiskDrive(IDiskDriveSignil diskDriveSignil, int?diskDriveNumber, IPhilote <IDiskDrive> philote)
 {
     DiskDriveSignil = diskDriveSignil ?? throw new ArgumentNullException(nameof(diskDriveSignil));
     DiskDriveNumber = diskDriveNumber;
     Philote         = philote ?? throw new ArgumentNullException(nameof(philote));
 }
        public static IGClass AddTLoggerConstructorAutoPropertyGroup(this IGClass gClass, IPhilote <IGMethod> gMethodId, IPhilote <IGPropertyGroup> gPropertyGroupId = default, string?gAccessors = "{ get; }", string?gVisibility = default)
        {
            IGMethod gMethod = default;

            if (gClass.GMethods != null && gClass.GMethods.ContainsKey(gMethodId))
            {
                gMethod = gClass.GMethods[gMethodId];
            }
            else if (gClass.GMethodGroups != null)
            {
                foreach (var kvp in gClass.GMethodGroups)
                {
                    if (kvp.Value.GMethods.ContainsKey(gMethodId))
                    {
                        var gMethodGroup = kvp.Value;
                        gMethod = gMethodGroup.GMethods[gMethodId];
                    }
                }
            }
            if (gMethod == null)
            {
                throw new Exception(string.Format("{0} not found in the Constructors, Methods or MethodGroups of {1}", gMethodId.ID.ToString(), gClass.GName));
            }

            var       gMethodDeclaration = gMethod.GDeclaration;
            string    gName     = gMethodDeclaration.GName;
            GProperty gProperty = new GProperty(gName: $"Logger", gType: $"ILogger<{gName}>", gAccessors: gAccessors);

            if (gClass.GPropertyGroups != null && gClass.GPropertyGroups.ContainsKey(gPropertyGroupId))
            {
                gClass.GPropertyGroups[gPropertyGroupId].GPropertys[gProperty.Philote] = gProperty;
            }
            else
            {
                throw new Exception(string.Format("{0} not found in the PropertyGroups of {1}", gPropertyGroupId.ID.ToString(), gClass.GName));
            }

            gMethod.GBody.GStatements.Add($"Logger = LoggerFactory.CreateLogger<{gName}>();");
            return(gClass);
        }
 public PhiloteTestData(IPhilote <T> objTestData, string serializedTestData) : base(objTestData, serializedTestData)
 {
 }