forked from CDuke/AutoUncheckout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
206 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@echo off | ||
cls | ||
IF NOT EXIST "tools/FAKE" ( | ||
"tools/nuget/nuget.exe" "install" "FAKE" "-OutputDirectory" "tools" "-ExcludeVersion" | ||
) | ||
|
||
"tools/FAKE/tools/Fake.exe" "%~dp0build/build.fsx" "VisualStudioVersion=15.0" | ||
pause | ||
exit /b %errorlevel% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Microsoft.VisualStudio; | ||
using Microsoft.VisualStudio.Shell.Interop; | ||
|
||
namespace KulikovDenis.AutoUncheckout | ||
{ | ||
internal class SaveListener : IVsRunningDocTableEvents3 | ||
{ | ||
private readonly AutoUncheckoutPackage _package; | ||
|
||
public SaveListener(AutoUncheckoutPackage package) | ||
{ | ||
_package = package; | ||
} | ||
|
||
public int OnAfterAttributeChange(uint docCookie, uint grfAttribs) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterAttributeChangeEx(uint docCookie, uint grfAttribs, IVsHierarchy pHierOld, uint itemidOld, | ||
string pszMkDocumentOld, IVsHierarchy pHierNew, uint itemidNew, string pszMkDocumentNew) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterDocumentWindowHide(uint docCookie, IVsWindowFrame pFrame) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterFirstDocumentLock(uint docCookie, uint dwRDTLockType, uint dwReadLocksRemaining, | ||
uint dwEditLocksRemaining) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterSave(uint docCookie) | ||
{ | ||
var info = _package.Rdt.GetDocumentInfo(docCookie); | ||
var fileName = info.Moniker; | ||
_package.Uncheckout(fileName); | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeLastDocumentUnlock(uint docCookie, uint dwRDTLockType, uint dwReadLocksRemaining, | ||
uint dwEditLocksRemaining) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeSave(uint docCookie) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="EnvDTE" version="8.0.1" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> | ||
<Metadata> | ||
<Identity Id="AutoUncheckout.VS2015.1954660f-1535-4694-9e6d-c27e8eb476a4" Version="1.1" Language="en-US" Publisher="Kulikov Denis" /> | ||
<DisplayName>Auto Uncheckout for Visual Studio 2015</DisplayName> | ||
<Identity Id="AutoUncheckout.VS2017.1954660f-1535-4694-9e6d-c27e8eb476a4" Version="1.1" Language="en-US" Publisher="Kulikov Denis" /> | ||
<DisplayName>Auto Uncheckout for Visual Studio 2017</DisplayName> | ||
<Description xml:space="preserve">Automatically undo check out file, if it has not been modified</Description> | ||
<MoreInfo>https://github.com/CDuke/AutoUncheckout</MoreInfo> | ||
<License>LICENSE.txt</License> | ||
<Tags>auto, undo, check out, tfs, automatically</Tags> | ||
</Metadata> | ||
<Installation InstalledByMsi="false"> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0, 15.0)" /> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[15.0, 16.0)" /> | ||
</Installation> | ||
<Dependencies> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" /> | ||
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0, 15.0)" /> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" /> | ||
<Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" d:Source="Installed" Version="[15.0, 16.0)" /> | ||
</Dependencies> | ||
<Assets> | ||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" /> | ||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" /> | ||
</Assets> | ||
<Prerequisites> | ||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,16.0)" DisplayName="Visual Studio core editor" /> | ||
</Prerequisites> | ||
</PackageManifest> |
Oops, something went wrong.