Class ResourceTypes
Definition
- Namespace:
- Tizen.Network.IoTConnectivity
- Assembly:
- Tizen.Network.IoTConnectivity.dll
- API Level:
- 3
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#Copypublic class ResourceTypes : IEnumerable<string>, IEnumerable, IDisposable
- Inheritance
-
System.ObjectResourceTypes
- Implements
-
System.Collections.Generic.IEnumerable<System.String>System.Collections.IEnumerableSystem.IDisposable
Constructors
Declaration
C#Copypublic ResourceTypes()
Examples
CopyResourceTypes types = new ResourceTypes();
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
Declaration
C#Copypublic ResourceTypes(IEnumerable<string> types)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | types | List of resource types. |
Examples
CopyResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when there is an invalid parameter. |
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Properties
Declaration
C#Copypublic int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | Count of types in the list. |
Examples
CopyResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); Console.WriteLine("There are {0} items", types.Count);
API Level: 3
Methods
Declaration
C#Copypublic void Add(string item)
Parameters
Type | Name | Description |
---|---|---|
System.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
CopyResourceTypes 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
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Declaration
C#Copypublic void Dispose()
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Dispose(Boolean)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.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
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic IEnumerator<string> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.String> | The enumerator. |
Examples
CopyResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); foreach(string item in resourceTypes) { Console.WriteLine("Type : {0}", item); }
API Level: 3
Declaration
C#Copypublic void Remove(string item)
Parameters
Type | Name | Description |
---|---|---|
System.String | item | The string data to delete from the resource types. |
Examples
CopyResourceTypes 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
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Explicit Interface Implementations
Declaration
C#CopyIEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator. |
Examples
CopyResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); foreach(string item in resourceTypes) { Console.WriteLine("Type : {0}", item); }