Skip to content

slnEnv Variable in README.MD #31

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

Closed
astrohart opened this issue Aug 20, 2020 · 1 comment
Closed

slnEnv Variable in README.MD #31

astrohart opened this issue Aug 20, 2020 · 1 comment
Labels

Comments

@astrohart
Copy link

See:

fig01

What's this variable? Where is it declared? Kindly please add the declaration of this variable to the example code, so that I might know why it's there/how to utilize this package.

Respectfully,

Brian H

@3F
Copy link
Owner

3F commented Aug 20, 2020

Hello Brian,

I am sorry for the unclear samples. I remind everyone that you can improve something via PR.

slnEnv variable in readme points to sln.Result.Env with its default implementation of the available environments.

public interface IEnvironment: IXProjectEnv, IDisposable

To be clear, after #17 MvsSln 2.4+ may provide a several implementations such as basic IXProjectEnv environment and IEnvironment with IDisposable pattern.

The reason of IXProjectEnv was described in #17 and in short it delegates the releasing of resources at the user's choice. When, for example, you don't need to release it at all.

This concerns to programs like vsSolutionBuildEvent that works in various environments (VS EnvDTE, MSBuild, etc), this is it:

For the default* behavior MvsSln still works with IEnvironment which requires the use of disposing.

*The default behavior means our Sln wrapper with related flags, for example:

using(var sln = new Sln("...", SlnItems.Env | SlnItems.LoadMinimalDefaultData)
{
    //...
} // sln.Result.Env will be released as soon as GC will collect this outside this scope

Because some manual way is also provided like https://github.com/3F/DllExport/blob/master/Wizard/DxpIsolatedEnv.cs

In any case Sln class above is a simple wrapper #10

Let me know if you still have the questions or problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants