Microsoft Developer Network > Domovská stránka fór > Visual Studio Source Control and SourceSafe > IVSSItem.Undocheckout(string filepath, int iflags) and file's readonly attribute
Odeslat dotazOdeslat dotaz
 

OdpovědětIVSSItem.Undocheckout(string filepath, int iflags) and file's readonly attribute

  • 1. července 2009 23:56msejder Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Hello,

    I am trying to automate and use VSS functionality for an add-in I am currently developing. I use VS2005 and C#.NET as my IDE and programming language.

    After I retrieved the VSSItem from source safe I checkedout it. Then I tried to undocheckout this item. What happens is the following:

    Undocheckout worked (I run the Source Safe itsel and looked to see if it is undocheckoutted). However, the read-only attribute of the local file specified by VSSItem did not become read-only.

    I passed the value SSFlags.VSSFLAG_DELNOREPLACE to iFlags parameter of the VSSItem.Undocheckout method.

    Despite that, local file's read-only attribute did not become enabled after a call to undocheckout. However, I see that if from my C# add-in application I checkout a file and then use the VS IDE to undocheckout the file, the file's read-only
    attribute enable again.

    What I am doing wrong? Any help will be much appretiated.

    Thank you


Odpovědi

  • 2. července 2009 11:50Cristian_t Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     OdpovědětObsahuje kód

    Hi,


    Try using the default flag, VSSFLAG_DELNO for the UndoCheckout operation. By using this flag the read-only attribute will be preserved and the local copy will not be deleted. Read the online docs, available here, for more information.

    vssItem.UndoCheckout(item.LocalSpec, (int)(VSSFlags.VSSFLAG_DELNO));
    




    Cristi


    Cristian Trifan - Software Developer

Všechny reakce

  • 2. července 2009 11:50Cristian_t Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     OdpovědětObsahuje kód

    Hi,


    Try using the default flag, VSSFLAG_DELNO for the UndoCheckout operation. By using this flag the read-only attribute will be preserved and the local copy will not be deleted. Read the online docs, available here, for more information.

    vssItem.UndoCheckout(item.LocalSpec, (int)(VSSFlags.VSSFLAG_DELNO));
    




    Cristi


    Cristian Trifan - Software Developer