Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'LibGit2Sharp/IBelongToARepository.cs')
-rw-r--r--LibGit2Sharp/IBelongToARepository.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/LibGit2Sharp/IBelongToARepository.cs b/LibGit2Sharp/IBelongToARepository.cs
new file mode 100644
index 00000000..f0297c6c
--- /dev/null
+++ b/LibGit2Sharp/IBelongToARepository.cs
@@ -0,0 +1,26 @@
+namespace LibGit2Sharp
+{
+ /// <summary>
+ /// Can be used to reference the <see cref="IRepository" /> from which
+ /// an instance was created.
+ /// <para>
+ /// While convenient in some situations (e.g. Checkout branch bound to UI element),
+ /// it is important to ensure instances created from an <see cref="IRepository" />
+ /// are not used after it is disposed.
+ /// </para>
+ /// <para>
+ /// It's generally better to create <see cref="IRepository" /> and dependant instances
+ /// on demand, with a short lifespan.
+ /// </para>
+ /// </summary>
+ public interface IBelongToARepository
+ {
+ /// <summary>
+ /// The <see cref="IRepository" /> from which this instance was created.
+ /// <para>
+ /// The returned value should not be disposed.
+ /// </para>
+ /// </summary>
+ IRepository Repository { get; }
+ }
+}