Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause building of modified collection. Fixes #256 #484

Closed
wants to merge 1 commit into from
Closed

Pause building of modified collection. Fixes #256 #484

wants to merge 1 commit into from

Conversation

iCodeIT
Copy link

@iCodeIT iCodeIT commented Oct 3, 2019

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

return entry;
}

public void PauseInternalEntryUpdates()
Copy link
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
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
Owner

Check out #485

@iCodeIT
Copy link
Author

iCodeIT commented Oct 9, 2019

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.

None yet

3 participants