Class ResourceTypes

Definition

Namespace:
Tizen.Network.IoTConnectivity
Assembly:
Tizen.Network.IoTConnectivity.dll

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

C#
Copy
public class ResourceTypes : IEnumerable<string>, IEnumerable, IDisposable
Inheritance
object
ResourceTypes
Implements
System.Collections.Generic.IEnumerable<T><string>
System.Collections.IEnumerable
System.IDisposable

Constructors

View Source

ResourceTypes()

Constructor of ResourceTypes.

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

Thrown when the iotcon is not supported.

System.OutOfMemoryException

Thrown when there is not enough memory.

View Source

ResourceTypes(IEnumerable<string>)

Constructor of ResourceTypes using list of types.

Declaration
C#
Copy
public ResourceTypes(IEnumerable<string> types)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T><string> types

List of resource types.

Examples
Copy
ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
Exceptions
Type Condition
System.ArgumentException

Thrown when there is an invalid parameter.

Properties

View Source

Count

Indicates count of types in the list.

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

Count of types in the list.

Examples
Copy
ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); Console.WriteLine("There are {0} items", types.Count);

Methods

View Source

Add(string)

Adds a resource type into the list.

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

The string data to insert into the resource types.

Remarks

The length of item should be less than or equal to 61.

The item must start with a lowercase alphabetic character, followed by a sequence of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.

Duplicate strings are not allowed.

Examples
Copy
ResourceTypes resourceTypes = new ResourceTypes(); resourceTypes.Add("org.tizen.light");
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
View Source

Dispose()

Releases any unmanaged resources used by this object.

Declaration
C#
Copy
public void Dispose()
View Source

Dispose(bool)

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
bool disposing

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

View Source

~ResourceTypes()

Destructor of the ResourceTypes class.

Declaration
C#
Copy
protected ~ResourceTypes()
View Source

GetEnumerator()

Returns an enumerator for the list of types.

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

The enumerator.

Examples
Copy
ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); foreach(string item in resourceTypes) { Console.WriteLine("Type : {0}", item); }
View Source

Remove(string)

Removes a resource type from the list.

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

The string data to delete from the resource types.

Examples
Copy
ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); resourceTypes.Remove("oic.if.room");
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

Explicit Interface Implementations

View Source

IEnumerable.GetEnumerator()

Returns an enumerator for the list of types.

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

The enumerator.

Examples
Copy
ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); foreach(string item in resourceTypes) { Console.WriteLine("Type : {0}", item); }

Implements

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