init
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using DataPROWin7.Common;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using DTS.Common.ISO;
|
||||
using DTS.Common.DataModel;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace DataPROWin7.DataModel
|
||||
{
|
||||
/// <summary>
|
||||
/// list that holds groups
|
||||
/// </summary>
|
||||
public class TestObjectList : BasePropertyChanged
|
||||
{
|
||||
#region Tags and Constants
|
||||
public enum Tags
|
||||
{
|
||||
TestObjects
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
private static readonly object MyLock = new object();
|
||||
private static TestObjectList _testObjectList;
|
||||
|
||||
public static TestObjectList TestObjectsList
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (MyLock)
|
||||
{
|
||||
if (null == _testObjectList)
|
||||
{
|
||||
_testObjectList = new TestObjectList();
|
||||
}
|
||||
}
|
||||
return _testObjectList;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// adds a group
|
||||
/// will notify listeners if bNotify is true
|
||||
/// you would not want to notify listeners if you are in a bulk
|
||||
/// operation and intend to refresh everyone when done
|
||||
/// </summary>
|
||||
/// <param name="to"></param>
|
||||
/// <param name="bNotify"></param>
|
||||
public void Add(TestObject to, bool bNotify)
|
||||
{
|
||||
to.LastModifiedBy = ApplicationProperties.CurrentUser.UserName;
|
||||
to.SetLastModified(DateTime.Now);
|
||||
to.Commit();
|
||||
if (bNotify)
|
||||
{
|
||||
OnPropertyChanged("TestObjects");
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateAll()
|
||||
{
|
||||
OnPropertyChanged("TestObjects");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected TestObjectList()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user