Пример #1
0
        private void mergeBuildList(Dictionary <int, BuildItem> list, string key, BuildMessage[] results)
        {
            var itemsToRemove = new List <int>();
            var buildResults  = new Dictionary <int, BuildItem>();

            results.ToList().ForEach(x =>
            {
                var resultItem = new BuildItem(key, x);
                buildResults.Add(resultItem.GetHashCode(), resultItem);
            });
            foreach (var item in list)
            {
                if (item.Value.Key.Equals(key) && !buildResults.ContainsKey(item.Key))
                {
                    //Debug.WriteDebug("Removing old build item from {0} in {1}, {2} {3}:{4}", item.Value.Key, item.Value.Value.File, item.Value.Value.ErrorMessage, item.Value.Value.LineNumber, item.Value.Value.LinePosition);
                    itemsToRemove.Add(item.Key);
                }
            }
            foreach (var item in itemsToRemove)
            {
                list.Remove(item);
            }
            foreach (var item in buildResults)
            {
                if (!list.ContainsKey(item.Key))
                {
                    //Debug.WriteDebug("Adding new build item from {0} in {1}, {2} {3}:{4}", item.Value.Key, item.Value.Value.File, item.Value.Value.ErrorMessage, item.Value.Value.LineNumber, item.Value.Value.LinePosition);
                    //list.Insert(0, item);
                    list.Add(item.Key, item.Value);
                }
            }
        }
Пример #2
0
 private void mergeBuildList(Dictionary<int, BuildItem> list, string key, BuildMessage[] results)
 {
     var itemsToRemove = new List<int>();
     var buildResults = new Dictionary<int, BuildItem>();
     results.ToList().ForEach(x =>
                                  {
                                      var resultItem = new BuildItem(key, x);
                                      buildResults.Add(resultItem.GetHashCode(), resultItem);
                                  });
     foreach (var item in list)
     {
         if (item.Value.Key.Equals(key) && !buildResults.ContainsKey(item.Key))
         {
             //Debug.WriteDebug("Removing old build item from {0} in {1}, {2} {3}:{4}", item.Value.Key, item.Value.Value.File, item.Value.Value.ErrorMessage, item.Value.Value.LineNumber, item.Value.Value.LinePosition);
             itemsToRemove.Add(item.Key);
         }
     }
     foreach (var item in itemsToRemove)
         list.Remove(item);
     foreach (var item in buildResults)
     {
         if (!list.ContainsKey(item.Key))
         {
             //Debug.WriteDebug("Adding new build item from {0} in {1}, {2} {3}:{4}", item.Value.Key, item.Value.Value.File, item.Value.Value.ErrorMessage, item.Value.Value.LineNumber, item.Value.Value.LinePosition);
             //list.Insert(0, item);
             list.Add(item.Key, item.Value);
         }
     }
 }
 public void RemoveWarning(BuildItem warning) { _removedWarnings.Add(warning.GetHashCode(), warning); }
 public void AddWarning(BuildItem warning) { _addedWarnings.Add(warning.GetHashCode(), warning); }
 public void RemoveError(BuildItem error) { _removedErrors.Add(error.GetHashCode(), error); }
 public void AddError(BuildItem error) { _addedErrors.Add(error.GetHashCode(), error); }
Пример #7
0
 public void RemoveWarning(BuildItem warning)
 {
     _removedWarnings.Add(warning.GetHashCode(), warning);
 }
Пример #8
0
 public void AddWarning(BuildItem warning)
 {
     _addedWarnings.Add(warning.GetHashCode(), warning);
 }
Пример #9
0
 public void RemoveError(BuildItem error)
 {
     _removedErrors.Add(error.GetHashCode(), error);
 }
Пример #10
0
 public void AddError(BuildItem error)
 {
     _addedErrors.Add(error.GetHashCode(), error);
 }