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.
public class ResourceTypes : IEnumerable<string>, IEnumerable, IDisposable
- Inheritance
-
ResourceTypes
- Implements
Constructors
View SourceResourceTypes()
Constructor of ResourceTypes.
Declaration
public ResourceTypes()
Examples
ResourceTypes types = new ResourceTypes();
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the iotcon is not supported. |
OutOfMemoryException | Thrown when there is not enough memory. |
See Also
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View SourceResourceTypes(IEnumerable<String>)
Constructor of ResourceTypes using list of types.
Declaration
public ResourceTypes(IEnumerable<string> types)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | types | List of resource types. |
Examples
ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when there is an invalid parameter. |
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Properties
View SourceCount
Indicates count of types in the list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 | Count of types in the list. |
Examples
ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
Console.WriteLine("There are {0} items", types.Count);
API Level: 3
Methods
View SourceAdd(String)
Adds a resource type into the list.
Declaration
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
ResourceTypes resourceTypes = new ResourceTypes();
resourceTypes.Add("org.tizen.light");
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the iotcon is not supported. |
ArgumentException | Thrown when there is an invalid parameter. |
InvalidOperationException | Thrown when the operation is invalid. |
See Also
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View SourceDispose()
Releases any unmanaged resources used by this object.
Declaration
public void Dispose()
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
View SourceDispose(Boolean)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
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 SourceFinalize()
Destructor of the ResourceTypes class.
Declaration
protected void Finalize()
GetEnumerator()
Returns an enumerator for the list of types.
Declaration
public IEnumerator<string> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<String> | The enumerator. |
Examples
ResourceTypes 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
View SourceRemove(String)
Removes a resource type from the list.
Declaration
public void Remove(string item)
Parameters
Type | Name | Description |
---|---|---|
String | item | The string data to delete from the resource types. |
Examples
ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
resourceTypes.Remove("oic.if.room");
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the iotcon is not supported. |
ArgumentException | Thrown when there is an invalid parameter. |
InvalidOperationException | Thrown when the operation is invalid. |
See Also
API Level: 3
Feature: http://tizen.org/feature/iot.ocf
Explicit Interface Implementations
View SourceIEnumerable.GetEnumerator()
Returns an enumerator for the list of types.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | The enumerator. |
Examples
ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
foreach(string item in resourceTypes)
{
Console.WriteLine("Type : {0}", item);
}