Skip to content

Pause building of modified collection. Fixes #256 - #484

Closed
iCodeIT wants to merge 1 commit into
adamhathcock:masterfrom
iCodeIT:Issue-256
Closed

Pause building of modified collection. Fixes #256#484
iCodeIT wants to merge 1 commit into
adamhathcock:masterfrom
iCodeIT:Issue-256

Conversation

@iCodeIT

@iCodeIT iCodeIT commented Oct 3, 2019

Copy link
Copy Markdown

Allow for not rebuilding of modified collection while adding all files under a directory.

return entry;
}

public void PauseInternalEntryUpdates()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make a IDisposable object that would flip the boolean back to true on Dispose so that way a using statement can be used in the implementation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that. Such a pause-object would need to know the instance of the AbstractWritableArchive in order to flip the boolean and to call RebuildModifiedCollection on that instance when the pause-object is disposed.
This requires the user to use the using statement - if the user don't and the user doesn't dispose the pause-object himself, then it will be disposed some time later where the AbstractWritableArchive might have been disposed. It is difficult to get right.
Therefore I opted for the pattern used in WinForms where SuspendLayout/ResumeLayout is commonly used for performance reasons when larger updates of lists or tree structures are updated.

So I don't see how to do this in a nice way (but I am happy to be educated on the issue ;-) if you can show me how)

@adamhathcock

Copy link
Copy Markdown
Owner

Check out #485

@iCodeIT

iCodeIT commented Oct 9, 2019

Copy link
Copy Markdown
Author

Check my code comments.

@iCodeIT iCodeIT closed this Oct 10, 2019
@iCodeIT
iCodeIT deleted the Issue-256 branch October 10, 2019 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants