本文整理汇总了C#中IWorker类的典型用法代码示例。如果您正苦于以下问题:C# IWorker类的具体用法?C# IWorker怎么用?C# IWorker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWorker类属于命名空间,在下文中一共展示了IWorker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DerefResults
public DerefResults( IWorker worker, IList<IWorker> workerList )
{
_worker = worker;
_workerList = workerList;
Debug.Assert( _worker == null || _workerList == null );
Debug.Assert( _workerList == null || _workerList.Count > 0 );
}
示例2: Scheduler
public Scheduler(IPluginFinder plugins, IHeart heart, IWorker worker, IErrorNotifier errorHandler)
{
_actions = new List<ScheduledAction>(InstantiateActions(plugins));
_heart = heart;
_worker = worker;
_errorHandler = errorHandler;
}
示例3: ContentChangeTracker
public ContentChangeTracker(IIndexer indexer, IPersister persister, IWorker worker, ConnectionMonitor connection, IErrorNotifier errors, DatabaseSection config)
{
this.indexer = indexer;
this.persister = persister;
this.worker = worker;
this.errors = errors;
this.async = config.Search.AsyncIndexing;
this.handleErrors = config.Search.HandleErrors;
RetryInterval = TimeSpan.FromMinutes(2);
if(config.Search.Enabled)
{
connection.Online += delegate
{
persister.ItemSaved += persister_ItemSaved;
persister.ItemMoving += persister_ItemMoving;
persister.ItemMoved += persister_ItemMoved;
persister.ItemCopied += persister_ItemCopied;
persister.ItemDeleted += persister_ItemDeleted;
};
connection.Offline += delegate
{
persister.ItemSaved -= persister_ItemSaved;
persister.ItemMoving -= persister_ItemMoving;
persister.ItemMoved -= persister_ItemMoved;
persister.ItemCopied -= persister_ItemCopied;
persister.ItemDeleted -= persister_ItemDeleted;
};
}
}
示例4: Execute
public void Execute(IWorker[] workers, int runningSecs)
{
IAsyncResult[] ar = new IAsyncResult[workers.Length];
int i = 0;
foreach (IWorker w in workers) {
w.WorkerID = i;
ThreadStart t = new ThreadStart(w.DoWork);
ar[i++] = t.BeginInvoke(null, null);
}
//for (int j = 0; j < runningSecs * 10; j++)
//{
// Console.Write(".");
// Thread.Sleep(100);
//}
Thread.Sleep(runningSecs * 1000);
Console.WriteLine();
foreach (IWorker w in workers) {
w.Running = false;
}
bool timeOut = false;
foreach (IAsyncResult a in ar) {
if (!a.IsCompleted)
{
if (!a.AsyncWaitHandle.WaitOne(1000))
timeOut = true;
}
}
if (timeOut)
Console.WriteLine("Timed Out!");
}
示例5: AsyncTrashPurger
public AsyncTrashPurger(IWorker worker, ITrashHandler trash, IPersister persister, ISecurityManager security)
{
this.worker = worker;
this.trash = trash;
this.persister = persister;
this.security = security;
}
示例6: setProperty
public void setProperty(Identifier propName, IWorker worker)
{
throw new ClientException(
String.Format(
"attempted to set property '{0}' of a null value",
propName));
}
示例7: StockView
public StockView(IWorker worker)
: base(worker)
{
this.StockItemsCollection = new NotifiedObservableCollection<StockIngredientDTO>();
this.RemovedStockItemsList = new List<StockIngredientDTO>();
ResetIds();
}
示例8: Remove
public void Remove(IWorker worker)
{
lock (this.fSyncRoot)
{
worker.Done -= OnDone;
base.Remove(worker);
}
}
示例9: Add
public void Add(IWorker worker)
{
lock (this.fSyncRoot)
{
worker.Done += OnDone;
base.Add(worker);
}
}
示例10: ClientMainView
public ClientMainView(IWorker worker)
: base(worker)
{
this.IngredientsCollection = new ObservableCollection<PizzaNetControls.IngredientsRow>();
this.RecipesCollection = new ObservableCollection<PizzaNetControls.RecipeControl>();
this.OrderedPizzasCollection = new ObservableCollection<IngredientsList>();
this.Ingredients = new List<OrderIngredientDTO>();
}
示例11: RedisBackend
public RedisBackend(IRedis redisClient, QueuedItem payload, Exception exception, IWorker worker, string queue)
{
RedisClient = redisClient;
Payload = payload;
Exception = exception;
Worker = worker;
Queue = queue;
}
示例12: BaseWorkerHost
protected BaseWorkerHost(IWorker worker)
{
worker.Require("worker");
Worker = worker;
Worker.ErrorOccurred += OnErrorOccurred;
Worker.MessageOccurred += OnMessageOccurred;
}
示例13: RecipiesView
public RecipiesView(IWorker worker)
: base(worker)
{
this.IngredientsRowsCollection = new ObservableCollection<IngredientsRowWork>();
this.RecipesCollection = new ObservableCollection<RecipeControl>();
this.RemovedRecipes = new List<RecipeDTO>(5);
SelectedRecipe = -1;
Modified = false;
}
示例14: cast
public static IWorker cast(IWorker source, IInterface face)
{
if( inheritsOrIs(source.face, face) )
return castDown(source, face);
source = source.owner.rootWorker;
if( inheritsOrIs(source.face, face) )
return castDown(source, face);
throw new ClientException("the object does not implement this interface");
}
示例15: Scheduler
public Scheduler(IEngine engine, IPluginFinder plugins, IHeart heart, IWorker worker, IWebContext context, IErrorNotifier errorHandler)
{
this.engine = engine;
actions = new List<ScheduledAction>(InstantiateActions(plugins));
this.heart = heart;
this.worker = worker;
this.context = context;
this.errorHandler = errorHandler;
}