/// <summary>
        /// For the specified <see cref="IFolderSystem"/>, saves customizations of paths and visibility of <see cref="IFolder"/> items in the list.
        /// </summary>
        /// <param name="folderSystem"></param>
        /// <param name="customizedFolders"></param>
        public void SaveUserFoldersCustomizations(IFolderSystem folderSystem, List <IFolder> customizedFolders)
        {
            if (!_transactionPending)
            {
                throw new InvalidOperationException("Must call BeginTransaction() first.");
            }

            var xmlFolderSystem         = FindXmlFolderSystem(folderSystem.Id);
            var replacementFolderSystem = CreateXmlFolderSystem(folderSystem.Id);

            foreach (var folder in customizedFolders)
            {
                var newXmlFolder = CreateXmlFolder(folder);
                replacementFolderSystem.AppendChild(newXmlFolder);
            }

            var folderSystemsNode = GetFolderSystemsNode();

            if (xmlFolderSystem != null)
            {
                xmlFolderSystem.InnerXml = replacementFolderSystem.InnerXml;
            }
            else
            {
                folderSystemsNode.AppendChild(replacementFolderSystem);
            }
        }
Esempio n. 2
0
 public static void RegisterFolderSystem(IFolderSystem folderSystem)
 {
     if (!_folderSystems.Contains(folderSystem))
     {
         _folderSystems.Add(folderSystem);
     }
 }
Esempio n. 3
0
 public static void UnregisterFolderSystem(IFolderSystem folderSystem)
 {
     if (_folderSystems.Contains(folderSystem))
     {
         _folderSystems.Remove(folderSystem);
     }
 }
		/// <summary>
		/// Customizes the folders in the specified folder system according to the default and [optionally] user specific settings,
		/// returning the folders in the order specified by customization.
		/// </summary>
		/// <param name="folderSystem"></param>
		/// <param name="includeUserCustomizations"></param>
		public IEnumerable<IFolder> ApplyFolderCustomizations(IFolderSystem folderSystem, bool includeUserCustomizations)
		{
			var folders = _defaultConfig.ApplyFolderCustomizations(folderSystem.Id, folderSystem.Folders);
			return includeUserCustomizations
				? _userConfig.ApplyFolderCustomizations(folderSystem.Id, folders)
				: folders;
		}
        /// <summary>
        /// Customizes the folders in the specified folder system according to the default and [optionally] user specific settings,
        /// returning the folders in the order specified by customization.
        /// </summary>
        /// <param name="folderSystem"></param>
        /// <param name="includeUserCustomizations"></param>
        public IEnumerable <IFolder> ApplyFolderCustomizations(IFolderSystem folderSystem, bool includeUserCustomizations)
        {
            var folders = _defaultConfig.ApplyFolderCustomizations(folderSystem.Id, folderSystem.Folders);

            return(includeUserCustomizations
                                ? _userConfig.ApplyFolderCustomizations(folderSystem.Id, folders)
                                : folders);
        }
        public void RemoveUserFoldersCustomizations(IFolderSystem folderSystem)
        {
            var xmlFolderSystem = FindXmlFolderSystem(folderSystem.Id);

            if (xmlFolderSystem != null)
            {
                this.GetFolderSystemsNode().ReplaceChild(CreateXmlFolderSystem(folderSystem.Id), xmlFolderSystem);
            }
        }
        public bool IsFolderSystemReadOnly(IFolderSystem folderSystem)
        {
            var xmlFolderSystem = FindXmlFolderSystem(folderSystem.Id);

            if (xmlFolderSystem == null)
            {
                return(false);
            }

            var readonlySetting = xmlFolderSystem.GetAttribute("readonly");

            // can edit by default
            if (string.IsNullOrEmpty(readonlySetting))
            {
                return(false);
            }

            return(string.Compare(readonlySetting, "true", true) == 0);
        }
        public static void EnsureProperSearchComponent(IFolderSystem folderSystem)
        {
            Platform.CheckForNullReference(folderSystem, "folderSystem");

            // do nothing if there is no search component open
            if (ActiveSearchComponent == ActiveSearchComponentContext.None)
            {
                return;
            }

            // if the folder system does not support searching, do nothing (the search component shelf will be disabled)
            if (!folderSystem.AdvancedSearchEnabled)
            {
                return;
            }

            // close the open shelf and open the folder system's search component
            if (folderSystem.SearchComponentType != ActiveSearchComponent.Type)
            {
                ActiveSearchComponent.Close();
                folderSystem.LaunchSearchComponent();
            }
        }
		public FolderSystemConfigurationNode(IFolderSystem folderSystem, bool isReadonly)
		{
			_folderSystem = folderSystem;
			_readonly = isReadonly;
		}
Esempio n. 10
0
 internal void SetFolderSystem(IFolderSystem folderSystem)
 {
     _folderSystem = folderSystem;
 }
		public bool IsFolderSystemReadOnly(IFolderSystem folderSystem)
		{
			var xmlFolderSystem = FindXmlFolderSystem(folderSystem.Id);

			if (xmlFolderSystem == null)
				return false;

			var readonlySetting = xmlFolderSystem.GetAttribute("readonly");

			// can edit by default
			if (string.IsNullOrEmpty(readonlySetting))
				return false;

			return string.Compare(readonlySetting, "true", true) == 0;
		}
		public void RemoveUserFoldersCustomizations(IFolderSystem folderSystem)
		{
			var xmlFolderSystem = FindXmlFolderSystem(folderSystem.Id);

			if (xmlFolderSystem != null)
				this.GetFolderSystemsNode().ReplaceChild(CreateXmlFolderSystem(folderSystem.Id), xmlFolderSystem);
		}
		/// <summary>
		/// For the specified <see cref="IFolderSystem"/>, saves customizations of paths and visibility of <see cref="IFolder"/> items in the list.
		/// </summary>
		/// <param name="folderSystem"></param>
		/// <param name="customizedFolders"></param>
		public void SaveUserFoldersCustomizations(IFolderSystem folderSystem, List<IFolder> customizedFolders)
		{
			if (!_transactionPending)
				throw new InvalidOperationException("Must call BeginTransaction() first.");

			var xmlFolderSystem = FindXmlFolderSystem(folderSystem.Id);
			var replacementFolderSystem = CreateXmlFolderSystem(folderSystem.Id);

			foreach (var folder in customizedFolders)
			{
				var newXmlFolder = CreateXmlFolder(folder);
				replacementFolderSystem.AppendChild(newXmlFolder);
			}

			var folderSystemsNode = GetFolderSystemsNode();
			if (xmlFolderSystem != null)
				xmlFolderSystem.InnerXml = replacementFolderSystem.InnerXml;
			else
				folderSystemsNode.AppendChild(replacementFolderSystem);
		}
Esempio n. 14
0
        private StackTabPage FindPage(IFolderSystem folderSystem)
        {
            var explorer = _folderExplorerComponents[folderSystem];

            return(CollectionUtils.SelectFirst(_stackTabComponent.Pages, page => ReferenceEquals(page.Component, explorer)));
        }
 public FolderSystemConfigurationNode(IFolderSystem folderSystem, bool isReadonly)
 {
     _folderSystem = folderSystem;
     _readonly     = isReadonly;
 }
		/// <summary>
		/// Customizes the specified folder, in the specified folder system, according to the default and user specific setting.
		/// </summary>
		/// <param name="folderSystem"></param>
		/// <param name="folder"></param>
		public void ApplyFolderCustomizations(IFolderSystem folderSystem, IFolder folder)
		{
			_defaultConfig.ApplyFolderCustomizations(folderSystem.Id, folder);
			_userConfig.ApplyFolderCustomizations(folderSystem.Id, folder);
		}
Esempio n. 17
0
		internal void SetFolderSystem(IFolderSystem folderSystem)
		{
			_folderSystem = folderSystem;
		}
		public bool IsFolderSystemReadOnly(IFolderSystem folderSystem)
		{
			return _defaultConfig.IsFolderSystemReadOnly(folderSystem);
		}
 /// <summary>
 /// Customizes the specified folder, in the specified folder system, according to the default and user specific setting.
 /// </summary>
 /// <param name="folderSystem"></param>
 /// <param name="folder"></param>
 public void ApplyFolderCustomizations(IFolderSystem folderSystem, IFolder folder)
 {
     _defaultConfig.ApplyFolderCustomizations(folderSystem.Id, folder);
     _userConfig.ApplyFolderCustomizations(folderSystem.Id, folder);
 }
 /// <summary>
 /// Customizes the folders in the specified folder system according to the default and user specific settings,
 /// returning the folders in the order specified by customization.
 /// </summary>
 /// <param name="folderSystem"></param>
 public IEnumerable <IFolder> ApplyFolderCustomizations(IFolderSystem folderSystem)
 {
     return(ApplyFolderCustomizations(folderSystem, true));
 }
 public bool IsFolderSystemReadOnly(IFolderSystem folderSystem)
 {
     return(_defaultConfig.IsFolderSystemReadOnly(folderSystem));
 }
		/// <summary>
		/// Customizes the folders in the specified folder system according to the default and user specific settings,
		/// returning the folders in the order specified by customization.
		/// </summary>
		/// <param name="folderSystem"></param>
		public IEnumerable<IFolder> ApplyFolderCustomizations(IFolderSystem folderSystem)
		{
			return ApplyFolderCustomizations(folderSystem, true);
		}
Esempio n. 23
0
 /// <summary>
 /// Constructor
 /// </summary>
 public FolderExplorerComponent(IFolderSystem folderSystem, FolderExplorerGroupComponent owner)
 {
     _folderTreeRoot = new FolderTreeRoot(this);
     _folderSystem   = folderSystem;
     _owner          = owner;
 }