• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 9988359965

18 Jul 2024 08:42AM UTC coverage: 57.299% (+0.6%) from 56.679%
9988359965

push

github

JFriel
Merge branch 'develop' of https://github.com/HicServices/RDMP

11072 of 20790 branches covered (53.26%)

Branch coverage included in aggregate %.

31313 of 53181 relevant lines covered (58.88%)

7885.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Application/ResearchDataManagementPlatform/Program.cs
1
// Copyright (c) The University of Dundee 2018-2019
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using System.Runtime.InteropServices;
9
using CommandLine;
10
using Rdmp.Core.ReusableLibraryCode;
11
using Rdmp.Core.ReusableLibraryCode.Checks;
12
using Rdmp.Core.ReusableLibraryCode.Settings;
13
using Rdmp.Core.Startup;
14
using Rdmp.UI;
15
using Rdmp.UI.SimpleDialogs;
16
using Rdmp.UI.TestsAndSetup;
17

18
namespace ResearchDataManagementPlatform;
19

20
internal static partial class Program
21
{
22
    [LibraryImport("kernel32.dll")]
23
    private static partial void AttachConsole(int dwProcessId);
24

25
    /// <summary>
26
    /// The main entry point for the application.
27
    /// </summary>
28
    [STAThread]
29
    private static void Main(string[] args)
30
    {
31
        try
32
        {
33
            AttachConsole(-1);
×
34
        }
×
35
        catch (Exception)
×
36
        {
37
            Console.WriteLine("Couldn't redirect console. Never mind");
×
38
        }
×
39

40
        Startup.PreStartup();
×
41

42
        UsefulStuff.GetParser()
×
43
            .ParseArguments<ResearchDataManagementPlatformOptions>(args)
×
44
            .MapResult(RunApp, _ => -1);
×
45
    }
×
46

47
    private static object RunApp(ResearchDataManagementPlatformOptions arg)
48
    {
49
        try
50
        {
51
            arg.PopulateConnectionStringsFromYamlIfMissing(ThrowImmediatelyCheckNotifier.Quiet);
×
52
        }
×
53
        catch (Exception ex)
×
54
        {
55
            ExceptionViewer.Show(ex);
×
56
            return -500;
×
57
        }
58
        if(UserSettings.UseLocalFileSystem && !string.IsNullOrWhiteSpace(UserSettings.LocalFileSystemLocation))
×
59
        {
60
            arg.Dir = UserSettings.LocalFileSystemLocation;
×
61
        }
62

63

64
        var bootStrapper =
×
65
            new RDMPBootStrapper(arg, locator =>
×
66
            {
×
67
                var form = new RDMPMainForm();
×
68
                form.SetRepositoryLocator(locator);
×
69
                return form;
×
70
            });
×
71

72
        bootStrapper.Show();
×
73
        return 0;
×
74
    }
×
75
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc