예제 #1
0
 public DummyCommandResult(bool success, params string[] args)
 {
     Success      = success;
     TaggedOutput = new TaggedObjectList();
     foreach (var item in args)
     {
         var record = new TaggedObject();
         record["clientFile"] = item;
         record["dummy"]      = "true";  // identifies IP4CommandResult as containing a dummy record for this item
         TaggedOutput.Add(record);
     }
 }
예제 #2
0
 private void UpdateFileInfoCache(List <string> refreshList, TaggedObjectList records)
 {
     if (records != null)
     {
         // update FileInfo instances with passed in records, fire StatusChanged event when applicable
         foreach (var record in records)
         {
             FileInfo info;
             string   filePath = PathUtil.GetCanonicalPath(record["clientFile"]);
             bool     foundInfo;
             lock (m_infoCache) //keep the lock for as short a time as possible; can't lock around OnStatusChanged().
                 foundInfo = m_infoCache.TryGetValue(filePath, out info);
             if (foundInfo)
             {
                 SourceControlStatus oldStatus = info.Status;
                 info.UpdateRecord(record);
                 if (info.Status != oldStatus)
                 {
                     OnStatusChanged(new SourceControlEventArgs(info.Uri, info.Status));
                 }
                 refreshList.Remove(filePath);
             }
         }
     }
     foreach (var filePath in refreshList)
     {
         //P4API.NET does not output records for files not under version control
         FileInfo info;
         lock (m_infoCache) //keep the lock for as short a time as possible; can't lock around OnStatusChanged().
             info = m_infoCache[filePath];
         SourceControlStatus oldStatus = info.Status;
         if (oldStatus != SourceControlStatus.NotControlled)
         {
             info.NotControlled = true;
             OnStatusChanged(new SourceControlEventArgs(info.Uri,
                                                        SourceControlStatus.NotControlled));
         }
     }
 }
예제 #3
0
 private void UpdateFileInfoCache(List<string> refreshList, TaggedObjectList records)
 {
     if (records != null)
     {
         // update FileInfo instances with passed in records, fire StatusChanged event when applicable
         foreach (var record in records)
         {
             FileInfo info;
             string filePath = PathUtil.GetCanonicalPath(record["clientFile"]);
             bool foundInfo;
             lock (m_infoCache) //keep the lock for as short a time as possible; can't lock around OnStatusChanged().
                 foundInfo = m_infoCache.TryGetValue(filePath, out info);
             if (foundInfo)
             {
                 SourceControlStatus oldStatus = info.Status;
                 info.UpdateRecord(record);
                 if (info.Status != oldStatus)
                     OnStatusChanged(new SourceControlEventArgs(info.Uri, info.Status));
                 refreshList.Remove(filePath);
             }
         }
     }
     foreach (var filePath in refreshList)
     {
         //P4API.NET does not output records for files not under version control
         FileInfo info;
         lock (m_infoCache) //keep the lock for as short a time as possible; can't lock around OnStatusChanged().
             info = m_infoCache[filePath];
         SourceControlStatus oldStatus = info.Status;
         if (oldStatus != SourceControlStatus.NotControlled)
         {
             info.NotControlled = true;
             OnStatusChanged(new SourceControlEventArgs(info.Uri,
                 SourceControlStatus.NotControlled));
         }
     }
 }
예제 #4
0
 public DummyCommandResult(bool success, params string[] args)
 {
     Success = success;
     TaggedOutput = new TaggedObjectList();
     foreach (var item in args)
     {
         var record = new TaggedObject();
         record["clientFile"] = item;
         record["dummy"] = "true";       // identifies IP4CommandResult as containing a dummy record for this item
         TaggedOutput.Add(record);
     }
 }