/// <summary> /// Initializes a new instance of the <see cref="Tracker{TValue}"/> class. /// </summary> /// <param name="source">The <see cref="IChanges{TValue}"/>.</param> protected Tracker(IChanges <TValue> source) { this.source = source ?? throw new ArgumentNullException(nameof(source)); source.Add += this.OnAdd; source.Remove += this.OnRemove; source.Reset += this.OnReset; }
/// <summary> /// Initializes a new instance of the <see cref="Tracker{TValue}"/> class. /// </summary> protected Tracker(IChanges <TValue> source) { Ensure.NotNull(source, nameof(source)); this.source = source; source.Add += this.OnAdd; source.Remove += this.OnRemove; source.Reset += this.OnReset; }
/// <summary> /// Initializes a new instance of the <see cref="MinMaxTracker{TValue}"/> class. /// </summary> /// <param name="source">The changes of the source collection.</param> public MinMaxTracker(IChanges <TValue> source) { Ensure.NotNull(source, nameof(source)); this.source = source; source.Add += this.OnAdd; source.Remove += this.OnRemove; source.Reset += this.OnReset; this.Reset(); }
public ProjectSyncProcessor(ISoftwareFactoryEventDispatcher eventDispatcher, IXmlFileCache xmlFileCache, IChanges changeManager, IProject project) { _changeManager = changeManager; _xmlFileCache = xmlFileCache; _sfEventDispatcher = eventDispatcher; Project = project; _syncProjectFile = UpdateFileOnHDD; }
public FrameworkProjectSyncProcessor( ISoftwareFactoryEventDispatcher softwareFactoryEventDispatcher, IXmlFileCache xmlFileCache, IChanges changeManager, IProject project) { _softwareFactoryEventDispatcher = softwareFactoryEventDispatcher; _xmlFileCache = xmlFileCache; _changeManager = changeManager; _project = project; _syncProjectFile = UpdateFileOnHdd; }
public FrameworkProjectSyncProcessor( string projectPath, ISoftwareFactoryEventDispatcher sfEventDispatcher, IXmlFileCache xmlFileCache, IChanges changeManager, IOutputTarget project) { _projectPath = projectPath; _sfEventDispatcher = sfEventDispatcher; _xmlFileCache = xmlFileCache; _changeManager = changeManager; _project = project; _syncProjectFile = UpdateFileOnHdd; }
public ApplicationSyncProcessor(ISoftwareFactoryEventDispatcher eventDispatcher, IXmlFileCache fileCache, IChanges changeManager) { Order = 90; _changeManager = changeManager; _fileCache = fileCache; _actions = new Dictionary <string, List <SoftwareFactoryEvent> >(); _eventDispatcher = eventDispatcher; //Subscribe to all the project change events _eventDispatcher.Subscribe(SoftwareFactoryEvents.AddProjectItemEvent, Handle); _eventDispatcher.Subscribe(SoftwareFactoryEvents.RemoveProjectItemEvent, Handle); _eventDispatcher.Subscribe(SoftwareFactoryEvents.AddTargetEvent, Handle); _eventDispatcher.Subscribe(SoftwareFactoryEvents.AddTaskEvent, Handle); _eventDispatcher.Subscribe(SoftwareFactoryEvents.ChangeProjectItemTypeEvent, Handle); }
public ApplicationSyncProcessor(ISoftwareFactoryEventDispatcher sfEventDispatcher, IXmlFileCache fileCache, IChanges changeManager) { _changeManager = changeManager; _fileCache = fileCache; _actions = new Dictionary <string, List <SoftwareFactoryEvent> >(); _sfEventDispatcher = sfEventDispatcher; //Subscribe to all the project change events _sfEventDispatcher.Subscribe(SoftwareFactoryEvents.FileAddedEvent, Handle); _sfEventDispatcher.Subscribe(SoftwareFactoryEvents.FileRemovedEvent, Handle); _sfEventDispatcher.Subscribe(SoftwareFactoryEvents.AddTargetEvent, Handle); _sfEventDispatcher.Subscribe(SoftwareFactoryEvents.AddTaskEvent, Handle); _sfEventDispatcher.Subscribe(SoftwareFactoryEvents.ChangeProjectItemTypeEvent, Handle); _sfEventDispatcher.Subscribe(CsProjectEvents.AddImport, Handle); _sfEventDispatcher.Subscribe(CsProjectEvents.AddCompileDependsOn, Handle); _sfEventDispatcher.Subscribe(CsProjectEvents.AddBeforeBuild, Handle); _sfEventDispatcher.Subscribe(CsProjectEvents.AddContentFile, Handle); }
/// <summary> /// Initializes a new instance of the <see cref="MaxTracker{TValue}"/> class. /// </summary> /// <param name="source">The changes of the source collection.</param> public MaxTracker(IChanges <TValue> source) : base(source) { this.Reset(); }
public NugetInstallerFactoryExtension(ISoftwareFactoryEventDispatcher sfEventDispatcher, IChanges changeManager) { _sfEventDispatcher = sfEventDispatcher; _changeManager = changeManager; }
void IDataContainer.NotifyOfComponentChange(Tuple<IChangeable, string> what, IChanges callback) { var changeable = changeables.Values.FirstOrDefault(x => x == what.Item1); if (null != changeable) { SubscribeToComponentChange(changeable, what.Item2, callback); } }
void IDataContainer.NotifyOfChange(string key, IChanges callback) { SubscribeToAttributeChange(key, callback); }
public void UnsubscribeFromComponentChange(IChangeable component, string property, IChanges callback) { GetPropertyCallbacks(component, property).Remove(callback); }
public void UnsubscribeFromAttributeChange(string key, IChanges callback) { GetCallbacks(key).Remove(callback); }
public void SubscribeToComponentChange(IChangeable component, string property, IChanges callback) { GetPropertyCallbacks(component, property).Add(callback); }
public void SubscribeToAttributeChange(string key, IChanges callback) { GetCallbacks(key).Add(callback); }
internal void NotifyOfChange(IChanges callback) { Callbacks.Add(callback); }
void IDataContainer.NotifyOfComponentChange(Tuple<IChangeable, string> what, IChanges callback) { List<IChanges> callbacks; if (CheckProperties.TryGetValue(what, out callbacks)) { callbacks.Add(callback); } else { callbacks = new List<IChanges>(); callbacks.Add(callback); CheckProperties[what] = callbacks; if(null != what.Item1) what.Item1.ShouldCheck = true; } }
internal void UnnotifyOfComponentChange(Tuple<IChangeable, string> what, IChanges callback) { List<IChanges> callbacks; if (CheckProperties.TryGetValue(what, out callbacks)) { callbacks.Remove(callback); if (callbacks.Count == 0 && null != what.Item1) what.Item1.ShouldCheck = false; } }
internal void StopNotifications(string key, IChanges callback) { List<IChanges> removeFrom = callbacks[key]; removeFrom.Remove(callback); }
public void NotifyOfChange(string key, IChanges callback) { List<IChanges> addTo = null; callbacks.TryGetValue(key, out addTo); if (null == addTo) { addTo = new List<IChanges>(); callbacks[key] = addTo; addTo.Add(callback); } else { addTo.Add(callback); } }