Exemplo n.º 1
1
        private static IList<int> Merge(IList<int> left, IList<int> right)
        {
            var result = new List<int>();

            while (left.Any() && right.Any())
            {
                if (left[0] < right[0])
                {
                    result.Add(left[0]);
                    left.Remove(left[0]);
                }
                result.Add(right[0]);
                right.Remove(right[0]);
            }

            while (left.Any())
            {
                result.Add(left[0]);
                left.Remove(left[0]);
            }
            while (right.Any())
            {
                result.Add(right[0]);
                right.Remove(right[0]);
            }

            return result;
        }
 protected static void GuerillaPreProcessMethod(BinaryReader binaryReader, IList<tag_field> fields)
 {
     var field = fields.Last(x => x.type != field_type._field_terminator);
     fields.Remove(field);
     field = fields.Last(x => x.type != field_type._field_terminator);
     fields.Remove(field);
 }
        public BidType AskForBid(Contract currentContract, IList<BidType> allowedBids, IList<BidType> previousBids)
        {
            if (this.AlwaysPass)
            {
                return BidType.Pass;
            }

            allowedBids.Remove(BidType.Double);
            allowedBids.Remove(BidType.ReDouble);
            return allowedBids.RandomElement();
        }
Exemplo n.º 4
1
 public IList<ClusterPrototype> MergeClustersIfRequired(IList<ClusterPrototype> clusters)
 {
     var clustersToIterateOver = new List<ClusterPrototype>(clusters);
     foreach (var cluster in clustersToIterateOver) {
         foreach (var otherCluster in new List<ClusterPrototype>(clusters)) {
             if (cluster != otherCluster && this.IsMergeRequired(cluster, otherCluster)) {
                 clusters.Remove(cluster);
                 clusters.Remove(otherCluster);
                 clusters.Add(ClusterPrototype.Merge(cluster, otherCluster));
             }
         }
     }
     return clusters;
 }
 private void ProcessFactories(XmlNode node, IList factories)
 {
    foreach ( XmlNode child in node.ChildNodes )
    {
       Type type;
       switch ( child.LocalName )
       {
       case "add":
          type = Type.GetType(child.Attributes["type"].Value);
          if ( !factories.Contains(type) )
             factories.Add(type);
          break;
       case "remove":
          type = Type.GetType(child.Attributes["type"].Value);
          if ( factories.Contains(type) )
             factories.Remove(type);
          break;
       case "clear":
          factories.Clear();
          break;
       default:
          // gives obsolete warning but needed for .NET 1.1 support
          throw new ConfigurationException(string.Format("Unknown element '{0}' in section '{0}'", child.LocalName, node.LocalName));
       }
    }
 }
Exemplo n.º 6
1
        IEnumerable<ModuleDefMD> SortGraph(IEnumerable<ModuleDefMD> roots, IList<DependencyGraphEdge> edges)
        {
            var visited = new HashSet<ModuleDefMD>();
            var queue = new Queue<ModuleDefMD>(roots);
            do {
                while (queue.Count > 0) {
                    var node = queue.Dequeue();
                    visited.Add(node);

                    Debug.Assert(!edges.Where(edge => edge.To == node).Any());
                    yield return node;

                    foreach (DependencyGraphEdge edge in edges.Where(edge => edge.From == node).ToList()) {
                        edges.Remove(edge);
                        if (!edges.Any(e => e.To == edge.To))
                            queue.Enqueue(edge.To);
                    }
                }
                if (edges.Count > 0) {
                    foreach (var edge in edges) {
                        if (!visited.Contains(edge.From)) {
                            queue.Enqueue(edge.From);
                            break;
                        }
                    }
                }
            } while (edges.Count > 0);
        }
Exemplo n.º 7
1
 public static void RemoveMany(IList list, IEnumerable itemsToRemove)
 {
     foreach (var item in itemsToRemove)
     {
         list.Remove(item);
     }
 }
Exemplo n.º 8
1
        private static void CheckActionList(IList<IBfsAction> actions, IBfsDataBlock block)
        {
            if (actions == null)
                return;

            for( int index = 0; index < actions.Count; index++)
            {
                IBfsAction action = actions[index];

                if (action is BfsActionUnresolvedAssignment)
                {
                    BfsActionUnresolvedAssignment unresolved = action as BfsActionUnresolvedAssignment;
                    BfsActionAssignment assignment = new BfsActionAssignment();
                    assignment.Expression = unresolved.Expression;
                    assignment.SourceRange = unresolved.SourceRange;
                    if (block.LocalFields.ContainsKey(unresolved.UnresolvedVariableName))
                        assignment.LocalVariable = block.LocalFields[unresolved.UnresolvedVariableName];
                    else
                        BfsCompiler.ReportError(assignment.SourceRange,
                            "Could not find local variable: '"+unresolved.UnresolvedVariableName+"'");

                    actions.Insert(index, assignment);
                    actions.Remove(action);
                }
            }
        }
Exemplo n.º 9
1
        private static void LargestStock(IList<double> cuts, IList<Board> stockList)
        {
            var longest = stockList.OrderByDescending(x => x.Length).First();
            var longestBoard = longest.Length;
            var boardCost = longest.Price;

            var scraps = new List<double>();
            var stockUsed = new List<Board>();

            while (cuts.Any())
            {
                var longestCut = cuts.OrderByDescending(x => x).First();
                cuts.Remove(longestCut);
                if (scraps.Any(x => x > longestCut))
                {
                    scraps = scraps.CutFromScrap(longestCut);
                }
                else
                {
                    stockUsed.Add(longest);
                    scraps.Add(longestBoard - longestCut - kerf);
                }
            }

            Console.WriteLine("Total number of boards used: {0}", stockUsed.Count());
            Console.WriteLine("Total Cost: {0}", stockUsed.Count() * boardCost);
            OutputWaste(scraps, stockUsed.Count() * longestBoard);
        }
Exemplo n.º 10
1
 public static bool remove(IList collection, object value)
 {
     bool b = collection.Contains(value);
     if (b)
         collection.Remove(value);
     return b;
 }
Exemplo n.º 11
1
        public static void CalculateTime(IList list, int k)
        {
            // Add
            var startAdding = DateTime.Now;
            string test = "Test string";
            for (int i = 0; i < k; i++)
            {
                list.Add(test);
            }
            var finishAdding = DateTime.Now;
            Console.WriteLine("Addition time (" + k + " elements) : " + list.GetType() + "  " + (finishAdding - startAdding));
            // Search
            var startSearch = DateTime.Now;
            for (int i = 0; i < k; i++)
            {
                bool a = list.Contains(test);
            }
            var finishSearch = DateTime.Now;
            Console.WriteLine("Search time (" + k + " elements) : " + list.GetType() + "  " + (finishSearch - startSearch));

            // Remove
            k = 1000;
            var startRemoving = DateTime.Now;
            for (int i = 0; i < k; i++)
            {
                list.Remove(test);
            }
            var finishRemoving = DateTime.Now;
            Console.WriteLine("Removal time (" + k + " elements) : " + list.GetType() + "  " + (finishRemoving - startRemoving) + "\n");
        }
Exemplo n.º 12
1
        public static IList<int> Merge(IList<int> left, IList<int> right)
        {
            IList<int> result = new List<int>();

            while (left.Any() && right.Any())
            {
                if (left[0] < right[0])
                {
                    result.Add(left[0]);
                    left.Remove(left[0]);
                }
                else
                {
                    result.Add(right[0]);
                    right.Remove(right[0]);
                }
            }

            while (left.Any())
            {
                result.Add(left[0]);
                left.RemoveAt(0);
            }
            while (right.Any())
            {
                result.Add(right[0]);
                right.RemoveAt(0);
            }

            return result;
        }
Exemplo n.º 13
1
        public RTAAPrefixPresenter(IRealTimeAdherenceModel model)
        {
            _model = model;
            _newAddedSet = new List<AdherenceEvent>(50);
            _removedSet = new List<AdherenceEvent>(50);
            WhenAdding = o =>
                             {
                                 IsDirty = true;
                                 var e = new AdherenceEvent
                                             {
                                                 Text = o.Text,
                                                 Start = o.Start.RemoveSeconds(),
                                                 End = o.End.Second == 0 ? o.End : o.End.AddSeconds(60 - o.End.Second),
                                                 Remark = "added",
                                                 Reason = SelectedAbsence
                                             };

                                 _newAddedSet.Add(e);
                                 return e;
                             };
            WhenChanged = o =>
                              {
                                  IsDirty = true;
                              };
            WhenRemoving = o =>
                               {
                                   IsDirty = true;
                                   _newAddedSet.Remove(o);
                                   _removedSet.Add(o);
                               };
        }
Exemplo n.º 14
1
        // when a ball hits an enemy both are destroyed
        public bool FireballEnemyCollisionTest(IList<IEnemy> enemies)
        {
            Rectangle fbRectangle = fireball.GetRectangle();
            Rectangle enemyRectangle;
            Rectangle intersectionRectangle;

            Queue<IEnemy> doomedEnemies = new Queue<IEnemy>();

            foreach (IEnemy enemy in enemies)
            {
                enemyRectangle = enemy.GetRectangle();
                intersectionRectangle = Rectangle.Intersect(fbRectangle, enemyRectangle);

                if (!intersectionRectangle.IsEmpty)
                {
                    // hud score method needed
                    doomedEnemies.Enqueue(enemy);
                }
            }

            while (doomedEnemies.Count() > 0)
            {
                IEnemy e = doomedEnemies.Dequeue();
                enemies.Remove(e);
                return true;
            }
            return false;
        }
Exemplo n.º 15
0
        public static void DragAndDrop <T>(this IList <T> target, int index, T obj, IList <T> source = null)
        {
            source?.Remove(obj);

            var oldIndex = target.IndexOf(obj);

            if (oldIndex != -1)
            {
                if (index == oldIndex)
                {
                    return;
                }

                target.RemoveAt(oldIndex);

                /*if (oldIndex < index) {
                 *  index--;
                 * }*/
            }

            if (index == -1)
            {
                target.Add(obj);
            }
            else
            {
                target.Insert(index, obj);
            }
        }
Exemplo n.º 16
0
    public static void Ungroup(this GroupShapeViewModel group, IList <BaseShapeViewModel>?source)
    {
        Ungroup(group.Shapes, source);
        Ungroup(group.Connectors, source);

        source?.Remove(@group);
    }
Exemplo n.º 17
0
        public PartialViewResult EditContactClosedFilter(IList<ContactFilter> filters, ContactClosedFilter filter)
        {
            filters.Remove(filters.FirstOrDefault(cf => cf.Id == filter.Id));

            filters.Add(filter);
            return PartialView("DisplayTemplates/contactClosedFilter", filter);
        }
Exemplo n.º 18
0
        public List<PropertySpecification> ParseColumns(ref IList<string> rows)
        {
            // pick off the heading line
            string line0 = rows[0];
            var headings = rows[0].Split(',');
            rows.Remove(line0);

            List<PropertySpecification> propertySpecs = new List<PropertySpecification>();


            int rownum = 0;
            foreach (var line in rows)
            {
                if (line.Trim().Length == 0)
                    continue;
                var row = SplitLine(line);
                for (var columnid = 0; columnid < headings.Length; columnid++)
                {
                    try
                    {
                        string contents = row[columnid].Replace("\"", "");
                        var deduced = InferType(ColumnTypeCreate(contents));
                        PropertySpecification spec = propertySpecs.FirstOrDefault(s => s.Id == columnid);
                        if (spec == null)
                        {
                            propertySpecs.Add(new PropertySpecification
                            {
                                ColumnName = headings[columnid].Replace('"', ' ').Replace("/", string.Empty),
                                Id = columnid,
                                ColumnType = deduced,
                                Nullable = CheckForNullable(contents, deduced)
                            });
                        }
                        else
                        {
                            // elevate the type
                            if (spec.ColumnType < deduced && spec.ColumnType != CTEnum.String)
                            {
                                spec.ColumnType = deduced;
                            }
                            if (!spec.Nullable)
                            {
                                if (deduced != CTEnum.String && contents.Length == 0)
                                    Debug.WriteLine("Should be true");
                                spec.Nullable = CheckForNullable(contents, deduced);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        throw new Exception(string.Format("{0} - Row {1} - Column {2} - Value {3}", e.Message, line, rownum, row[columnid]));
                    }
                }
                rownum++;
                if (rownum == 57)
                    System.Diagnostics.Debug.WriteLine("56");
            }

            return propertySpecs;
        }
Exemplo n.º 19
0
        public override void Initialize()
        {
            _notes = new List<string>();
              _lock = new object();

              // homepage
              Get("/", fu.Static.File("index.html"));
              Get("/site.js", fu.Static.File("site.js"));

              // notes API
              Get("/notes", c => new JsonResult(_notes));

              Put("/notes", c =>
              {
            var note = c.Get<IFormData>()["note"];

            _notes.Add(note);
            return new JsonResult(note);
              });

              Delete("/notes/(.+)", c =>
              {
            var note = c.Match.Groups[1].Value;
            _notes.Remove(note);

            return new JsonResult(new { ok = true });
              });
        }
 public IList<IExecutableTask> ExtractTasksToHandle(ref IList<IExecutableTask> list)
 {
     List<IExecutableTask> executableTasks = list.Where(task => task is IUniversalSearchIndexTask).ToList();
     foreach (IExecutableTask executableTask in executableTasks)
         list.Remove(executableTask);
     return executableTasks;
 }
Exemplo n.º 21
0
        public void ItemCollisionTest(SoundEffects sound, HUD hud, IList<IItem> items)
        {
            Rectangle luigiRectangle = myLuigi.GetRectangle();
            Rectangle itemRectangle;
            Rectangle intersectionRectangle;
            Queue<IItem> doomedItems = new Queue<IItem>();
            foreach (IItem item in items)
            {
                itemRectangle = item.GetRectangle();
                intersectionRectangle = Rectangle.Intersect(luigiRectangle, itemRectangle);
                if (!intersectionRectangle.IsEmpty)
                {
                    // todo
                    switch (item.GetItemName())
                    {
                        case "Coin":
                            //myLuigi.Coin();
                            hud.addCoinLuigi();
                            hud.increaseScoreLuigi(Constants.coinValue);
                            hud.achievements.CoinGet();
                            break;
                        case "Mushroom":
                            sound.Powerup();
                            myLuigi.Mushroom();
                            hud.increaseScoreLuigi(Constants.mushroomValue);
                            hud.achievements.MushroomGet();
                            break;
                        case "Fireflower":
                            sound.Powerup();
                            myLuigi.Fireflower();
                            hud.increaseScoreLuigi(Constants.fireflowerValue);
                            hud.achievements.FlowerGet();
                            break;
                        case "Oneup":
                            sound.OneUp();
                            hud.extraLifeLuigi();
                            hud.increaseScoreLuigi(Constants.oneUpValue);
                            break;
                        case "Star":
                            sound.Powerup();
                            myLuigi.Star();
                            hud.increaseScoreLuigi(Constants.starValue);
                            hud.achievements.StarGet();
                            break;
                        default:
                            // nothing
                            break;
                    }
                    doomedItems.Enqueue(item);

                }
            }
            while (doomedItems.Count() > 0)
            {
                IItem item = doomedItems.Dequeue();
                items.Remove(item);

            }
        }
Exemplo n.º 22
0
        public Tuple<int, bool> EnemyCollisionTest(Luigi luigi, HUD hud, IList<IEnemy> enemies, int x, SoundEffects sound)
        {
            Rectangle luigiRectangle = myLuigi.GetRectangle();
            Rectangle enemyRectangle;
            bool enemyKilled = false;
            bool invincible = myLuigi.Invincible();
            int xpos = x;
            Rectangle intersectionRectangle;
            Queue<IEnemy> doomedEnemies = new Queue<IEnemy>();

            foreach (IEnemy enemy in enemies)
            {

                enemyRectangle = enemy.GetRectangle();
                intersectionRectangle = Rectangle.Intersect(luigiRectangle, enemyRectangle);

                if (!intersectionRectangle.IsEmpty)
                {

                    if (intersectionRectangle.Width >= intersectionRectangle.Height)
                    {
                        sound.Bump();
                        doomedEnemies.Enqueue(enemy);
                        hud.luigiEnemyKill(luigi);
                        enemyKilled = true;
                    }
                    else if (invincible)
                    {
                        doomedEnemies.Enqueue(enemy);
                    }
                    else
                    {
                        myLuigi.Hit();
                        if (luigiRectangle.X < enemyRectangle.X)
                        {
                            xpos = xpos - intersectionRectangle.Width;
                        }
                        else
                        {
                            xpos = xpos + intersectionRectangle.Width;

                        }
                        if (myLuigi.IsDead())
                        {
                            hud.lifeLostLuigi();
                        }
                    }

                }
            }

            while (doomedEnemies.Count() > 0)
            {
                IEnemy enemie = doomedEnemies.Dequeue();
                enemies.Remove(enemie);
            }

            return new Tuple<int,bool>(xpos, enemyKilled);
        }
 public virtual void InternalRemoveAnnualTransactionVolumes(AnnualTransactionVolume __item)
 {
     if (__item == null)
     {
         return;
     }
     annualTransactionVolumes?.Remove(__item);
 }
 public virtual void InternalRemovePermissions(ApplicationPermission __item)
 {
     if (__item == null)
     {
         return;
     }
     permissions?.Remove(__item);
 }
 public virtual void InternalRemoveComments(Comment __item)
 {
     if (__item == null)
     {
         return;
     }
     comments?.Remove(__item);
 }
 public virtual void InternalRemoveScheduledRouteTemplates(ScheduledRouteTemplate __item)
 {
     if (__item == null)
     {
         return;
     }
     scheduledRouteTemplates?.Remove(__item);
 }
 public virtual void InternalRemoveSubCategory(SubCategory __item)
 {
     if (__item == null)
     {
         return;
     }
     subCategory?.Remove(__item);
 }
Exemplo n.º 28
0
 public virtual void InternalRemoveActualVolume(CustomVolume __item)
 {
     if (__item == null)
     {
         return;
     }
     actualVolume?.Remove(__item);
 }
Exemplo n.º 29
0
 public virtual void InternalRemovePlannedVolume(CustomVolume __item)
 {
     if (__item == null)
     {
         return;
     }
     plannedVolume?.Remove(__item);
 }
Exemplo n.º 30
0
 public virtual void InternalRemoveStatusEvolution(StatusEvolution __item)
 {
     if (__item == null)
     {
         return;
     }
     statusEvolution?.Remove(__item);
 }
Exemplo n.º 31
0
 public PartialViewResult EditContactReasonFilter(IList<ContactFilter> filters, ContactReasonFilter filter)
 {
     filters.Remove(filters.FirstOrDefault(cf => cf.Id == filter.Id));
     var contactReason = ContactReasons().FirstOrDefault(cr => cr.Value == filter.Value.ToString());
     filter.Description = contactReason.Text;
     filters.Add(filter);
     return PartialView("DisplayTemplates/contactReasonFilter", filter);
 }
Exemplo n.º 32
0
		public static void Remove(IList<sFace> list,sFace face)
		{
			//if(face->l[1]) face->l[1]->l[0]=face->l[0];
			//if(face->l[0]) face->l[0]->l[1]=face->l[1];
			//if(face==list.root) list.root=face->l[1];
			//--list.count;
			list.Remove(face);
		}
Exemplo n.º 33
0
		void CheckPermissions(IList<NavigationItem> items)
		{
			for (int i = items.Count - 1; i >= 0; i--)
				if (!items[0].CheckPermission() || !HavePermission(items[i]))
					items.Remove(items[i]);
				else
					CheckPermissions(items[i].Childs);
		}
 private void Intersect(IList baseList, IList list)
 {
     foreach (string item in list)
     {
         if (baseList.Contains(item))
             baseList.Remove(item);
     }
 }
Exemplo n.º 35
0
 private void RemoveCategoryAndReorderSiblings(Category category, IList<Category> categories)
 {
     categories.Remove(category);
     for (int i = 0; i < categories.Count; i++)
     {
         categories[i].SetPosition(i);
     }
 }
 public virtual void InternalRemoveTransactions(Transaction __item)
 {
     if (__item == null)
     {
         return;
     }
     transactions?.Remove(__item);
 }
 public virtual void InternalRemoveWorkContract(WorkContract __item)
 {
     if (__item == null)
     {
         return;
     }
     workContract?.Remove(__item);
 }
 public virtual void InternalRemoveStatistics(Statistics __item)
 {
     if (__item == null)
     {
         return;
     }
     statistics?.Remove(__item);
 }
 public virtual void InternalRemoveUsers(ApplicationUser __item)
 {
     if (__item == null)
     {
         return;
     }
     users?.Remove(__item);
 }
Exemplo n.º 40
0
 public virtual void InternalRemovePastOrders(PastOrder __item)
 {
     if (__item == null)
     {
         return;
     }
     pastOrders?.Remove(__item);
 }
Exemplo n.º 41
0
        public static object Poll(IList coll)
        {

            int idx = coll.Count - 1;
            object result = coll[idx];
            coll.Remove(idx);
            return result;
        }
 public virtual void InternalRemoveItems(Item __item)
 {
     if (__item == null)
     {
         return;
     }
     items?.Remove(__item);
 }
 public virtual void InternalRemoveStockOnHands(StockOnHand __item)
 {
     if (__item == null)
     {
         return;
     }
     stockOnHands?.Remove(__item);
 }
Exemplo n.º 44
0
 public virtual void InternalRemoveProducts(OrderProduct __item)
 {
     if (__item == null)
     {
         return;
     }
     products?.Remove(__item);
 }
 public virtual void InternalRemoveAgreementStatuses(AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     agreementStatuses?.Remove(__item);
 }
Exemplo n.º 46
0
        private static void DisposeFacelessFrames(IList<Frame> motionFrames, ImageProcess.Target[] portraits)
        {
            var noPortraitFrameQuery = from m in motionFrames
                                       where !portraits.Any(t => t.BaseFrame.guid.Equals(m.Guid))
                                       select m;

            Array.ForEach(noPortraitFrameQuery.ToArray(), mf => { motionFrames.Remove(mf); mf.Dispose(); });
        }
 public virtual void InternalRemoveWarehouses(Warehouse __item)
 {
     if (__item == null)
     {
         return;
     }
     warehouses?.Remove(__item);
 }
Exemplo n.º 48
0
		/// <summary>
		/// Deletes an element from the datasource.
		/// </summary>
		/// <param name="table">The table from which the element should be deleted.</param>
		/// <param name="element">The element should be deleted.</param>
		public void DeleteElement(IList<XElement> table, XElement element)
		{
			//XElement orderToDelete = (from order in table
			//where order.Attribute(element.Attributes().FirstOrDefault().Name).Value == element.Attributes().FirstOrDefault().Value
			//select order).FirstOrDefault();
			table.Remove(element);
			//orderToDelete.Remove();
		}
 public virtual void InternalRemoveTransportUnCaps(TransportUnCap __item)
 {
     if (__item == null)
     {
         return;
     }
     transportUnCaps?.Remove(__item);
 }
 public virtual void InternalRemoveAcceptedConditions(Condition __item)
 {
     if (__item == null)
     {
         return;
     }
     acceptedConditions?.Remove(__item);
 }
Exemplo n.º 51
0
 public virtual void InternalRemoveDeliveryNoteProducts(DeliveryNoteProduct __item)
 {
     if (__item == null)
     {
         return;
     }
     deliveryNoteProducts?.Remove(__item);
 }
 public virtual void InternalRemovePath(Point __item)
 {
     if (__item == null)
     {
         return;
     }
     path?.Remove(__item);
 }
Exemplo n.º 53
0
        private void RmDir(string dirname, IList<Directory> directoryies)
        {
            var dirobj = directoryies.SingleOrDefault(dir => dir.Name.Equals(dirname));
            if(dirobj == null)
                new Exception("Directoryが存在しません");

            directoryies.Remove(dirobj);
        }
 public virtual void InternalRemoveRAUsers(RegionalAgentUser __item)
 {
     if (__item == null)
     {
         return;
     }
     rAUsers?.Remove(__item);
 }
 public virtual void InternalRemoveOrders(ShippingOrder __item)
 {
     if (__item == null)
     {
         return;
     }
     orders?.Remove(__item);
 }
 public virtual void InternalRemoveAreaSupport(GeoArea __item)
 {
     if (__item == null)
     {
         return;
     }
     areaSupport?.Remove(__item);
 }
        private void DealWithDisable(MonoBehaviour component, IList<RadicalCoroutine> lst)
        {
            if (lst.Count > 0)
            {
                var arr = lst.ToArray();
                var stoppableMode = (this.gameObject.activeInHierarchy) ? RadicalCoroutineDisableMode.StopOnDisable : RadicalCoroutineDisableMode.StopOnDeactivate;
                RadicalCoroutine routine;
                for (int i = 0; i < arr.Length; i++)
                {
                    routine = arr[i];
                    if (routine.DisableMode == RadicalCoroutineDisableMode.CancelOnDeactivate || routine.DisableMode.HasFlag(RadicalCoroutineDisableMode.CancelOnDisable))
                    {
                        routine.Cancel();
                        routine.OnFinished -= this.OnRoutineFinished;
                        lst.Remove(routine);
                    }
                    else
                    {
                        if (routine.DisableMode.HasFlag(stoppableMode))
                        {
                            routine.Stop();
                            if (routine.Finished)
                            {
                                routine.OnFinished -= this.OnRoutineFinished;
                                lst.Remove(routine);
                            }
                        }
                        if (!routine.DisableMode.HasFlag(RadicalCoroutineDisableMode.ResumeOnEnable))
                        {
                            routine.OnFinished -= this.OnRoutineFinished;
                            lst.Remove(routine);
                        }
                    }
                }
            }

            if(lst.Count == 0)
            {
                _routines.Remove(component);
                if(component is SPComponent)
                {
                    (component as SPComponent).OnEnabled -= this.OnComponentEnabled;
                    (component as SPComponent).OnDisabled -= this.OnComponentDisabled;
                }
            }
        }
 public virtual void InternalRemoveTrucks(Truck __item)
 {
     if (__item == null)
     {
         return;
     }
     trucks?.Remove(__item);
 }
 public virtual void InternalRemoveProperties(AuditPropertyConfiguration __item)
 {
     if (__item == null)
     {
         return;
     }
     properties?.Remove(__item);
 }
 public virtual void InternalRemoveShipmentStatus(ShipmentStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     shipmentStatus?.Remove(__item);
 }