سلام بر تمامی برنامه نویسان عزیز 😉 در این مطلب کد Action collection » Generic Collection در سی شارپ #C را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
خروجی کد به این صورت می باشد :
console
کد Action collection » Generic Collection در سی شارپ #C :
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
class ActionCollection<T> : Collection<T>
{
private Action<T> action;
public ActionCollection(Action<T> action)
{
this.action = action;
}
protected override void InsertItem(int index, T item)
{
action(item);
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
class ActionCollection<T> : Collection<T>
{
private Action<T> action;
public ActionCollection(Action<T> action)
{
this.action = action;
}
protected override void InsertItem(int index, T item)
{
action(item);