public static DocumentViewModel GetDocumentViewModel(IChangeListener parent, Document document = null) { var documentParameterConfig = new Ninject.Parameters.ConstructorArgument("document", document); var parentParameterConfig = new Ninject.Parameters.ConstructorArgument("parent", parent); return(_kernel.Get <DocumentViewModel>(documentParameterConfig, parentParameterConfig)); }
public static PersonViewModel GetPersonViewModel(IChangeListener parent, Person person = null) { var personParameterConfig = new Ninject.Parameters.ConstructorArgument("person", person); var parentParameterConfig = new Ninject.Parameters.ConstructorArgument("parent", parent); return(_kernel.Get <PersonViewModel>(personParameterConfig, parentParameterConfig)); }
public RevertableObservableCollection(IList <T> collection, IChangeListener parent = null) { _parent = parent; _pristineCollection = new ObservableCollection <T>(collection); CopyFromCollection(_pristineCollection); }
public void RemoveChangeListener(IChangeListener aggregatingChangeListener) { lock (_listenersLock) { if (!_listeners.Remove(aggregatingChangeListener)) { return; } if (_listeners.Count == 0) { Disconnect(); } } }
public void AddChangeListener(IChangeListener aggregatingChangeListener) { lock (_listenersLock) { if (!_listeners.Add(aggregatingChangeListener)) { return; } if (_listeners.Count == 1) { Connect(); } } }
public DocumentViewModel(Document document, IChangeListener parent) { if (document == null) { document = new Document(); } _document = document; _parent = parent; CopyFromEntity(document); OpenCommand = new RelayCommand(OpenDocument, CanOpenDocument); }
public PersonViewModel(IMessageDialogService messageDialogService, IDocumentStoreFactory documentStoreFactory, Person person, IChangeListener parent) { if (person == null) { person = new Person(); } _documentStoreFactory = documentStoreFactory; _messageDialogService = messageDialogService; _person = person; _parent = parent; CopyFromEntity(person); AddDocumentCommand = new RelayCommand(AddDocument, CanAddDocument); RemoveDocumentsCommand = new RelayCommand(RemoveDocuments, CanRemoveDocuments); }
internal void InvalidateNode(IChangeListener listener) { if (TransactionActive) { changeListener.Add(listener); } else { var result = listener.AggregateChanges(); if (result == null) { ExecuteSingle(listener.Node); } else if (result.Changed) { listener.Node.ExecutionMetaData.Results.UnsafeAdd(result); ExecuteSingle(listener.Node); } } }
public void RemoveListener(IChangeListener l) { listeners.Remove(l); }
public void AddListener(IChangeListener l) { listeners.Add(l); }
public ChangeListener(IChangeListener changeListener) { this.changeListener = changeListener; }
public RevertableObservableCollection(IChangeListener parent = null) : this(new List <T>(), parent) { }