コード例 #1
0
ファイル: Startup.cs プロジェクト: 274188A/Atlas
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IWebHostEnvironment env,
                              AtlasDbContext atlasDbContext,
                              ApplicationDbContext applicationDbContext,
                              IInstallationService installationService,
                              IDocumentationService documentationService)
        {
            if (env.IsDevelopment())
            {
                app.UseExceptionHandler("/Error");

                //app.UseDeveloperExceptionPage();
                //app.UseDatabaseErrorPage();
                app.UseWebAssemblyDebugging();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseBlazorFrameworkFiles();
            app.UseStaticFiles();
            //app.UseStaticFiles(new StaticFileOptions
            //{
            //    FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"Uploads")),
            //    RequestPath = new PathString("/Uploads")
            //});

            app.UseRouting();

            app.UseIdentityServer();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
                endpoints.MapControllers();
                endpoints.MapFallbackToFile("index.html");
            });

            if (Configuration["MigrateDatabases"] == "true")
            {
                atlasDbContext.Database.Migrate();
                applicationDbContext.Database.Migrate();
            }

            if (Configuration["EnsureDefaultSiteInitialized"] == "true")
            {
                installationService.EnsureDefaultSiteInitializedAsync().Wait();
            }

            if (Configuration["GenerateDocumentationOnStartup"] == "true")
            {
                documentationService.Generate(typeof(Site).Assembly);
            }
        }
コード例 #2
0
ファイル: FileController.cs プロジェクト: Thoorium/LiveDocs
 public FileController(ILogger <FileController> logger, IWebHostEnvironment hostEnvironment, IOptions <LiveDocsOptions> options, IDocumentationService documentationService)
 {
     _Logger               = logger;
     _HostEnvironment      = hostEnvironment;
     _Options              = options.Value;
     _DocumentationService = documentationService;
 }
コード例 #3
0
ファイル: EpgpModule.cs プロジェクト: mfuqua3/BuzzBot
 public EpgpModule(
     IPriorityReportingService priorityReportingService,
     IQueryService queryService,
     IEpgpService epgpService,
     IAuditService auditService,
     IEpgpCalculator epgpCalculator,
     IEpgpConfigurationService epgpConfigurationService,
     IPageService pageService,
     IDocumentationService documentationService,
     IEmoteService emoteService,
     IAliasService aliasService,
     IItemService itemService,
     IRaidService raidService,
     IAdministrationService administrationService,
     BuzzBotDbContext dbContext, IUserService userService, IMapper mapper, IDecayProcessor decayProcessor)
 {
     _priorityReportingService = priorityReportingService;
     _queryService             = queryService;
     _epgpService              = epgpService;
     _auditService             = auditService;
     _epgpCalculator           = epgpCalculator;
     _epgpConfigurationService = epgpConfigurationService;
     _pageService              = pageService;
     _documentationService     = documentationService;
     _emoteService             = emoteService;
     _aliasService             = aliasService;
     _itemService              = itemService;
     _raidService              = raidService;
     _administrationService    = administrationService;
     _dbContext      = dbContext;
     _userService    = userService;
     _mapper         = mapper;
     _decayProcessor = decayProcessor;
 }
コード例 #4
0
        public DocsController(IDocumentationService documentationService, ILogger logger,
            ISettingsProvider settingsProvider)
        {
            if (settingsProvider == null)
                throw new ArgumentNullException(nameof(settingsProvider));

            _documentationService = documentationService ?? throw new ArgumentNullException(nameof(documentationService));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }
コード例 #5
0
        protected void InitializeDocumentationPluginManager()
        {
            lock (_testPluginDocs)
            {
                while (_pluginLoadedDocs.HasValue && !_pluginLoadedDocs.Value)
                {
                    System.Threading.Thread.Sleep(30);
                }

                if (_pluginLoadedDocs.HasValue && _pluginLoadedDocs.Value)
                {
                    return;
                }

                if (_pluginLoadedDocs == null)
                {
                    _pluginLoadedDocs = false;
                }

                _testPluginDocs.AddAssembly(Assembly.GetExecutingAssembly());
                _testPluginDocs.UsePlugin(typeof(DemoWebsite.Classes.PluginInitialisation));
                _testPluginDocs.UsePlugin(typeof(DocumentationPlugin.PluginInitialisation));
                _testPluginDocs.UsePlugin(typeof(MemoryCache.Plugin.PluginInitialisation));
                _testPluginDocs.UsePlugin(typeof(ProductPlugin.PluginInitialisation));
                _testPluginDocs.UsePlugin(typeof(SearchPlugin.PluginInitialisation));
                _testPluginDocs.UsePlugin(typeof(BadEgg.Plugin.PluginInitialisation));

                _testPluginDocs.ConfigureServices();

                _pluginServicesDocs = new pm.PluginServices(_testPluginDocs) as IPluginClassesService;
                TimeSpan docLoadTime   = new TimeSpan(0, 0, 30);
                DateTime startLoadDocs = DateTime.Now;

                while (Shared.Classes.ThreadManager.Exists(SharedPluginFeatures.Constants.DocumentationLoadThread))
                {
                    System.Threading.Thread.Sleep(100);

                    if (DateTime.Now - startLoadDocs > docLoadTime)
                    {
                        break;
                    }
                }

                Assert.IsFalse(Shared.Classes.ThreadManager.Exists(Constants.DocumentationLoadThread));

                _documentationService = (IDocumentationService)_testPluginDocs.GetServiceProvider()
                                        .GetService(typeof(IDocumentationService));

                Assert.IsNotNull(_documentationService);

                Assert.IsTrue(_documentationService.GetDocuments().Count > 100);
                _pluginLoadedDocs = true;
            }

            Assert.IsNotNull(_pluginServicesDocs);
        }
コード例 #6
0
        public override void SetUp()
        {
            base.SetUp();

            _xmlDocumentation     = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/SimpleInjector.xml");
            _documentationService = new DocumentationService(
                new PluginFinder(new AppDomainTypeFinder(new FakeAssemblyFinder(new List <Assembly> {
                typeof(DocumentationMember).Assembly
            })),
                                 new TinyIoCContainer()));
        }
コード例 #7
0
        public void FindAllProvidersAndRetrieveInstanciatedClasses()
        {
            Assert.IsFalse(Shared.Classes.ThreadManager.Exists(SharedPluginFeatures.Constants.DocumentationLoadThread));

            IDocumentationService documentationService = (IDocumentationService)_documentationLoadPlugin.GetServiceProvider()
                                                         .GetService(typeof(IDocumentationService));

            Assert.IsNotNull(documentationService);

            Assert.IsTrue(documentationService.GetDocuments().Count > 100);
        }
コード例 #8
0
ファイル: RaidModule.cs プロジェクト: mfuqua3/BuzzBot
 public RaidModule(
     IRaidService raidService,
     IRaidFactory raidFactory,
     IEpgpConfigurationService epgpConfigurationService,
     IDocumentationService documentationService,
     IPageService pageService)
 {
     _raidService = raidService;
     _raidFactory = raidFactory;
     _epgpConfigurationService = epgpConfigurationService;
     _documentationService     = documentationService;
     _pageService = pageService;
 }
コード例 #9
0
 public BankModule(
     ClassicGuildBankClient client,
     CommandService commandService,
     ItemRequestService itemRequestService,
     IAdministrationService administrationService,
     IPageService pageService,
     IDocumentationService documentationService,
     IBankService bankService)
 {
     _client                = client;
     _commandService        = commandService;
     _itemRequestService    = itemRequestService;
     _administrationService = administrationService;
     _pageService           = pageService;
     _documentationService  = documentationService;
     _bankService           = bankService;
 }
コード例 #10
0
        public MainRegionViewModel(IEventAggregator eventAggregator,
            IResourceDictionaryProvider resourceDictionaryProvider,
            IApplicationProperties appliationProperties,
            IEventContext eventContext,
            IObjectServiceOperations objectServiceOperations,
            IInteractionService interactionService,
            IHistoricalTimeUtility historicalTimeUtility,
            IPropertyNameService columnNameService,
            IHistoricalColumnService historicalColumnService,
            ISerializationService serializationService,
            IHelpExtension helpExtension,
            IValueFormatter valueFormatter,
            IHdaFileExportService hdaFileExportService,
            IDocumentationService documentationService)
            : base(eventContext, objectServiceOperations,
                  interactionService, historicalTimeUtility,
                  columnNameService, historicalColumnService,
                  serializationService, helpExtension,
                  valueFormatter, eventAggregator,
                  hdaFileExportService, documentationService)
        {
            _eventAggregator = eventAggregator;
            _eventContext = eventContext;
            _historicalTimeUtility = historicalTimeUtility;

            if (HistoricalExcelService.Current == null)
                HistoricalExcelService.Current = new HistoricalExcelService(this,
                    eventContext, objectServiceOperations, interactionService, historicalTimeUtility, valueFormatter, appliationProperties);

            ItemsHistoricalTimePeriodViewModel.Items.CollectionChanged += Items_CollectionChanged;

            ListViewModel.ExportCommand = new DelegateCommand(ExportPropertyList);
            ListViewModel.ExportCommandText = interactionService.TranslatingService.GetSystemText("Import");

            EventListViewModel.ExportCommand = new DelegateCommand(ExportEventList);
            EventListViewModel.ExportCommandText = interactionService.TranslatingService.GetSystemText("Import");

            SubscribeEvents();
        }
コード例 #11
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="documentationService">IDocumentationService instance</param>
 public DocumentationSitemapProvider(IDocumentationService documentationService)
 {
     _documentationService = documentationService ?? throw new ArgumentNullException(nameof(documentationService));
 }
コード例 #12
0
ファイル: LandingController.cs プロジェクト: Alxandr/NuDoc
 public LandingController(IDocumentationService service)
 {
     _service = service;
 }
コード例 #13
0
 public Worker(ILogger <Worker> logger, IHostApplicationLifetime applicationLifetime, IDocumentationService documentationService)
 {
     _Logger = logger;
     _ApplicationLifetime  = applicationLifetime;
     _DocumentationService = documentationService;
 }
コード例 #14
0
 public EntityFieldPartDriver(IDocumentationService documentationService)
 {
     _documentationService = documentationService;
 }
コード例 #15
0
 public DocumentationController(IDocumentationService documentationService, ICacheManager cacheManager)
 {
     _documentationService = documentationService;
     _cacheManager         = cacheManager;
 }
コード例 #16
0
        public DocumentationMember(XmlNode memberNode, IDocumentationService documentationService)
        {
            _memberNode = memberNode;

            var nameAttribute = _memberNode.Attributes["name"];
            if(nameAttribute == null) throw new InvalidOperationException("The member doesn't have a name attribute");

            switch (nameAttribute.Value.Substring(0, 2))
            {
                case "T:":
                    Type = DocumentationMemberType.Type;
                    break;
                case "M:":
                    Type = DocumentationMemberType.Member;
                    break;
                case "P:":
                    Type = DocumentationMemberType.Property;
                    break;
                case "E:":
                    Type = DocumentationMemberType.Event;
                    break;
                case "F:":
                    Type = DocumentationMemberType.Field;
                    break;
                default:
                    throw new InvalidOperationException("Unknown member type " + nameAttribute.Value.Substring(0, 2));
            }

            FullMemberName = nameAttribute.Value.Substring(2);
            var memberNameMatch = Regex.Match(FullMemberName, @"\.[\w\`\+\#\@]+(.#ctor)?(\([\w\.\,\`\+\{\}\[\]\#\@]*\))?$").Value;
            if (string.IsNullOrEmpty(memberNameMatch))
                throw new Exception("Couldn't get member name");
            MemberName = memberNameMatch.Substring(1);
            if (MemberName.IndexOf(".#ctor", StringComparison.Ordinal) > 0)
                MemberName = MemberName.Substring(0, MemberName.IndexOf(".#ctor", StringComparison.Ordinal));
            if (MemberName.IndexOf("(", StringComparison.Ordinal) > 0)
                MemberName = MemberName.Substring(0, MemberName.IndexOf("(", StringComparison.Ordinal));

            IsConstructor = FullMemberName.Contains(".#ctor");

            ParameterTypes = new List<string>();
            if(Type == DocumentationMemberType.Member)
            {
                var parameterTypesMatch = Regex.Match(FullMemberName, @"\([\w\.\,]*\)$");
                if (parameterTypesMatch.Success)
                {
                    var parameterTypesRaw = parameterTypesMatch.Value.Substring(1);
                    parameterTypesRaw = parameterTypesRaw.Substring(0, parameterTypesRaw.Length - 1);
                    foreach(var parameterType in parameterTypesRaw.Split(Convert.ToChar(",")))
                    {
                        ParameterTypes.Add(parameterType);
                    }
                }
            }

            MemberInfos = new List<DocumentationMemberInfo>();
            MemberInfos.AddRange(documentationService.GetInfosForMember(memberNode));
            MemberSummary = MemberInfos.OfType<DocumentationMemberSummary>().FirstOrDefault();
            MemberReturns = MemberInfos.OfType<DocumentationMemberReturns>().FirstOrDefault();
            MemberValue = MemberInfos.OfType<DocumentationMemberValue>().FirstOrDefault();
            MemberParameters = MemberInfos.OfType<DocumentationMemberParameter>().ToList();

            foreach (var memberParameter in MemberParameters)
            {
                var memberParameterIndex = MemberParameters.IndexOf(memberParameter);
                if((ParameterTypes.Count - 1) >= memberParameterIndex)
                {
                    memberParameter.ParameterType = memberParameter.CleanText(ParameterTypes[memberParameterIndex]);
                }
            }
        }
コード例 #17
0
 public EndpointPartDriver(IDocumentationService documentationService)
 {
     _documentationService = documentationService;
 }
コード例 #18
0
        public override void SetUp()
        {
            base.SetUp();

            _xmlDocumentation = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/SimpleInjector.xml");
            _documentationService = new DocumentationService(
                new PluginFinder(new AppDomainTypeFinder(new FakeAssemblyFinder(new List<Assembly>{typeof(DocumentationMember).Assembly})),
                new TinyIoCContainer()));
        }
コード例 #19
0
 public ErrorResultPartDriver(IDocumentationService documentationService)
 {
     _documentationService = documentationService;
 }
コード例 #20
0
ファイル: NavController.cs プロジェクト: Alxandr/NuDoc
 public NavController(IDocumentationService repo)
 {
     _service = repo;
     helper = new UrlHelper(new System.Web.Routing.RequestContext(), RouteTable.Routes);
 }
コード例 #21
0
 public DocumentationsController(IDocumentationService documentationService) => _documentationService = documentationService;
コード例 #22
0
 public DataModule(BuzzBotDbContext dbContext, IPageService pageService, IDocumentationService documentationService)
 {
     _dbContext            = dbContext;
     _pageService          = pageService;
     _documentationService = documentationService;
 }
コード例 #23
0
 internal DocumentLoadThread(IDocumentationService documentationService)
     : base(null, new TimeSpan(0, 5, 0))
 {
     HangTimeout           = 0;
     _documentationService = documentationService ?? throw new ArgumentNullException(nameof(documentationService));
 }
コード例 #24
0
 public EntityDefinitionPartDriver(IDocumentationService documentationService)
 {
     _documentationService = documentationService;
 }
コード例 #25
0
ファイル: ProjectController.cs プロジェクト: Alxandr/NuDoc
 public ProjectController(IDocumentationService repo)
 {
     _service = repo;
     ViewBag.PartialResult = false;
 }
コード例 #26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="documentationService">IDocumentationService instance</param>
 public KeywordSearchProvider(IDocumentationService documentationService)
 {
     _documentationService = documentationService ?? throw new ArgumentNullException(nameof(documentationService));
 }
コード例 #27
0
        public DocumentationMember(XmlNode memberNode, IDocumentationService documentationService)
        {
            _memberNode = memberNode;

            var nameAttribute = _memberNode.Attributes["name"];

            if (nameAttribute == null)
            {
                throw new InvalidOperationException("The member doesn't have a name attribute");
            }

            switch (nameAttribute.Value.Substring(0, 2))
            {
            case "T:":
                Type = DocumentationMemberType.Type;
                break;

            case "M:":
                Type = DocumentationMemberType.Member;
                break;

            case "P:":
                Type = DocumentationMemberType.Property;
                break;

            case "E:":
                Type = DocumentationMemberType.Event;
                break;

            case "F:":
                Type = DocumentationMemberType.Field;
                break;

            default:
                throw new InvalidOperationException("Unknown member type " + nameAttribute.Value.Substring(0, 2));
            }

            FullMemberName = nameAttribute.Value.Substring(2);
            var memberNameMatch = Regex.Match(FullMemberName, @"\.[\w\`\+\#\@]+(.#ctor)?(\([\w\.\,\`\+\{\}\[\]\#\@]*\))?$").Value;

            if (string.IsNullOrEmpty(memberNameMatch))
            {
                throw new Exception("Couldn't get member name");
            }
            MemberName = memberNameMatch.Substring(1);
            if (MemberName.IndexOf(".#ctor", StringComparison.Ordinal) > 0)
            {
                MemberName = MemberName.Substring(0, MemberName.IndexOf(".#ctor", StringComparison.Ordinal));
            }
            if (MemberName.IndexOf("(", StringComparison.Ordinal) > 0)
            {
                MemberName = MemberName.Substring(0, MemberName.IndexOf("(", StringComparison.Ordinal));
            }

            IsConstructor = FullMemberName.Contains(".#ctor");

            ParameterTypes = new List <string>();
            if (Type == DocumentationMemberType.Member)
            {
                var parameterTypesMatch = Regex.Match(FullMemberName, @"\([\w\.\,]*\)$");
                if (parameterTypesMatch.Success)
                {
                    var parameterTypesRaw = parameterTypesMatch.Value.Substring(1);
                    parameterTypesRaw = parameterTypesRaw.Substring(0, parameterTypesRaw.Length - 1);
                    foreach (var parameterType in parameterTypesRaw.Split(Convert.ToChar(",")))
                    {
                        ParameterTypes.Add(parameterType);
                    }
                }
            }

            MemberInfos = new List <DocumentationMemberInfo>();
            MemberInfos.AddRange(documentationService.GetInfosForMember(memberNode));
            MemberSummary    = MemberInfos.OfType <DocumentationMemberSummary>().FirstOrDefault();
            MemberReturns    = MemberInfos.OfType <DocumentationMemberReturns>().FirstOrDefault();
            MemberValue      = MemberInfos.OfType <DocumentationMemberValue>().FirstOrDefault();
            MemberParameters = MemberInfos.OfType <DocumentationMemberParameter>().ToList();

            foreach (var memberParameter in MemberParameters)
            {
                var memberParameterIndex = MemberParameters.IndexOf(memberParameter);
                if ((ParameterTypes.Count - 1) >= memberParameterIndex)
                {
                    memberParameter.ParameterType = memberParameter.CleanText(ParameterTypes[memberParameterIndex]);
                }
            }
        }