using GSF.TimeSeries.UI.DataModels;namespace GSF.TimeSeries.UI.ViewModels{ /// <summary> /// Class to hold bindable <see cref="SecurityGroup"/> collection. /// </summary> internal class Protocols : PagedViewModelBase<Protocol, int> { #region [ Constructors ] /// <summary> /// Creates an instance of <see cref="Protocols"/> class. /// </summary> /// <param name="itemsPerPage">Integer value to determine number of items per page.</param> /// <param name="autoSave">Boolean value to determine is user changes should be saved automatically.</param> public Protocols(int itemsPerPage, bool autoSave = true) : base(itemsPerPage, autoSave) { } #endregion #region [ Properties ] /// <summary> /// Gets flag that determines if <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/> is a new record. /// </summary> public override bool IsNewRecord { get { return CurrentItem.ID == 0; } } #endregion #region [ Methods ] /// <summary> /// Gets the primary key value of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>. /// </summary> /// <returns>The primary key value of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.</returns> public override int GetCurrentItemKey() { return CurrentItem.ID; } /// <summary> /// Gets the string based named identifier of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>. /// </summary> /// <returns>The string based named identifier of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.</returns> public override string GetCurrentItemName() { return CurrentItem.Name; } /// <summary> /// Creates a new instance of <see cref="Protocols"/> and assigns it to CurrentItem. /// </summary> public override void Clear() { base.Clear(); CurrentItem = ItemsSource[0]; } #endregion }}
using GSF.TimeSeries.UI.DataModels;
namespace GSF.TimeSeries.UI.ViewModels
{
/// <summary>
/// Class to hold bindable <see cref="SecurityGroup"/> collection.
/// </summary>
internal class Protocols : PagedViewModelBase<Protocol, int>
{
#region [ Constructors ]
/// <summary>
/// Creates an instance of <see cref="Protocols"/> class.
/// </summary>
/// <param name="itemsPerPage">Integer value to determine number of items per page.</param>
/// <param name="autoSave">Boolean value to determine is user changes should be saved automatically.</param>
public Protocols(int itemsPerPage, bool autoSave = true)
: base(itemsPerPage, autoSave)
{
}
#endregion
#region [ Properties ]
/// <summary>
/// Gets flag that determines if <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/> is a new record.
/// </summary>
public override bool IsNewRecord
{
get
{
return CurrentItem.ID == 0;
}
}
#endregion
#region [ Methods ]
/// <summary>
/// Gets the primary key value of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.
/// </summary>
/// <returns>The primary key value of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.</returns>
public override int GetCurrentItemKey()
{
return CurrentItem.ID;
}
/// <summary>
/// Gets the string based named identifier of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.
/// </summary>
/// <returns>The string based named identifier of the <see cref="PagedViewModelBase{T1, T2}.CurrentItem"/>.</returns>
public override string GetCurrentItemName()
{
return CurrentItem.Name;
}
/// <summary>
/// Creates a new instance of <see cref="Protocols"/> and assigns it to CurrentItem.
/// </summary>
public override void Clear()
{
base.Clear();
CurrentItem = ItemsSource[0];
}
#endregion
}
}