title: Programmatically get pending changes for a specific folder in a specific project?
body: <p>I have been playing around with TFS for a while because I need to upload/check in specific files and folders into various locations on the TFServer after they have been created and placed locally. I am mapping the workspace and everything and I get a bunch of changes from PendingChanges but not the ones I want and not where I want. The problem is really annoying because for every check in process I only want to work on a specific folder or file in a specific location that is already mapped. I am gonna paste part of the code here for reference.</p>
  
  <pre><code>using (TfsTeamProjectCollection collection = new TfsTeamProjectCollection(serverUri, _cred))
          {
              VersionControlServer versionControl = (VersionControlServer)collection.GetService(typeof(VersionControlServer));
  
  
              string machineName = Environment.MachineName;
              string currentUserName = Environment.UserName;
  
              Workspace myWorkspace = versionControl.GetWorkspace(machineName, currentUserName);
              // tried this from Stack but didn't work.
              //PendingChange[] changes = myWorkspace.GetPendingChanges().Where(x =&gt; x.LocalOrServerFolder.Contains(localPath)).ToArray();
  
              PendingChange[] changes = myWorkspace.GetPendingChanges();
              if (changes.Length != 0)
              {
                  foreach (PendingChange c in changes)
                  {
                      rt.Text += "  path: " + c.LocalItem + ", change: " + PendingChange.GetLocalizedStringForChangeType(c.ChangeType) + "\n";
                  }
              }
              else
              {
                  rt.Text += "This didn't work.";
              }
  </code></pre>
  
  <p>}</p>
  
  <p>Basically I want to throw a folder or file at my TFS class and let it check if the file or folder is up to date or present on the TFS and act accordingly. I hope I have described the problem thoroughly. </p>