예제 #1
0
파일: Program.cs 프로젝트: granth7/neonKUBE
        static void Main()
        {
            // Change the current directory to the program folder because we
            // use relative references to the Icon and other resource files.

            ProgramFolder = Path.GetFullPath(NeonHelper.GetAssemblyFolder(Assembly.GetExecutingAssembly()));

            if (ProgramFolder.EndsWith("\\") || ProgramFolder.EndsWith("/"))
            {
                ProgramFolder = ProgramFolder.Substring(0, ProgramFolder.Length - 1);
            }

            Environment.CurrentDirectory = ProgramFolder;

            // Use the version of Powershell Core installed with the application,
            // if present.

            PowerShell.PwshPath = KubeHelper.PwshPath;

            // Start the app.

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext());
            Application.Run(new MainForm());
        }
        public IActionResult GetProgramFolderById(string folder_id)
        {
            try
            {
                ProgramFolder pf = dbContext.ProgramFolders.Find(folder_id);

                if (pf != null)
                {
                    return(Ok(pf));
                }
                else
                {
                    throw new Exception($"Program folder with id of '{ folder_id }' is not found.");
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(GetErrorMessage(ex)));
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: calum74/s2
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Usage: BuildPresets C:\\Spooky2 presets.db");
                return;
            }
            string spooky2dir = args[0];
            string outfile    = args[1];
            var    provider   = new Spooky2.Provider(spooky2dir);
            var    presets    = ProgramFolder.Clone(provider.RootPresetCollection);

            presets.SaveDatabase(outfile);

            using (var file = File.OpenRead(outfile + ".idx"))
            {
                var root = new StoredProgramFolder();
                root.Stream = file;
                root.Offset = 0;
            }

            Console.WriteLine("Successfully generated database");
        }