示例#1
0
 bool EnvDTEScc2.CheckOutItems2(ref object[] itemNames, CheckoutOptions flags)
 {
     try
     {
         return(CheckOutItems((string[])itemNames, flags));
     }
     catch (Exception)
     {
         return(false);
     }
 }
        protected override bool CheckOutItems(string[] itemNames, EnvDTE80.vsSourceControlCheckOutOptions flags)
        {
            HybridCollection <string> mustLockItems = null;

            foreach (string item in itemNames)
            {
                if (!IsSafeSccPath(item))
                {
                    continue;
                }

                SvnItem svnItem = StatusCache[item];

                if (svnItem.IsReadOnlyMustLock)
                {
                    if (mustLockItems == null)
                    {
                        mustLockItems = new HybridCollection <string>(StringComparer.OrdinalIgnoreCase);
                    }

                    mustLockItems.Add(svnItem.FullPath);
                }
            }

            if (mustLockItems == null)
            {
                return(true);
            }

            CommandService.DirectlyExecCommand(AnkhCommand.SccLock, mustLockItems, CommandPrompt.DoDefault);
            // Only check the original list; the rest of the items in mustLockItems is optional
            foreach (string item in mustLockItems)
            {
                if (StatusCache[item].IsReadOnlyMustLock)
                {
                    // User has probably canceled the lock operation, or it failed.
                    return(false);
                }
            }

            return(true);
        }
示例#3
0
 protected virtual bool CheckOutItems(string[] itemNames, CheckoutOptions flags)
 {
     return(true);
 }
示例#4
0
        bool EnvDTEScc2.CheckOutItem2(string itemName, CheckoutOptions flags)
        {
            object[] items = new string[] { itemName };

            return(((EnvDTEScc2)this).CheckOutItems2(ref items, flags));
        }