/// <summary>Initializes a new instance of the <see cref="EmployeeViewModel"/> class.</summary> /// <param name="vm">The view parameter.</param> /// <param name="employee">The Employee object.</param> public EmployeeViewModel(ViewModel vm, Employee employee = null) { this.viewModel = vm; this.Employee = new Employee(); this.IsCreatingNewEmployee = vm.IsEditModeOff; this.TargetObjectType = employee?.JobTitle; if (employee != null) { if (employee is Physician) { this.Employee = this.Physician = new Physician((Physician)employee); this.EmployeeBackup = DataDispatcher.CloneBySerialization <Physician>(employee as Physician); } else if (employee is Nurse) { this.Employee = this.Nurse = new Nurse((Nurse)employee); this.EmployeeBackup = DataDispatcher.CloneBySerialization <Nurse>(employee as Nurse); } else { this.Employee = new Employee(employee); this.EmployeeBackup = DataDispatcher.CloneBySerialization <Employee>(employee); } } }
internal FavoritesBatchActions(Favorites favorites, EntitiesCache <DbFavorite> cache, IPersistence persistence) : base(persistence) { this.favorites = favorites; this.cache = cache; this.dispatcher = persistence.Dispatcher; }
internal Favorites(FilePersistence persistence) { this.persistence = persistence; this.dispatcher = persistence.Dispatcher; this.groups = this.persistence.GroupsStore; this.cache = new Dictionary<Guid,IFavorite>(); }
private void RegisterEventHandlers() { DataDispatcher dispatcher = this.persistence.Dispatcher; dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnDataChanged); dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnDataChanged); settings.ConfigurationChanged += new ConfigurationChangedHandler(this.OnSettingsConfigurationChanged); }
internal Factory(Groups groups, Favorites favorites, StoredCredentials credentials, PersistenceSecurity persistenceSecurity, DataDispatcher dispatcher) { this.groups = groups; this.favorites = favorites; this.credentials = credentials; this.persistenceSecurity = persistenceSecurity; this.dispatcher = dispatcher; }
internal Factory(Groups groups, Favorites favorites, StoredCredentials credentials, DataDispatcher dispatcher, ConnectionManager connectionManager) { this.groups = groups; this.favorites = favorites; this.credentials = credentials; this.dispatcher = dispatcher; this.connectionManager = connectionManager; }
internal Favorites(SqlPersistence persistence, Groups groups, StoredCredentials credentials, ConnectionManager connectionManager, FavoriteIcons favoriteIcons) { this.groups = groups; this.credentials = credentials; this.dispatcher = persistence.Dispatcher; this.connectionManager = connectionManager; this.favoriteIcons = new DbFavoriteImagesStore(this.dispatcher, favoriteIcons); this.batchActions = new FavoritesBatchActions(this, this.cache, persistence); }
private List <IFavorite> MergeWithNewTodays(SortableList <IFavorite> oldTodays) { List <IFavorite> newTodays = this.GetDateItems(HistoryIntervals.TODAY); if (oldTodays != null) { newTodays = DataDispatcher.GetMissingFavorites(newTodays, oldTodays); } return(newTodays); }
private List <FavoriteConfigurationElement> MergeWithNewTodays( SortableList <FavoriteConfigurationElement> oldTodays) { List <FavoriteConfigurationElement> newTodays = this.GetDateItems(HistoryByFavorite.TODAY); if (oldTodays != null) { newTodays = DataDispatcher.GetMissingFavorites(newTodays, oldTodays); } return(newTodays); }
internal static DbFavorite CreateFavorite(PersistenceSecurity persistenceSecurity, Groups groups, StoredCredentials credentials, DataDispatcher dispatcher) { var favorite = new DbFavorite(); favorite.Display = new DbDisplayOptions(); favorite.Security = new DbSecurityOptions(); favorite.ExecuteBeforeConnect = new DbBeforeConnectExecute(); favorite.AssignStores(groups, credentials, persistenceSecurity, dispatcher); favorite.MarkAsNewlyCreated(); return favorite; }
internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence) { this.treeList = treeListToFill; this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand); this.persistedGroups = persistence.Groups; this.favorites = persistence.Favorites; this.dispatcher = persistence.Dispatcher; this.dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged); this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged); }
/// <summary> /// Does not set the protocol options. /// </summary> internal static DbFavorite CreateFavorite(Groups groups, StoredCredentials credentials, DataDispatcher dispatcher) { var favorite = new DbFavorite(); favorite.Display = new DbDisplayOptions(); favorite.Security = new DbSecurityOptions(); favorite.ExecuteBeforeConnect = new DbBeforeConnectExecute(); favorite.AssignStores(groups, credentials, dispatcher); favorite.MarkAsNewlyCreated(); return(favorite); }
internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence, FavoriteIcons favoriteIcons) { this.treeList = treeListToFill; this.favoriteIcons = favoriteIcons; this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand); this.toolTipBuilder = new ToolTipBuilder(persistence.Security); this.persistedGroups = persistence.Groups; this.favorites = persistence.Favorites; this.dispatcher = persistence.Dispatcher; this.dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged); this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged); }
public StoredCredentials(SqlPersistenceSecurity persistenceSecurity, DataDispatcher dispatcher) { this.persistenceSecurity = persistenceSecurity; this.dispatcher = dispatcher; }
public StoredCredentials(DataDispatcher dispatcher) { this.dispatcher = dispatcher; }
internal Factory(Groups groups, DataDispatcher dispatcher, ConnectionManager connectionManager) { this.groups = groups; this.dispatcher = dispatcher; this.connectionManager = connectionManager; }
internal static void RegisterDataEventHandler(DataDispatcher dispatcher) { dispatcher.ErrorOccurred += new EventHandler<DataErrorEventArgs>(DataErrorOccured); }
internal ConnectionHistory(Favorites favorites, DataDispatcher dispatcher) { this.favorites = favorites; this.dispatcher = dispatcher; }
internal DbFavoriteImagesStore(DataDispatcher dispatcher, FavoriteIcons favoriteIcons) { this.dispatcher = dispatcher; this.favoriteIcons = favoriteIcons; }
public void AssignStores(DataDispatcher dispatcher, Favorites favorites) { this.dispatcher = dispatcher; this.favorites = favorites; }
internal FavoritesBatchActions(Favorites favorites, EntitiesCache<DbFavorite> cache, DataDispatcher dispatcher) { this.favorites = favorites; this.cache = cache; this.dispatcher = dispatcher; }
internal void AssignStores(Groups groups, StoredCredentials credentials, DataDispatcher dispatcher) { this.groups = groups; this.credentials = credentials; this.Details.Dispatcher = dispatcher; }
internal Groups(FilePersistence persistence) { this.persistence = persistence; this.dispatcher = persistence.Dispatcher; this.cache = new Dictionary<Guid,IGroup>(); }
internal void AssignStores(Groups groups, DataDispatcher dispatcher, Favorites favorites) { this.groups = groups; this.dispatcher = dispatcher; this.favorites = favorites; }
internal Factory(PersistenceSecurity persistenceSecurity, Groups groups, DataDispatcher dispatcher) { this.groups = groups; this.dispatcher = dispatcher; this.persistenceSecurity = persistenceSecurity; }
internal static void RegisterDataEventHandler(DataDispatcher dispatcher) { dispatcher.ErrorOccurred += new EventHandler <DataErrorEventArgs>(DataErrorOccured); }