This project is read-only.

How do I get a subfolder of a folder?

May 22, 2011 at 4:40 PM

How do I get a subfolder of a folder?
For example, I treat all the folders, find a folder. It has the type ICloudDirectoryEntry. How do I get the subfolders?

May 22, 2011 at 10:26 PM
Hi,

if you know the name just use GetChild method, if not enumerate with for each!

Dirk

Sent from my iPhone

On 22.05.2011, at 08:42, jkza <notifications@codeplex.com> wrote:

From: jkza

How do I get a subfolder of a folder?
For example, I treat all the folders, find a folder. It has the type ICloudDirectoryEntry. How do I get the subfolders?

May 23, 2011 at 7:27 AM

Hi,

I am sorry, maybe my question is incorrect.

I mean that: In your example code you do this:

 

foreach (ICloudFileSystemEntry fsentry in root)
{
    if (fsentry is ICloudDirectoryEntry)
    {
        Console.WriteLine("Found Directory: {0}", fsentry.Name);
    }
    else
    {
        Console.WriteLine("Found File: {0}", fsentry.Name);
    }
}

But if I want to get all child in fsentry what I should do? fsentry has ICloudFileSystemEntry type and do not have getChild() method. 

 

May 29, 2011 at 10:53 AM
Hi,

oh ok that's easy:

Check if your fsentry implements ICloudDirectoryEntry with

if (fsentry is ICloudDirectoryEntry)
(fsentry as ICloudDirectoryEntry).GetChild(xxxx)

Cheers
Dirk


2011/5/23 jkza <notifications@codeplex.com>

From: jkza

Hi,

I am sorry, maybe my question is incorrect.

I mean that: In your example code you do this:

foreach (ICloudFileSystemEntry fsentry in root)
{
    if (fsentry is ICloudDirectoryEntry)
    {
        Console.WriteLine("Found Directory: {0}", fsentry.Name);
    }
    else
    {
        Console.WriteLine("Found File: {0}", fsentry.Name);
    }
}

But if I want to get all child in fsentry what I should do? fsentry has ICloudFileSystemEntry type and do not have getChild() method.

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Nov 10, 2011 at 8:44 PM
Edited Nov 11, 2011 at 12:05 PM

Dirk,

By your comments, as HasChildrens is on nChildState.HasNotEvaluated, we should issue a GetChild() to enumerate the children if they exist. Would be possible to have a way to update the status of HasChildrens and Count ?

The way I'm doing now is to execute GetChild(currentFolder.Name, currentFolder.Parent) which sounds like a "Refresh" on the currentFolder - is that right?

Thanks for the excelent work.

Regards,

md

 

UPDATE: Forget it Dirk, I just noticed the GetEnumerator() which allows us to simply use a foreach on the currentFolder and get all children below it! Nevertheless, the above call is wrong as GetChild() does not have the above parameters, but GetFolder() has.

Nov 14, 2011 at 7:29 PM
Hi,

yeah that is right because in DropBox no other way is possible. If we would offer a refresh api it would als do the same :-)

Cheers
Dirk


2011/11/10 mdrewanz <notifications@codeplex.com>

From: mdrewanz

Dirk,

By your comments, as HasChildrens is on nChildState.HasNotEvaluated, we should issue a GetChild() to enumerate the children if they exist. Would be possible to have a way to update the status of HasChildrens and Count ?

The way I'm doing now is to execute GetChild(currentFolder.Name, currentFolder.Parent) which sounds like a "Refresh" on the currentFolder - is that right?

Thanks for the excelent work.

Regards,

md

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com