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