Class ResourceInterfaces

Definition

Namespace:
Tizen.Network.IoTConnectivity
Assembly:
Tizen.Network.IoTConnectivity.dll
API Level:
3

This class contains resource interfaces and provides APIs to manage, add, or remove those interfaces. A resource interface indicates a class or category of resources.

C#
Copy
public class ResourceInterfaces : IEnumerable<string>, IEnumerable, IDisposable
Inheritance
System.Object
ResourceInterfaces
Implements
System.Collections.Generic.IEnumerable<System.String>
System.IDisposable

Constructors

View Source

ResourceInterfaces()

Constructor of ResourceInterfaces.

Declaration
C#
Copy
public ResourceInterfaces()
Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
Exceptions
Type Condition
System.NotSupportedException

Thrown when the iotcon is not supported.

OutOfMemoryException

Thrown when there is not enough memory.

API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View Source

ResourceInterfaces(IEnumerable<String>)

Constructor of ResourceInterfaces using list of interfaces.

Declaration
C#
Copy
public ResourceInterfaces(IEnumerable<string> ifaces)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> ifaces

List of resource interfaces.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
Exceptions
Type Condition
System.NotSupportedException

Thrown when the iotcon is not supported.

OutOfMemoryException

Thrown when there is not enough memory.

System.ArgumentException

Thrown when there is an invalid parameter.

API Level: 3
Feature: http://tizen.org/feature/iot.ocf

Fields

View Source

BatchInterface

Batch Interface, which is used to manipulate (GET, PUT, POST, DELETE) on other resource contained in a resource.

Declaration
C#
Copy
public const string BatchInterface = "oic.if.b"
Field Value
Type Description
System.String
API Level: 3
View Source

DefaultInterface

Default Interface.

Declaration
C#
Copy
public const string DefaultInterface = "oic.if.baseline"
Field Value
Type Description
System.String
API Level: 3
View Source

GroupInterface

Group Interface, which is used to manipulate (GET, PUT, POST) a group of remote resources.

Declaration
C#
Copy
public const string GroupInterface = "oic.mi.grp"
Field Value
Type Description
System.String
API Level: 3
View Source

LinkInterface

List Links Interface, which is used to list the references to other resources contained in a resource.

Declaration
C#
Copy
public const string LinkInterface = "oic.if.ll"
Field Value
Type Description
System.String
API Level: 3
View Source

ReadonlyInterface

Read-Only Interface, which is used to limit the methods that can be applied to a resource to GET only.

Declaration
C#
Copy
public const string ReadonlyInterface = "oic.if.r"
Field Value
Type Description
System.String
API Level: 3

Properties

View Source

Count

Indicates count of interfaces in the list

Declaration
C#
Copy
public int Count { get; }
Property Value
Type Description
Int32

Count of interfaces in the list.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count);
API Level: 3

Methods

View Source

Add(String)

Adds a resource interface into the list.

Declaration
C#
Copy
public void Add(string item)
Parameters
Type Name Description
System.String item

The string data to insert into the resource interfaces.

Remarks

item could be a value, such as DefaultInterface.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(); resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
Exceptions
Type Condition
System.NotSupportedException

Thrown when the iotcon is not supported.

System.InvalidOperationException

Thrown when the operation is invalid.

System.ArgumentException

Thrown when there is an invalid parameter.

See Also
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View Source

Dispose()

Releases any unmanaged resources used by this object.

Declaration
C#
Copy
public void Dispose()
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View Source

Dispose(Boolean)

Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

If true, disposes any disposable objects. If false, does not dispose disposable objects.

API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View Source

Finalize()

Destructor of the ResourceInterfaces class.

Declaration
C#
Copy
protected void Finalize()
View Source

GetEnumerator()

Returns enumerator for the list of interfaces.

Declaration
C#
Copy
public IEnumerator<string> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.String>

The enumerator.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); foreach(string item in resourceInterfaces) { Console.WriteLine("Interface : {0}", item); }
API Level: 3
View Source

Remove(String)

Removes a resource interface from the list.

Declaration
C#
Copy
public void Remove(string item)
Parameters
Type Name Description
System.String item

The string data to delete from the resource ifaces.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface }); resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
Exceptions
Type Condition
System.NotSupportedException

Thrown when the iotcon is not supported.

System.ArgumentException

Thrown when there is an invalid parameter.

System.InvalidOperationException

Thrown when the operation is invalid.

See Also
API Level: 3
Feature: http://tizen.org/feature/iot.ocf

Explicit Interface Implementations

View Source

IEnumerable.GetEnumerator()

Returns enumerator for the list of interfaces.

Declaration
C#
Copy
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

The enumerator.

Examples
Copy
ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); foreach(string item in resourceInterfaces) { Console.WriteLine("Interface : {0}", item); }
API Level: 3

Implements

System.Collections.Generic.IEnumerable<T>
System.IDisposable