Example #1
0
        /// <summary>Detaches the SvnEventArgs from the unmanaged storage; optionally keeping the property values for later use</summary>
        /// <description>After this method is called all properties are either stored managed, or are no longer readable</description>
        protected internal override void Detach(bool keepProperties)
        {
            try
            {
                if (keepProperties)
                {
                    // Use all properties to get them cached in .Net memory
                    GC.KeepAlive(Path);
                    GC.KeepAlive(FullPath);
                    GC.KeepAlive(Uri);
                    GC.KeepAlive(MimeType);
                    GC.KeepAlive(Error);
                    GC.KeepAlive(Lock);
                    GC.KeepAlive(ChangeListName);
                    GC.KeepAlive(MergeRange);
                    GC.KeepAlive(PropertyName);
                    GC.KeepAlive(RevisionProperties);
                }

                _lock?.Detach(keepProperties);
            }
            finally
            {
                _notify = null;
                _pool   = null;
                base.Detach(keepProperties);
            }
        }
Example #2
0
        internal SvnNotifyEventArgs(svn_wc_notify_t notify, SvnCommandType commandType, AprPool pool)
        {
            _notify = notify ?? throw new ArgumentNullException(nameof(notify));
            _pool   = pool ?? throw new ArgumentNullException(nameof(pool));

            Action        = (SvnNotifyAction)notify.action;
            NodeKind      = (SvnNodeKind)notify.kind;
            ContentState  = (SvnNotifyState)notify.content_state;
            PropertyState = (SvnNotifyState)notify.prop_state;
            LockState     = (SvnLockState)notify.lock_state;
            Revision      = notify.revision;
            OldRevision   = notify.old_revision;

            _hunkOriginalStart  = notify.hunk_original_start;
            _hunkOriginalLength = notify.hunk_original_length;
            _hunkModifiedStart  = notify.hunk_modified_start;
            _hunkModifiedLength = notify.hunk_modified_length;
            _hunkMatchedLine    = notify.hunk_matched_line;
            _hunkFuzz           = notify.hunk_fuzz;

            CommandType = commandType;
        }