WebDAV .NET Class Library
WebDAV .NET Class Library
WebDAV .NET
Independentsoft.Webdav
Resource Class
Resource Methods
ListWithProperties Method
ListWithProperties Method (PropertyName[])
ListWithProperties Method (String, PropertyName[])
ListWithProperties Method (PropertyName[], Boolean)
ListWithProperties Method (String, PropertyName[], Boolean)

# Resource ListWithProperties Method ( PropertyName , Boolean)

Note: This API is now obsolete.

Displays a list of subresources and their name and properties.

Namespace: Independentsoft.Webdav
Assembly: Independentsoft.Webdav (in Independentsoft.Webdav.dll) Version: 1.0.700.18437
Syntax
C#
VB
Copy

    [ObsoleteAttribute("Will be removed in next version. Use method List.")]
    public string[,] ListWithProperties(
    	PropertyName[] propertyName,
    	bool recursive
    )

    <ObsoleteAttribute("Will be removed in next version. Use method List.")>
    Public Function ListWithProperties (
    	propertyName As PropertyName(),
    	recursive As Boolean
    ) As String(,)

#### Parameters

propertyName
  Type:
  Independentsoft.Webdav
  PropertyName
  Properties to display.
recursive
  Type: System
  Boolean
  If true returns resources in this collection and all subcollections.

#### Return Value

Type:
String
Two-dimension array of strings. The "first dimension" is number of returned resources, and the "secound dimension" is number of requested properties plus one.
Remarks
This method returns names and requested properties values of subresources in collection.
Examples
The following example shows how to call the ListWithProperties method.
Copy

     using System;
     using Independentsoft.Webdav;

     class List
     {
        [STAThread]
        static void Main(string[] args)
        {
            Resource resource = new Resource("http://localhost/dav");

            //Creates requested property names.
            PropertyName propertyName1 = new PropertyName("getcontentlength","DAV:");
            PropertyName propertyName2 = new PropertyName("resourcetype","DAV:");
            PropertyName propertyName3 = new PropertyName("getlastmodified","DAV:");

            PropertyName[] attributes = new PropertyName[3];

            attributes[0] = propertyName1;
            attributes[1] = propertyName2;
            attributes[2] = propertyName3;

            //Calls the method.
            string[,] list = resource.ListWithProperties(attributes);

            for(int i=0;i list.GetLength(0);i++)
            {
                string name = list[i,0];
                string size = list[i,1];
                string type = list[i,2];
                string date = list[i,3];

                Console.WriteLine(name + " " + size + " " + type + " " + date);
            }

            //Wait for "return" to exit.
            Console.Read();
        }
    }

See Also

#### Reference

Resource Class
ListWithProperties Overload
Independentsoft.Webdav Namespace

Copyright 2022 Independentsoft

Send comments on this topic to support@independentsoft.de