public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder alter_database_folder            = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AlterDatabaseFolderName, false, false, "AlterDatabase");
            MigrationsFolder run_after_create_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterCreateDatabaseFolderName, true, false, "Run After Create Database");
            MigrationsFolder run_before_up_folder             = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunBeforeUpFolderName, false, false, "Run Before Update");
            MigrationsFolder up_folder        = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.UpFolderName, true, false, "Update");
            MigrationsFolder down_folder      = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.DownFolderName, true, false, "Down Folder - Nothing to see here. Move along.");
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunFirstAfterUpFolderName, false, false, "Run First After Update");
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.FunctionsFolderName, false, false, "Function");
            MigrationsFolder views_folder     = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.ViewsFolderName, false, false, "View");
            MigrationsFolder sprocs_folder    = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.SprocsFolderName, false, false, "Stored Procedure");
            MigrationsFolder indexes_folder   = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.IndexesFolderName, false, false, "Index");
            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false, "Run after Other Anytime Scripts");
            MigrationsFolder permissions_folder      = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.PermissionsFolderName, false, true, "Permission");
            MigrationsFolder before_migration_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.BeforeMigrationFolderName, false, true, "BeforeMigration");
            MigrationsFolder after_migration_folder  = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AfterMigrationFolderName, false, true, "AfterMigration");

            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   "migrations",
                                                                                                   remove_paths_from(configuration_property_holder.DatabaseName, file_system),
                                                                                                   remove_paths_from(configuration_property_holder.ServerName, file_system)),
                                                          get_run_date_time_string());

            return(new DefaultKnownFolders(alter_database_folder, run_after_create_database_folder, run_before_up_folder, up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder, indexes_folder, runAfterOtherAnyTimeScripts_folder, permissions_folder, before_migration_folder, after_migration_folder, change_drop_folder));
        }
        public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder alter_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AlterDatabaseFolderName, false, false, "AlterDatabase");
            MigrationsFolder run_after_create_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterCreateDatabaseFolderName, true, false, "Run After Create Database");
	        MigrationsFolder run_before_up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunBeforeUpFolderName, false, false, "Run Before Update");
	        MigrationsFolder up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.UpFolderName, true, false, "Update");
            MigrationsFolder down_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.DownFolderName, true, false, "Down Folder - Nothing to see here. Move along.");
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunFirstAfterUpFolderName, false, false, "Run First After Update");
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.FunctionsFolderName, false, false, "Function");
            MigrationsFolder views_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.ViewsFolderName, false, false, "View");
            MigrationsFolder sprocs_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.SprocsFolderName, false, false, "Stored Procedure");
            MigrationsFolder indexes_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.IndexesFolderName, false, false, "Index");
            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false, "Run after Other Anytime Scripts");
            MigrationsFolder permissions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.PermissionsFolderName, false, true, "Permission");
            MigrationsFolder before_migration_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.BeforeMigrationFolderName, false, true, "BeforeMigration");
            MigrationsFolder after_migration_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AfterMigrationFolderName, false, true, "AfterMigration");

            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   "migrations",
                                                                                                   remove_paths_from(configuration_property_holder.DatabaseName,file_system),
                                                                                                   remove_paths_from(configuration_property_holder.ServerName,file_system)),
                                                          get_run_date_time_string());

			return new DefaultKnownFolders(alter_database_folder, run_after_create_database_folder, run_before_up_folder, up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder, indexes_folder, runAfterOtherAnyTimeScripts_folder, permissions_folder, before_migration_folder, after_migration_folder, change_drop_folder);
        }
示例#3
0
        public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.UpFolderName, true, false);
            MigrationsFolder down_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                       configuration_property_holder.DownFolderName, true, false);
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.RunFirstAfterUpFolderName, false, false);
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.FunctionsFolderName, false, false);
            MigrationsFolder views_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                        configuration_property_holder.ViewsFolderName, false, false);
            MigrationsFolder sprocs_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.SprocsFolderName, false, false);

            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                                              configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false);

            MigrationsFolder permissions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                              configuration_property_holder.PermissionsFolderName, false, true);
            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   configuration_property_holder.DatabaseName,
                                                                                                   configuration_property_holder.ServerName),
                                                          get_run_date_time_string());

            return(new DefaultKnownFolders(up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder,
                                           runAfterOtherAnyTimeScripts_folder, permissions_folder, change_drop_folder));
        }
示例#4
0
        private void OK_Click(object sender, EventArgs e)
        {
            // Save preferred project in server preferences if changed

            if (PreferredProjectChanged)
            {
                SS.I.PreferredProjectId = PreferredProjectId;
                UserObjectDao.SetUserParameter(SS.I.UserName, "PreferredProject", PreferredProjectId);

                SessionManager.Instance.MainContentsControl.ShowNormal(); // redisplay main tree with new selected project open
            }

            // Save default folder info in local preferences

            string folder = DefaultFolder.Text;

            if (folder.EndsWith(@"\") && !folder.EndsWith(@":\"))
            {
                folder = folder.Substring(0, folder.Length - 1);
            }

            if (!System.IO.Directory.Exists(folder))
            {
                XtraMessageBox.Show("Folder does not exist: " + folder, UmlautMobius.String,
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                DefaultFolder.Focus();
                return;
            }

            ClientDirs.DefaultMobiusUserDocumentsFolder = folder;
            Preferences.Set("DefaultExportFolder", folder); // also persist

            if (ZoomChanged)
            {
                Preferences.Set("TableColumnZoom", SS.I.TableColumnZoom);
                Preferences.Set("GraphicsColumnZoom", SS.I.GraphicsColumnZoom);
            }

            SS.I.ScrollGridByPixel = ScrollGridByPixel.Checked; // set selected value
            if (SS.I.ScrollGridByPixel != InitialScrollGridByPixel)
            {
                Preferences.Set("ScrollGridByPixel", SS.I.ScrollGridByPixel);
            }

            SaveLookAndFeel();

            if (FindRelatedCpdsInQuickSearch.Checked != SS.I.FindRelatedCpdsInQuickSearch)
            {
                SS.I.FindRelatedCpdsInQuickSearch = !SS.I.FindRelatedCpdsInQuickSearch;
                Preferences.Set("FindRelatedCpdsInQuickSearch", SS.I.FindRelatedCpdsInQuickSearch);
            }

            if (RestoreWindowsAtStartup.Checked != SS.I.RestoreWindowsAtStartup)
            {
                SS.I.RestoreWindowsAtStartup = !SS.I.RestoreWindowsAtStartup;
                Preferences.Set("RestoreWindowsAtStartup", SS.I.RestoreWindowsAtStartup);
            }

            Hide(); // must explicitly hide since closing event is cancelled
        }
示例#5
0
        public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder alter_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.AlterDatabaseFolderName,false,false);
            MigrationsFolder run_after_create_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.RunAfterCreateDatabaseFolderName,true,false);
            MigrationsFolder up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.UpFolderName, true, false);
            MigrationsFolder down_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                       configuration_property_holder.DownFolderName, true, false);
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.RunFirstAfterUpFolderName, false, false);
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.FunctionsFolderName, false, false);
            MigrationsFolder views_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                        configuration_property_holder.ViewsFolderName, false, false);
            MigrationsFolder sprocs_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.SprocsFolderName, false, false);
            MigrationsFolder indexes_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.IndexesFolderName, false, false);

            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false);

            MigrationsFolder permissions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                              configuration_property_holder.PermissionsFolderName, false, true);
            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   configuration_property_holder.DatabaseName,
                                                                                                   configuration_property_holder.ServerName),
                                                          get_run_date_time_string());

            return new DefaultKnownFolders(alter_database_folder, run_after_create_database_folder,up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder, indexes_folder,
                runAfterOtherAnyTimeScripts_folder, permissions_folder, change_drop_folder);
        }
        public void Setup()
        {
            Add(_stack = new ScreenStack
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Both,
                Size             = new Vector2(0.8f),
            });

            if (!File.Exists(path))
            {
                _ = new DefaultFolder();
            }

            for (int i = 0; i < 4; i++)
            {
                Enum.TryParse(gameini.Get <string>((SettingsConfig)i), out Key key);
                keys[i] = key;
            }

            AddStep("GameplayScreen", AddGameplayScreen);
            AddStep("AddRemoveGameplayScreen", AddRemoveGameplayScreen);
            AddStep("Fail", Fail);
            AddStep("Remove GameplayScreen", () =>
            {
                _gameplayScreen?.track?.Stop();
                _gameplayScreen?.Expire();
            });
        }
示例#7
0
 private NSOutlook.MAPIFolder GetDefaultFolderObj(DefaultFolder folder)
 {
     try
     {
         return((NSOutlook.Folder)_item.GetDefaultFolder((NSOutlook.OlDefaultFolders)(int) folder));
     }
     catch (Exception)
     {
         return(null);
     }
 }
示例#8
0
 public string GetDefaultFolderId(DefaultFolder folder)
 {
     NSOutlook.MAPIFolder mapiFolder = GetDefaultFolderObj(folder);
     try
     {
         return(mapiFolder?.EntryID);
     }
     finally
     {
         ComRelease.Release(mapiFolder);
     }
 }
示例#9
0
 private static void DownloadImageWDefaultFolder(WebClient webClient, string url)
 {
     if (Validator.IsValidDefaultFolder())
     {
         webClient.DownloadFile(new Uri(url), DefaultFolder.GetDefaultPath() + @"\" + GenerateRandomName.Generate() + ".jpeg");
         return;
     }
     else
     {
         Console.WriteLine("You still doesn't configured a default folder path. Try '" + Strings.SETPATH + "'!");
     }
 }
示例#10
0
    public static void SetURLPath()
    {
userChoice:

        Console.WriteLine(Prints.Blank());

        Console.Write(Strings.PATH + " " + Prints.Arrow());
        string path = Console.ReadLine();

        if (!Validator.IsValidDefaultPathRequest(path))
        {
            Prints.InvalidDefaultPath();

            goto userChoice;
        }

        DefaultFolder.CreateFile(path);

        Prints.Done();
    }
示例#11
0
        protected virtual Action GetAction(int pos)
        {
            Action[] clickAction = new Action[4];

            clickAction[0] = () =>
            {
                if (songSelection != null && songSelection.ValidForPush)
                {
                    this.Push(songSelection);
                }
                else
                {
                    LoadComponentAsync(songSelection = new Selection(), this.Push);
                }
            };

            clickAction[1] = () =>
            {
                cachedMap.Stop();
                this.Push(new Settings());
            };

            clickAction[2] = () =>
            {
                string path = $"{Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location)}{Path.DirectorySeparatorChar}Songs{Path.DirectorySeparatorChar}TestMap{Path.DirectorySeparatorChar}Difficulty1.ini";

                if (!File.Exists(path))
                {
                    _ = new DefaultFolder();
                }

                cachedMap.Stop();
                this.Push(new EditorDefault(path));
            };

            clickAction[3] = () => Environment.Exit(0);

            return(clickAction[pos]);
        }
示例#12
0
    //download mp4 and mp3
    private static void DownloadMP4MP3WDefaultFolder(string url, string folder)
    {
        if (!DefaultFolder.DefaultPathExists())
        {
            Console.WriteLine("You still doesn't configured a default folder path. Try '" + Strings.SETPATH + "'!");
            return;
        }

        if (Validator.IsValidDefaultFolder())
        {
            var youtube = YouTube.Default;
            var video   = youtube.GetVideo(url);

            /* When user copy/paste the path, Windows doesn't put the last '\'. Ex.: (C:\Users\User\Documents).
             * So the '\' is added, */
            folder = DefaultFolder.GetDefaultPath() + @"\";

            File.WriteAllBytes(folder + video.FullName, video.GetBytes());

            var MP4Video = new MediaFile
            {
                Filename = folder + video.FullName
            };

            var MP3Audio = new MediaFile
            {
                Filename = folder + video.FullName + ".mp3"
            };

            using (var engine = new Engine())
            {
                engine.GetMetadata(MP4Video);
                engine.Convert(MP4Video, MP3Audio);
            }
        }
    }
示例#13
0
        private void Load()
        {
            AddStep("Add TestEditorDefault", () =>
            {
                if (_stack?.IsAlive ?? false)
                {
                    return;
                }

                Add(_stack = new ScreenStack
                {
                    RelativeSizeAxes = Axes.Both
                });

                string path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + "\\Songs\\TestMap\\Difficulty1.ini";

                if (!File.Exists(path))
                {
                    _ = new DefaultFolder();
                }

                LoadComponentAsync(_editorDefault = new EditorDefault(path)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Scale  = new Vector2(2f),
                    Alpha  = 0f,
                }, _stack.Push);
            });

            AddStep("Remove TestEditorDefault", () =>
            {
                this._editorDefault?.StopTrack();
                this._stack?.Expire();
            });
        }
示例#14
0
 public IFolder GetDefaultFolder(DefaultFolder folder)
 {
     // FolderWrapper manages the returned Folder
     return(GetDefaultFolderObj(folder).Wrap());
 }
示例#15
0
 public FolderRegistrationDefault(Feature feature, DefaultFolder folder)
     :
     base(feature)
 {
     this._folder = folder;
 }
示例#16
0
 // Default path validations;
 public static bool IsValidDefaultFolder()
 {
     return(DefaultFolder.GetDefaultPath().Length > 0);
 }