/// </remarks>
public class ContentFilter : IDisposable
{
- private IntPtr _filterHandle;
+ private IntPtr _filterHandle = IntPtr.Zero;
private bool _disposedValue = false;
private ContentOrder _order = ContentOrder.Asc;
private string _orderKey = "MEDIA_ID";
}
}
/// <summary>
- /// Sets the media filter content order and order keyword.
+ /// Gets the media filter content order and order keyword.
/// </summary>
public ContentOrder Order
{
get
{
- //check If we can create multiple variables in a property itself..
- //Guess.. This might be need to change as method.
int orderType;
string orderKey;
int collatetType;
{
Log.Warn(MediaContentErrorFactory.LogTag, "Failed to GetOrder");
}
- if (orderKey.Length == 0)
- {
- orderKey = _orderKey;
- }
return (ContentOrder)orderType;
}
- set
- {
- //TOD: check if we can convert this as method to club offset and count.
- MediaContentError res;
- res = (MediaContentError)Interop.Filter.SetOrder(_filterHandle, (int)value, this.OrderKey, (int)this.CollationType);
- if (res != MediaContentError.None)
- {
- throw MediaContentErrorFactory.CreateException(res, "Failed to SetOrder");
- }
- }
}
/// <summary>
/// The collate type for comparing two strings
{
//check If we can create multiple variables in a property itself..
//Guess.. This might be need to change as method.
- int orderType;
- string orderKey;
+ string condition;
int collatetType;
MediaContentError res;
- res = (MediaContentError)Interop.Filter.GetOrder(_filterHandle, out orderType, out orderKey, out collatetType);
+ res = (MediaContentError)Interop.Filter.GetCondition(_filterHandle, out condition, out collatetType);
if (res != MediaContentError.None)
{
- Log.Warn(MediaContentErrorFactory.LogTag, "Failed to GetOrder");
+ Log.Warn(MediaContentErrorFactory.LogTag, "Failed to GetCondition for CollationType");
}
return (ContentCollation)collatetType;
}
_collationType = value;
//TOD: check if we can convert this as method to club offset and count.
MediaContentError res;
- res = (MediaContentError)Interop.Filter.SetOrder(_filterHandle, (int)this.Order, this.OrderKey, (int)value);
+ res = (MediaContentError)Interop.Filter.SetCondition(_filterHandle, this.Condition, (int)value);
if (res != MediaContentError.None)
{
- throw MediaContentErrorFactory.CreateException(res, "Failed to SetOrder");
+ throw MediaContentErrorFactory.CreateException(res, "Failed to SetCondition for CollationType");
}
}
}
/// <summary>
- /// Sets the condition for the given filter.
+ /// Gets/Sets the condition for the given filter.
/// </summary>
public string Condition
{
get
{
- //check If we can create multiple variables in a property itself..
- //Guess.. This might be need to change as method.
- string conditionVal;
+ string conditionVal = "";
MediaContentError res;
int collatetType;
res = (MediaContentError)Interop.Filter.GetCondition(_filterHandle, out conditionVal, out collatetType);
{
get
{
- //check If we can create multiple variables in a property itself..
- //Guess.. This might be need to change as method.
int orderType;
string orderKey;
int collatetType;
res = (MediaContentError)Interop.Filter.GetOrder(_filterHandle, out orderType, out orderKey, out collatetType);
if (res != MediaContentError.None)
{
- Log.Warn(MediaContentErrorFactory.LogTag, "Failed to GetOrder");
- }
- if (orderKey.Length == 0)
- {
- orderKey = _orderKey;
+ Log.Warn(MediaContentErrorFactory.LogTag, "Failed to GetOrder for OrderKey");
}
return orderKey;
}
- set
- {
- _orderKey = value;
- //TOD: check if we can convert this as method to club offset and count.
- MediaContentError res;
- res = (MediaContentError)Interop.Filter.SetOrder(_filterHandle, (int)this.Order, value, (int)this.CollationType);
- if (res != MediaContentError.None)
- {
- throw MediaContentErrorFactory.CreateException(res, "Failed to SetOrder");
- }
- }
}
/// <summary>
/// The type of the media group
{
get; set;
}
+ /// <summary>
+ /// SetOrderProperties like OrderType and OrderKey.
+ /// </summary>
+ public void SetOrderProperties(ContentOrder order, string oderKey)
+ {
+ MediaContentError res = (MediaContentError)Interop.Filter.SetOrder(_filterHandle, order, oderKey, CollationType);
+ if (res != MediaContentError.None)
+ {
+ throw MediaContentErrorFactory.CreateException(res, "Failed to SetOrder");
+ }
+ }
+
/// <summary>
/// Dispose API for closing the internal resources.
}
}
}
-}
+}
\ No newline at end of file
/// </summary>
public class MediaFolder : ContentCollection
{
- private IntPtr _folderHandle;
+ private IntPtr _folderHandle = IntPtr.Zero;
private bool _disposedValue = false;
internal IntPtr Handle
{
}
/// <summary>
- /// The folder order info. Get/Set the folder viewing order.
- /// Default Order is ContentOrder.Asc (Ascending order).
+ /// The folder order value. Get/Set the folder viewing order.
+ /// Default Order value is zero.
+ /// If you set the order value for each folder, you can sort in ascending or descending order as the set order values using the filter.
/// </summary>
- public ContentOrder Order
+ public int Order
{
get
{
{
Log.Warn(MediaContentErrorFactory.LogTag, "Failed to get modified date for the MediaFolder");
}
- return (ContentOrder)order;
+ return order;
}
set
{
- MediaContentError res = (MediaContentError)Interop.Folder.SetOrder(_folderHandle, (int)value);
+ MediaContentError res = (MediaContentError)Interop.Folder.SetOrder(_folderHandle, value);
if (res != MediaContentError.None)
{
Log.Warn(MediaContentErrorFactory.LogTag, "Failed to set viewing order for the MediaFolder");