private void ShowFileDialog(PackagePathEventArgs e)
        {
            OnRequestShowFileDialog(this, e);

            if (e.Cancel == false && RootLocations.Contains(e.Path))
                e.Cancel = true;
        }
        internal bool IsPathCurrentlyDisabled(string path)
        {
            if (setting is IDisablePackageLoadingPreferences disablePrefs)
            {
                //disabled if stdlib disabled and path is stdlib
                if ((disablePrefs.DisableStandardLibrary && path == Resources.PackagePathViewModel_Standard_Library)
                    //or if custompaths disabled and path is custom path
                    || (disablePrefs.DisableCustomPackageLocations && setting.CustomPackageFolders.Contains(path))
                    //or if custompaths disabled and path is known path that is not std.lib - needed because new paths that are not commited
                    //will not be added to customPackagePaths yet.
                    || (disablePrefs.DisableCustomPackageLocations && RootLocations.Contains(path) && path != Resources.PackagePathViewModel_Standard_Library))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        internal bool IsPathCurrentlyDisabled(string path)
        {
            if (!(PreferenceSettings is IDisablePackageLoadingPreferences disablePrefs))
            {
                return(false);
            }
            //disabled if builtinpackages disabled and path is builtinpackages
            if ((disablePrefs.DisableBuiltinPackages && path == Resources.PackagePathViewModel_BuiltInPackages)
                //or if custompaths disabled and path is custom path
                || (disablePrefs.DisableCustomPackageLocations && PreferenceSettings.CustomPackageFolders.Contains(path))
                //or if custompaths disabled and path is known path that is not builtinpackages - needed because new paths that are not committed
                //will not be added to customPackagePaths yet.
                || (disablePrefs.DisableCustomPackageLocations && RootLocations.Contains(path) && path != Resources.PackagePathViewModel_BuiltInPackages))
            {
                return(true);
            }

            return(false);
        }