Repository navigation
How to Check Out Source Controlled Files #217
Unanswered
AssisiSoft
asked this question in
Q&A
Replies: 5 comments
|
You can do something like this: if (dte.SourceControl.IsItemUnderSCC(fileName) && !dte.SourceControl.IsItemCheckedOut(fileName))
{
dte.SourceControl.CheckOutItem(fileName);
} |
0 replies
|
Working but what about showing the file after its checked out? if I open many files in a row, check out fails. I think because Windows events are not processing. Is there an equivalent to Application.DoEvents()? |
0 replies
|
More specifically, here is my check out routine. CheckOutItem() is successful but IsItemCheckedOut() returns false right after. Is there some Windows events that need to process because DTE is a COM object? How do I let them process between the two calls? |
0 replies
|
Is it possible to do checkout without using DTE? |
0 replies
|
I'm not sure what the API is for that. Perhaps @Taysser-Gherfal knows? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I used to do this to check out files from source control. Always had issues with files not being fully checked out in time for edits. DoEvents() seemed to fix the issue. Is there a better way?
Solution = DTE.Solution;
ProjectItem = Solution.FindProjectItem(File);
Document = ProjectItem.Document;
Window = Document.ActiveWindow;
Window .Activate();
DTE.ExecuteCommand("EditorContextMenus.CodeWindow.CheckOutforEdit");
//System.Threading.Thread.Sleep(100);
Application.DoEvents();
All reactions