Example #1
0
 /// <remarks>If the documentation has not been localized, return the English version</remarks>
 private string GetDocumentationUri(ArchiveAccessProtocol item)
 {
     try
     {
         return(item.GetDocumentaionUri(_archivingFileDirectoryName));
     }
     catch (DirectoryNotFoundException)
     {
         return(item.GetDocumentaionUri(GetBaseUriDirectory()));
     }
     catch (FileNotFoundException)
     {
         return(item.GetDocumentaionUri(GetBaseUriDirectory()));
     }
 }
Example #2
0
        /// ------------------------------------------------------------------------------------
        public void Save()
        {
            // SP-875: Project Access field reverting to "None"
            if (!_isLoaded)
            {
                return;
            }

            // check for changes
            var project = Program.CurrentProject;

            // happens during testing
            if (project == null)
            {
                return;
            }

            var changed = (_projectAccess.Text != project.AccessProtocol);

            // check if custom access choices changed
            ArchiveAccessProtocol custom = (ArchiveAccessProtocol)_projectAccess.Items[_projectAccess.Items.Count - 1];

            if (_customAccessChoices.Text != custom.ChoicesToCsv())
            {
                var customs     = AccessProtocols.LoadCustom();
                var firstCustom = customs.First();
                firstCustom.SetChoicesFromCsv(_customAccessChoices.Text);
                _customAccessChoices.Text = firstCustom.ChoicesToCsv();
                AccessProtocols.SaveCustom(customs);
                changed = true;
            }

            if (!changed)
            {
                return;
            }

            // save changes
            project.AccessProtocol = _projectAccess.Text;
            project.Save();
        }