title: Programatically checking files into TFS getting more than expected
body: <p><br>
  So I have a .NET app which goes thru and generates a series of files, outputs them to a local directory and then determines if it needs to update an existing file or add a new file into a TFS (Team Foundation Server) project.
  <br>
  I have a single workspace on my local machine and there are 10 different working folders that are other coding projects I have worked on from this particular machine.  My problem happens when I go to check if the file already exists in the TFS project and an update is required or if needs to be added to the project as a new file.
  <br>
  snipet:</p>
  
  <pre>
  static string TFSProject = @"$/SQLScripts/";
  static WorkspaceInfo wsInfo;
  static VersionControlServer versionControl;
  static string argPath = "E:\\SQLScripts\\";
  
  wsInfo = Workstation.Current.GetLocalWorkspaceInfo(argPath);
  TeamFoundationServer tfs = new TeamFoundationServer(wsInfo.ServerUri.AbsoluteUri);
  versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
  
  Workspace workspace = versionControl.GetWorkspace(wsInfo);
  workspace.GetLocalItemForServerItem(TFSProject);
  </pre>
  
  <p><br>
  At this point I check if the file exists and I do one of two things.  if the file exists, then I mark the file for EDIT and then I writeout the file to the local directory, otherwise I will script the file first and then ADD the file to the workspace.  I dont care if the physical file is identical to the one I am generating as I am doing this as a SAS70 requirement to 'track changes'<br><br>
  If it exists I do:<br>
  workspace.PendEdit(filename,RecurisionType.Full);<br>
  scriptoutthefile(filename);<br>
  <br>
  or if it doesn't exist<br>
  scriptoutthefilename(filename);<br>
  workspace.PendAdd(filename,true);<br>
  <br>
  Ok, all of that to get to the problem. When I go to check on pending changes against the PROJECT I get all the pending changes for all of the projects I have on my local machine in the workspace.</p>
  
  <pre>
  // Show our pending changes. 
  PendingChange[] pendingChanges = workspace.GetPendingChanges();
  foreach (PendingChange pendingChange in pendingChanges)
  {
      dosomething...
  }
  </pre>
  
  <p>I thought that by setting the workspace to workspace.GetLocalItemForServerItem(TFSProject) that it would give me ONLY the objects for that particular working folder. 
  <br><br>If there any way to force the workspace object to only deal with a particular working folder?<br></p>
  
  <p>Did that make any sense?  Thanks in advance...</p>