コード例 #1
0
        /// <summary>
        /// Raises the <see cref="ProjectRootElementDirtied"/> event.
        /// </summary>
        /// <param name="sender">The dirtied project root element.</param>
        /// <param name="e">Details on the PRE and the nature of the change.</param>
        internal void OnProjectRootElementDirtied(ProjectRootElement sender, ProjectXmlChangedEventArgs e)
        {
            var cacheDirtied = this.ProjectRootElementDirtied;

            if (cacheDirtied != null)
            {
                cacheDirtied(sender, e);
            }
        }
コード例 #2
0
        internal virtual void OnProjectRootElementDirtied(ProjectRootElement sender, ProjectXmlChangedEventArgs e)
        {
            var cacheDirtied = ProjectRootElementDirtied;

            cacheDirtied?.Invoke(sender, e);
        }
コード例 #3
0
 internal override void OnProjectRootElementDirtied(ProjectRootElement sender, ProjectXmlChangedEventArgs e)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 /// <summary>
 /// Raises the <see cref="ProjectRootElementDirtied"/> event.
 /// </summary>
 /// <param name="sender">The dirtied project root element.</param>
 /// <param name="e">Details on the PRE and the nature of the change.</param>
 internal void OnProjectRootElementDirtied(ProjectRootElement sender, ProjectXmlChangedEventArgs e)
 {
     var cacheDirtied = this.ProjectRootElementDirtied;
     if (cacheDirtied != null)
     {
         cacheDirtied(sender, e);
     }
 }
コード例 #5
0
        /// <summary>
        /// Marks this project as dirty.
        /// Typically called by child elements to indicate that they themselves have become dirty.
        /// Accepts a reason for debugging purposes only, and optional reason parameter.
        /// </summary>
        /// <remarks>
        /// This is sealed because it is virtual and called in a constructor; by sealing it we
        /// satisfy FXCop that nobody will override it to do something that would rely on
        /// unconstructed state.
        /// Should be protected+internal.
        /// </remarks>
        internal sealed override void MarkDirty(string reason, string param)
        {
            IncrementVersion();

            _dirtyReason = reason;
            _dirtyParameter = param;

            _timeLastChangedUtc = DateTime.UtcNow;

            var changedEventArgs = new ProjectXmlChangedEventArgs(this, reason, param);
            var projectXmlChanged = OnProjectXmlChanged;
            if (projectXmlChanged != null)
            {
                projectXmlChanged(this, changedEventArgs);
            }

            // Only bubble this event up if the cache knows about this PRE.
            if (this.IsMemberOfProjectCollection)
            {
                _projectRootElementCache.OnProjectRootElementDirtied(this, changedEventArgs);
            }
        }