Esempio n. 1
0
        private void Initialize(MoviestormPaths pMoviestormPaths, List <string> pSources, string pDescription)
        {
            string errorText;

            MoviestormPaths  = pMoviestormPaths ?? AddonPersistenceUtils.GetMoviestormPaths(out errorText);
            AddonSources     = pSources;
            Description      = pDescription;
            CatalogueVersion = CurrentCatalogueVersion;
            LastUpdate       = DateTime.Now;
        }
Esempio n. 2
0
        // ---------------------------------------------------------------------------------------------------

        private void pbPathsDefaults_Click(object sender, EventArgs e)
        {
            string          errorText;
            MoviestormPaths defaultMoviestormPaths = AddonPersistenceUtils.GetMoviestormPaths(out errorText);

            if (defaultMoviestormPaths == null)
            {
                MessageBox.Show(errorText, "Error determining Moviestorm folders", MessageBoxButtons.OK);
                return;
            }

            tbMoviestormInstallPath.Text  = defaultMoviestormPaths.InstallationPath;
            tbMoviestormUserDataPath.Text = defaultMoviestormPaths.UserDataPath;
        }
Esempio n. 3
0
        private static bool InitializationChores(string[] pArgs, out string pErrorText)
        {
            pErrorText = null;
            if (!CheckArguments(pArgs))
            {
                return(false);
            }

            _tempPath = Utils.GetTempDirectory();

            string errorText;

            Utils.ResetTempFolder(out errorText);

            _moviestormPaths = AddonPersistenceUtils.GetMoviestormPaths(out errorText);
            if (_moviestormPaths == null)
            {
                pErrorText = errorText;
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        public AddonSearchCriteria(string pName, string pPublisher, bool?pInstalled, bool?pContentPack,
                                   string pLocation)
        {
            Name       = pName;
            _nameRegex = CreateMultiValuedRegex(Name);

            Publisher       = pPublisher;
            _publisherRegex = CreateMultiValuedRegex(Publisher);

            Installed   = pInstalled;
            ContentPack = pContentPack;
            Location    = pLocation?.Trim().ToLower();
            if (!string.IsNullOrEmpty(Location))
            {
                _locationRegex = new Regex($"{Location}", RegexOptions.IgnoreCase);
            }

            if (ContentPacksPath == null)
            {
                string errorText;
                ContentPacksPath = AddonPersistenceUtils.GetMoviestormPaths(out errorText)?.ContentPacksPath;
            }
        }