Page 1 of 1

Sample for check in via API (V.3)

Posted: Mon Aug 06, 2007 5:12 am
by sahaas
Hello,

im locking for a Example how I can check in some files via API (V.3)!

thanks alot!

best regards

S. Haas

Posted: Mon Aug 06, 2007 7:17 am
by jeremy_sg
Take a look at the example code at http://weblogs.asp.net/jeremy_sheeley

Posted: Tue Aug 07, 2007 10:14 am
by sahaas
hello jeremy_sg,

thanks alot for help!

Unfortunally I´m looking for a method to check a file single in!

The Commit Methode commit all changes... or???

Posted: Tue Aug 07, 2007 11:00 am
by jeremy_sg
You can find which change set item you want to check in by looping over the InternalChangeSet in clientInstance. Here's some very rough code to get you started.

Code: Select all

ChangeSetItemColl csic = ClientInstance.InternalChangeSet_GetItems(true);
if ( (csic != null) && (csic.Count > 0) )
{
   for (int j = 0; j < csic.Count; j++)
   {
      ChangeSetItem csiItem = csicOld[j];
      if   (csiItem.DisplayRepositoryPath.ToLower().Equals(MYPATH.ToLower()))
      {
         ChangeSetItemColl csicNew = new ChangeSetItemColl();
         csicNew.Add(csiItem);
         ClientInstance.Commit(csicNew);
      } 
   }
}

Posted: Wed Aug 08, 2007 2:08 am
by sahaas
thats works! Thanks for help!