コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <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();
 }
コード例 #4
0
 public ProjectSyncProcessor(ISoftwareFactoryEventDispatcher eventDispatcher,
                             IXmlFileCache xmlFileCache,
                             IChanges changeManager,
                             IProject project)
 {
     _changeManager     = changeManager;
     _xmlFileCache      = xmlFileCache;
     _sfEventDispatcher = eventDispatcher;
     Project            = project;
     _syncProjectFile   = UpdateFileOnHDD;
 }
コード例 #5
0
 public FrameworkProjectSyncProcessor(
     ISoftwareFactoryEventDispatcher softwareFactoryEventDispatcher,
     IXmlFileCache xmlFileCache,
     IChanges changeManager,
     IProject project)
 {
     _softwareFactoryEventDispatcher = softwareFactoryEventDispatcher;
     _xmlFileCache    = xmlFileCache;
     _changeManager   = changeManager;
     _project         = project;
     _syncProjectFile = UpdateFileOnHdd;
 }
コード例 #6
0
 public FrameworkProjectSyncProcessor(
     string projectPath,
     ISoftwareFactoryEventDispatcher sfEventDispatcher,
     IXmlFileCache xmlFileCache,
     IChanges changeManager,
     IOutputTarget project)
 {
     _projectPath       = projectPath;
     _sfEventDispatcher = sfEventDispatcher;
     _xmlFileCache      = xmlFileCache;
     _changeManager     = changeManager;
     _project           = project;
     _syncProjectFile   = UpdateFileOnHdd;
 }
コード例 #7
0
 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);
 }
コード例 #8
0
        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);
        }
コード例 #9
0
 /// <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();
 }
コード例 #10
0
 public NugetInstallerFactoryExtension(ISoftwareFactoryEventDispatcher sfEventDispatcher, IChanges changeManager)
 {
     _sfEventDispatcher = sfEventDispatcher;
     _changeManager     = changeManager;
 }
コード例 #11
0
 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);
     }
 }
コード例 #12
0
 void IDataContainer.NotifyOfChange(string key, IChanges callback)
 {
     SubscribeToAttributeChange(key, callback);
 }
コード例 #13
0
 public void UnsubscribeFromComponentChange(IChangeable component, string property, IChanges callback)
 {
     GetPropertyCallbacks(component, property).Remove(callback);
 }
コード例 #14
0
 public void UnsubscribeFromAttributeChange(string key, IChanges callback)
 {
     GetCallbacks(key).Remove(callback);
 }
コード例 #15
0
 public void SubscribeToComponentChange(IChangeable component, string property, IChanges callback)
 {
     GetPropertyCallbacks(component, property).Add(callback);
 }
コード例 #16
0
 public void SubscribeToAttributeChange(string key, IChanges callback)
 {
     GetCallbacks(key).Add(callback);
 }
コード例 #17
0
 internal void NotifyOfChange(IChanges callback)
 {
     Callbacks.Add(callback);
 }
コード例 #18
0
        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;
            }
        }
コード例 #19
0
 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;
     }
 }
コード例 #20
0
 internal void StopNotifications(string key, IChanges callback)
 {
     List<IChanges> removeFrom = callbacks[key];
     removeFrom.Remove(callback);
 }
コード例 #21
0
 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);
     }
 }