Ejemplo n.º 1
0
        public static Search SearchForAllFolders()
        {
            Query          query    = new Query(new QueryScope(ObjectTypes.Folder), null);
            FolderGrouping grouping = new FolderGrouping((Grouping)null);
            Sort           sort     = new Sort("name", true);

            Sort[] sorts = { sort };
            return(new Search(query, grouping, false, "", "", null, sorts));
        }
Ejemplo n.º 2
0
        public static Search SearchForFolder(string path)
        {
            QueryScope  scope       = new QueryScope(ObjectTypes.AllIncFolders);
            QueryFilter innerFilter = new StringPropertyQuery(PropertyNames.uuid, path,
                                                              StringPropertyQuery.PropertyQueryType.exactmatch, true);
            QueryFilter filter   = new RecursiveXMOPropertyQuery <Folder>(PropertyNames.folder, innerFilter);
            Query       q        = new Query(scope, filter);
            Grouping    grouping = new FolderGrouping((Grouping)null);

            string[] pathParts = Folders.PointToPath(path);
            string   name      = ((pathParts.Length == 0 || (pathParts.Length == 1 && pathParts[pathParts.Length - 1] == String.Empty)) ?
                                  Messages.FOLDERS : pathParts[pathParts.Length - 1]);

            return(new Search(q, grouping, false, name, null, false));
        }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            FolderGrouping other = obj as FolderGrouping;

            return(other != null); // All folder groupings are the same!
        }