Example #1
0
        // find by root folder path
        public SavedFolderProject FindFolderProjectByRootFolder(FilePath <FileNameSimple> current,
                                                                SavedFolderType folderType)
        {
            if (current == null || current == FilePath <FileNameSimple> .Invalid)
            {
                return(null);
            }

            string testKey = current.AssemblePath(1).ToUpper();

            foreach (SavedFolderProject sf in UserSettings.Data.SavedFolders[(int)folderType])
            {
                if (sf == null)
                {
                    continue;
                }

                foreach (SavedFolderPair pair in sf.SavedFolderPairs)
                {
                    if (pair.Current == null)
                    {
                        continue;
                    }

                    string rootPath = pair.Current.AssemblePath(1);

                    // got it?  return it.
                    if (rootPath.ToUpper().Equals(testKey))
                    {
                        return(sf);
                    }
                }
            }

            // nothing found
            return(null);
        }