private static Modules GetModulesResult(ModuleMetric metric)
        {
            Modules module = new Modules();

            module.Add(MetricsReportBuilder.GetModuleResult(metric));
            return(module);
        }
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for editor
        Modules.Add("FirstPersonShooter");
    }
Exemple #3
0
        async Task <bool> IPermissionConfig.WhitelistModuleGuild(IGuild guild, ModuleInfo module)
        {
            var gui = QueryGuild(guild);

            if (gui != null)
            {
                var n = QueryModule(module);
                if (n == null)
                {
                    n = new ConfigModule {
                        ModuleName = module.Name
                    };
                    Modules.Add(n);
                    await SaveChangesAsync().ConfigureAwait(false);
                }

                var hasThis = QueryGuildModules().Any(m => m.Module.Id == n.Id && m.Guild.Id == gui.Id);
                if (!hasThis)
                {
                    var gm = new GuildModule <TGuild, TChannel, TUser>
                    {
                        Guild  = gui,
                        Module = n
                    };
                    GuildModules.Add(gm);
                    //gui.WhiteListedModules.Add(gm);
                    await SaveChangesAsync().ConfigureAwait(false);
                }

                return(!hasThis);
            }

            return(false);
        }
Exemple #4
0
        async Task <bool> IPermissionConfig.WhitelistModule(ITextChannel channel, ModuleInfo module)
        {
            var ch = QueryChannel(channel);

            if (ch != null)
            {
                var n = QueryModule(module);
                if (n == null)
                {
                    n = new ConfigModule {
                        ModuleName = module.Name
                    };
                    Modules.Add(n);
                    await SaveChangesAsync().ConfigureAwait(false);;
                }

                var hasThis = QueryChannelModules().Any(m => m.Module.Id == n.Id && m.Channel.Id == ch.Id);
                if (!hasThis)
                {
                    var cm = new ChannelModule <TChannel, TUser>
                    {
                        Channel = ch,
                        Module  = n
                    };
                    ChannelModules.Add(cm);
                    //ch.WhiteListedModules.Add(cm);
                    await SaveChangesAsync().ConfigureAwait(false);;
                }

                return(!hasThis);
            }

            return(false);
        }
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for game
        Modules.Add("ParticlesFeaturesTour");
    }
Exemple #6
0
        private void Load()
        {
            Controller = new TypeSystemController(this);

            LinkerModule = Controller.CreateModule();
            using (var module = Controller.MutateModule(LinkerModule))
            {
                module.Name              = "@Linker";
                module.Assembly          = "@Linker";
                module.IsLinkerGenerated = true;
            }
            Modules.Add(LinkerModule);

            DefaultLinkerType = Controller.CreateType();
            using (var type = Controller.MutateType(DefaultLinkerType))
            {
                type.Module            = LinkerModule;
                type.Name              = "Default";
                type.IsLinkerGenerated = true;
                type.TypeCode          = MosaTypeCode.ReferenceType;
            }
            Controller.AddType(DefaultLinkerType);

            metadata.Initialize(this, Controller);
            metadata.LoadMetadata();

            if (CorLib == null)
            {
                throw new AssemblyLoadException();
            }
        }
Exemple #7
0
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for game
        Modules.Add("Game");
    }
 public void AddModule(ModularityModule module)
 {
     if (Modules.Count(m => m.Options.Id == module.Options.Id) == 0)
     {
         Modules.Add(module);
     }
 }
        internal CaseInput(List <string> lines)
        {
            this.lines = lines;
            N          = int.Parse(lines[0]);
            var funs    = lines[1].Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
            var targets = lines[2].Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            for (int arrayIndex = 0; arrayIndex < N; arrayIndex++)
            {
                var targetGraphModule = targets[arrayIndex] > 0 ? Modules[targets[arrayIndex]] : null;

                var newGraphModule = new GraphModule
                {
                    Id     = arrayIndex + 1,
                    Fun    = funs[arrayIndex],
                    Target = targetGraphModule
                };

                targetGraphModule?.Triggers.Add(newGraphModule);
                Modules.Add(arrayIndex + 1, newGraphModule);
            }

            foreach (var module in Modules.Values)
            {
                if (module.Target == null)
                {
                    AbyssalModules.Add(module);
                }

                if (!module.Triggers.Any())
                {
                    Initiators.Add(module);
                }
            }
        }
Exemple #10
0
        public ShellAspNetApplication()
        {
            InitializeComponent();
            stateMachineModule.StateMachineStorageType = typeof(StateMachine);



            //try
            //{
            //    AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
            //    {
            //        var location = Path.Combine(AppDomain.CurrentDomain.RelativeSearchPath,
            //            args.Name.Split(',')[0] + ".dll");
            //        if (File.Exists(location))
            //        {
            //            var assembly = Assembly.LoadFrom(location);
            //            return assembly;
            //        }
            //        return null;
            //    };

            //    ReflectionHelper.GetImportedModules(out _loadedModuleTypes, out _loadedContextTypes);
            foreach (var loadedModuleType in Global.LoadedModuleTypes)
            {
                var loadedModule = (ModuleBase)Activator.CreateInstance(loadedModuleType);
                Modules.Add(loadedModule);
            }
            //}
            //catch
            //{
            //    Trace.WriteLine(string.Format("Unable to load modules."));
            //}
        }
Exemple #11
0
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Initialize
        OutputName        = "FlaxTests";
        ConfigurationName = "Tests";
        IsPreBuilt        = false;
        UseSymbolsExports = false;
        Platforms         = new[]
        {
            TargetPlatform.Windows,
            TargetPlatform.Linux,
            TargetPlatform.Mac,
        };
        Architectures = new[]
        {
            TargetArchitecture.x64,
        };
        Configurations = new[]
        {
            TargetConfiguration.Development,
        };

        Modules.Remove("Main");
        Modules.Add("Tests");
    }
        private void ExecuteAddSerialNumber()
        {
            if (string.IsNullOrWhiteSpace(SerialNumberToAdd))
            {
                HasAddSerialError     = true;
                AddSerialErrorMessage = "Please enter a serial number.";
            }
            else if (Modules.Any(t => t.SerialNumber == SerialNumberToAdd.Trim()))
            {
                AddSerialErrorMessage = "Modules is already in list.";
                HasAddSerialError     = true;
            }
            else
            {
                HasAddSerialError = false;
                LoadModuleScan scan = new LoadModuleScan
                {
                    EPC          = SerialNumberToAdd,
                    SerialNumber = SerialNumberToAdd,
                    ScanTime     = DateTime.UtcNow
                };

                Modules.Add(scan);
                ModuleHeader = Modules.Count().ToString() + " IN LOAD";
            }
            SerialNumberToAdd = "";
        }
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for editor
        Modules.Add("GraphicsFeaturesTour");
    }
 public ServerBlazorApplication()
 {
     Modules.Add(new TestBlazorModule());
     this.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
     CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema;
     DatabaseUpdateMode     = DatabaseUpdateMode.UpdateDatabaseAlways;
 }
Exemple #15
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void Initialize()
        {
            Modules.Clear();
            Roles.Clear();
            DispatcherHelper.RunAsync(() => {
                List <Role> roles = _UserService.QueryRoles();
                foreach (var r in roles)
                {
                    Roles.Add(new RoleModel(r));
                }

                List <Module> modules = _UserService.QueryModuleWithFunctions();

                foreach (var m in modules)
                {
                    var module = new ModuleModel(m);

                    if (m.Function != null && m.Function.Count > 0)
                    {
                        List <FunctionModel> functions = new List <FunctionModel>();
                        foreach (var f in m.Function)
                        {
                            functions.Add(new FunctionModel(f, 0));
                        }
                        module.Functions = functions;
                    }
                    Modules.Add(module);
                }
            });
        }
Exemple #16
0
        public async void Init()
        {
            if (Project == null)
            {
                Helper.Notify("当前项目为空,请在左侧菜单选择“项目”节点", NotificationType.Error);
                return;
            }

            List <CodeModule> entities = new List <CodeModule>();
            await _provider.ExecuteScopedWorkAsync(provider =>
            {
                IDataContract contract = provider.GetRequiredService <IDataContract>();
                entities = contract.CodeModules.Where(m => m.ProjectId == Project.Id).OrderBy(m => m.Order).ToList();
                return(Task.CompletedTask);
            });

            Modules.Clear();
            foreach (CodeModule entity in entities)
            {
                ModuleViewModel model = _provider.GetRequiredService <ModuleViewModel>();
                model         = entity.MapTo(model);
                model.Project = Project;
                Modules.Add(model);
            }

            Helper.Output($"模块列表刷新成功,共{Modules.Count}个模块");
        }
Exemple #17
0
        public CoverageSummaryTests()
        {
            Lines lines = new Lines();

            lines.Add(1, new LineInfo {
                Hits = 1, IsBranchPoint = true
            });
            lines.Add(2, new LineInfo {
                Hits = 0
            });

            Methods methods = new Methods();

            methods.Add("System.Void Coverlet.Core.Tests.CoverageSummaryTests::TestCalculateSummary()", lines);

            Classes classes = new Classes();

            classes.Add("Coverlet.Core.Tests.CoverageSummaryTests", methods);

            Documents documents = new Documents();

            documents.Add("doc.cs", classes);

            _modules = new Modules();
            _modules.Add("module", documents);
        }
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for game
        Modules.Add("VisjectPlugin");
    }
Exemple #19
0
        private void InitializeExtensionModules()
        {
            List <Assembly> assemblies = new List <Assembly>();

            foreach (string directory in Directory.GetDirectories(ModulesCatalogPath))
            {
                foreach (string file in Directory.GetFiles(directory, "*.dll"))
                {
                    Assembly assembly = Assembly.LoadFrom(file);
                    assemblies.Add(assembly);
                }
            }
            foreach (Assembly asm in assemblies)
            {
                foreach (Type type in asm.GetTypes())
                {
                    if (type.GetInterfaces().Where(i => i == typeof(IModule)).Count() > 0)
                    {
                        IModule module = (IModule)Activator.CreateInstance(type);
                        Modules.Add(module);
                    }
                }
            }
            foreach (IModule module in Modules)
            {
                module.Initialize(this);
            }
        }
Exemple #20
0
        private async Task CaptureModulesAsync(TcpListener listener)
        {
            try
            {
                HNode moduleNode = new HNode(await listener.AcceptSocketAsync());

                moduleNode.InFormat  = HFormat.EvaWire;
                moduleNode.OutFormat = HFormat.EvaWire;
                HPacket infoPacket = await moduleNode.ReceivePacketAsync();

                var module = new ModuleInfo(moduleNode);
                module.PropertyChanged += Module_PropertyChanged;

                module.Version     = Version.Parse(infoPacket.ReadUTF8());
                module.Name        = infoPacket.ReadUTF8();
                module.Description = infoPacket.ReadUTF8();

                module.Authors.Capacity = infoPacket.ReadInt32();
                for (int i = 0; i < module.Authors.Capacity; i++)
                {
                    module.Authors.Add(new AuthorAttribute(infoPacket.ReadUTF8()));
                }
                Modules.Add(module);

                module.Initialize();
                Task handleModuleDataTask = HandleModuleDataAsync(module);
            }
            finally { Task captureModulesAsync = CaptureModulesAsync(listener); }
        }
Exemple #21
0
        /// <inheritdoc />
        public override void PostBuild(TaskGraph graph, BuildOptions buildOptions)
        {
            base.PostBuild(graph, buildOptions);

            // If building engine executable for platform doesn't support referencing it when linking game shared libraries
            if (UseSeparateMainExecutable(buildOptions))
            {
                // Build additional executable with Main module only that uses shared library
                using (new ProfileEventScope("BuildExecutable"))
                {
                    BuildMainExecutable(graph, buildOptions);
                }

                // Restore state from PreBuild
                Modules.Add("Main");
            }

            // Mono on Linux is using dynamic linking and needs additional link files
            if (buildOptions.Platform.Target == TargetPlatform.Linux && Platform.BuildTargetPlatform == TargetPlatform.Linux && !IsPreBuilt)
            {
                var task = graph.Add <Task>();
                task.PrerequisiteFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so"));
                task.ProducedFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so.1"));
                task.WorkingDirectory = buildOptions.OutputFolder;
                task.CommandPath      = "ln";
                task.CommandArguments = "-s -f libmonosgen-2.0.so libmonosgen-2.0.so.1";
                task = graph.Add <Task>();
                task.PrerequisiteFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so"));
                task.ProducedFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so.1.0.0"));
                task.WorkingDirectory = buildOptions.OutputFolder;
                task.CommandPath      = "ln";
                task.CommandArguments = "-s -f libmonosgen-2.0.so libmonosgen-2.0.so.1.0.0";
            }
        }
Exemple #22
0
        public Module AddModule(string libraryName)
        {
            var module = new Module(libraryName);

            Modules.Add(module);
            return(module);
        }
Exemple #23
0
 /// <summary>
 /// Add a module to this scene.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="module"></param>
 public void AddModule(string name, IRegionModule module)
 {
     if (!Modules.ContainsKey(name))
     {
         Modules.Add(name, module);
     }
 }
        private void SetupDataSingleModule()
        {
            Lines lines = new Lines();

            lines.Add(1, 1);
            lines.Add(2, 0);
            Branches branches = new Branches();

            branches.Add(new BranchInfo {
                Line = 1, Hits = 1, Offset = 1, Path = 0, Ordinal = 1
            });
            branches.Add(new BranchInfo {
                Line = 1, Hits = 1, Offset = 1, Path = 1, Ordinal = 2
            });

            Methods methods      = new Methods();
            var     methodString = "System.Void Coverlet.Core.Tests.CoverageSummaryTests::TestCalculateSummary()";

            methods.Add(methodString, new Method());
            methods[methodString].Lines    = lines;
            methods[methodString].Branches = branches;

            Classes classes = new Classes();

            classes.Add("Coverlet.Core.Tests.CoverageSummaryTests", methods);

            Documents documents = new Documents();

            documents.Add("doc.cs", classes);

            _averageCalculationSingleModule = new Modules();
            _averageCalculationSingleModule.Add("module", documents);
        }
Exemple #25
0
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Initialize
        IsEditor          = true;
        OutputName        = "FlaxEditor";
        ConfigurationName = "Editor";
        IsPreBuilt        = false;
        Platforms         = new[]
        {
            TargetPlatform.Windows,
        };
        Architectures = new[]
        {
            TargetArchitecture.x64,
        };
        GlobalDefinitions.Add("USE_EDITOR");
        Win32ResourceFile = Path.Combine(Globals.EngineRoot, "Source", "FlaxEditor.rc");

        Modules.Add("Editor");
        Modules.Add("CSG");
        Modules.Add("ShadowsOfMordor");
        Modules.Add("ShadersCompilation");
        Modules.Add("ContentExporters");
        Modules.Add("ContentImporters");
    }
Exemple #26
0
        public ShellWindowsFormsApplication()
        {
            IEnumerable <Type> loadedModuleTypes;

            InitializeComponent();

            stateMachineModule1.StateMachineStorageType = typeof(StateMachine);
            try
            {
                securityModule1.UserType = typeof(User);

                ReflectionHelper.GetImportedModules(out loadedModuleTypes, out _loadedContextTypes);

                foreach (var loadedModuleType in loadedModuleTypes)
                {
                    var loadedModule = (ModuleBase)Activator.CreateInstance(loadedModuleType);
                    Modules.Add(loadedModule);
                }
            }
            catch (Exception exception)
            {
                Trace.WriteLine($"Unable to load modules: {exception}");
            }

            var layoutDirection = ConfigurationManager.AppSettings["LayoutDirection"];

            if (layoutDirection?.ToLower() == "rtl")
            {
                IsRightToLeft = true;
            }
        }
Exemple #27
0
 /// <summary>
 /// Create a new VBA Project
 /// </summary>
 internal void Create()
 {
     if (Lcid > 0)
     {
         throw (new InvalidOperationException("Package already contains a VBAProject"));
     }
     ProjectID     = "{5DD90D76-4904-47A2-AF0D-D69B4673604E}";
     Name          = "VBAProject";
     SystemKind    = eSyskind.Win32;                   //Default
     Lcid          = 1033;                             //English - United States
     LcidInvoke    = 1033;                             //English - United States
     CodePage      = Encoding.GetEncoding(0).CodePage; //Switched from Default to make it work in Core
     MajorVersion  = 1361024421;
     MinorVersion  = 6;
     HelpContextID = 0;
     Modules.Add(new ExcelVBAModule(_wb.CodeNameChange)
     {
         Name = "ThisWorkbook", Code = "", Attributes = GetDocumentAttributes("ThisWorkbook", "0{00020819-0000-0000-C000-000000000046}"), Type = eModuleType.Document, HelpContext = 0
     });
     foreach (var sheet in _wb.Worksheets)
     {
         var name = GetModuleNameFromWorksheet(sheet);
         if (!Modules.Exists(name))
         {
             Modules.Add(new ExcelVBAModule(sheet.CodeNameChange)
             {
                 Name = name, Code = "", Attributes = GetDocumentAttributes(sheet.Name, "0{00020820-0000-0000-C000-000000000046}"), Type = eModuleType.Document, HelpContext = 0
             });
         }
     }
     _protection = new ExcelVbaProtection(this)
     {
         UserProtected = false, HostProtected = false, VbeProtected = false, VisibilityState = true
     };
 }
    /// <inheritdoc />
    public override void Init()
    {
        base.Init();

        // Reference the modules for game
        Modules.Add("BasicTemplate");
    }
        private void LoadParentModules(MixCmsContext _context, IDbContextTransaction _transaction)
        {
            var getModulePost = MixModulePosts.ReadViewModel.GetModulePostNavAsync(Id, Specificulture, _context, _transaction);

            if (getModulePost.IsSucceed)
            {
                this.Modules = getModulePost.Data;
                this.Modules.ForEach(c =>
                {
                    c.IsActived = MixModulePosts.ReadViewModel.Repository.CheckIsExists(n => n.ModuleId == c.ModuleId && n.PostId == Id, _context, _transaction);
                });
            }
            var otherModules = MixModules.ReadListItemViewModel.Repository.GetModelListBy(
                m => (m.Type == (int)MixEnums.MixModuleType.Content || m.Type == (int)MixEnums.MixModuleType.ListPost) &&
                m.Specificulture == Specificulture &&
                !Modules.Any(n => n.ModuleId == m.Id && n.Specificulture == m.Specificulture)
                , "CreatedDateTime", 1, null, 0, _context, _transaction);

            foreach (var item in otherModules.Data.Items)
            {
                Modules.Add(new MixModulePosts.ReadViewModel()
                {
                    ModuleId    = item.Id,
                    Image       = item.Image,
                    PostId      = Id,
                    Description = Title
                });
            }
        }
Exemple #30
0
        void InitializeComponent()
        {
            module1        = new SystemModule();
            module2        = new SystemAspNetModule();
            module3        = new IOTesterModule();
            module4        = new IOTesterAspNetModule();
            sqlConnection1 = new SqlConnection();
            ((ISupportInitialize)(this)).BeginInit();
            //
            // sqlConnection1
            //
            sqlConnection1.ConnectionString =
                @"Integrated Security=SSPI;Pooling=false;Data Source=.\SQLEXPRESS;Initial Catalog=IOTester";
            sqlConnection1.FireInfoMessageEventOnUserErrors = false;
            //
            // IOTesterAspNetApplication
            //
            ApplicationName = "IOTester";
            Connection      = sqlConnection1;
            Modules.Add(module1);
            Modules.Add(module2);
            Modules.Add(module3);
            Modules.Add(module4);

            DatabaseVersionMismatch += IOTesterAspNetApplication_DatabaseVersionMismatch;
            ((ISupportInitialize)(this)).EndInit();
        }
		public Renamer(IDeobfuscatorContext deobfuscatorContext, IEnumerable<IObfuscatedFile> files, RenamerFlags flags) {
			RenamerFlags = flags;

			WarnIfXaml(files);

			modules = new Modules(deobfuscatorContext);
			isDelegateClass = new DerivedFrom(delegateClasses);
			mergeStateHelper = new MergeStateHelper(memberInfos);

			foreach (var file in files)
				modules.Add(new Module(file));
		}