• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IWorker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IWorker的典型用法代码示例。如果您正苦于以下问题:C# IWorker类的具体用法?C# IWorker怎么用?C# IWorker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IWorker类属于命名空间,在下文中一共展示了IWorker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 );
 }
开发者ID:JamesJustinHarrell,项目名称:niviok,代码行数:7,代码来源:DerefResults.cs


示例2: Scheduler

 public Scheduler(IPluginFinder plugins, IHeart heart, IWorker worker, IErrorNotifier errorHandler)
 {
     _actions = new List<ScheduledAction>(InstantiateActions(plugins));
     _heart = heart;
     _worker = worker;
     _errorHandler = errorHandler;
 }
开发者ID:pauldotknopf,项目名称:Noodle,代码行数:7,代码来源:Scheduler.cs


示例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;
                };
            }
        }
开发者ID:Jobu,项目名称:n2cms,代码行数:31,代码来源:ContentChangeTracker.cs


示例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!");
        }
开发者ID:AveProjVstm,项目名称:MonoVstmTests,代码行数:32,代码来源:ExecutorThreadPool.cs


示例5: AsyncTrashPurger

 public AsyncTrashPurger(IWorker worker, ITrashHandler trash, IPersister persister, ISecurityManager security)
 {
     this.worker = worker;
     this.trash = trash;
     this.persister = persister;
     this.security = security;
 }
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:7,代码来源:AsyncTrashPurger.cs


示例6: setProperty

 public void setProperty(Identifier propName, IWorker worker)
 {
     throw new ClientException(
     String.Format(
         "attempted to set property '{0}' of a null value",
         propName));
 }
开发者ID:JamesJustinHarrell,项目名称:niviok,代码行数:7,代码来源:Null.cs


示例7: StockView

 public StockView(IWorker worker)
     : base(worker)
 {
     this.StockItemsCollection = new NotifiedObservableCollection<StockIngredientDTO>();
     this.RemovedStockItemsList = new List<StockIngredientDTO>();
     ResetIds();
 }
开发者ID:pawelkobojek,项目名称:PizzaNet,代码行数:7,代码来源:StockView.cs


示例8: Remove

		public void Remove(IWorker worker)
		{
			lock (this.fSyncRoot)
			{
				worker.Done -= OnDone;
				base.Remove(worker);
			}
		}
开发者ID:remobjects,项目名称:internetpack,代码行数:8,代码来源:WorkerCollection.cs


示例9: Add

		public void Add(IWorker worker)
		{
			lock (this.fSyncRoot)
			{
				worker.Done += OnDone;
				base.Add(worker);
			}
		}
开发者ID:remobjects,项目名称:internetpack,代码行数:8,代码来源:WorkerCollection.cs


示例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>();
 }
开发者ID:pawelkobojek,项目名称:PizzaNet,代码行数:8,代码来源:ClientMainView.cs


示例11: RedisBackend

 public RedisBackend(IRedis redisClient, QueuedItem payload, Exception exception, IWorker worker, string queue)
 {
     RedisClient = redisClient;
     Payload = payload;
     Exception = exception;
     Worker = worker;
     Queue = queue;
 }
开发者ID:paulduran,项目名称:Resque.NET,代码行数:8,代码来源:RedisBackend.cs


示例12: BaseWorkerHost

        protected BaseWorkerHost(IWorker worker)
        {
            worker.Require("worker");

            Worker = worker;

            Worker.ErrorOccurred += OnErrorOccurred;
            Worker.MessageOccurred += OnMessageOccurred;
        }
开发者ID:sonbua,项目名称:Mantle,代码行数:9,代码来源:BaseWorkerHost.cs


示例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;
 }
开发者ID:pawelkobojek,项目名称:PizzaNet,代码行数:9,代码来源:RecipiesView.cs


示例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");
 }
开发者ID:JamesJustinHarrell,项目名称:niviok,代码行数:9,代码来源:globals.cs


示例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;
 }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:9,代码来源:Scheduler.cs


示例16: ParameterImpl

        public ParameterImpl(
	Direction direction, IType type,
	Identifier name, IWorker defaultValue )
        {
            _direction = direction;
            _type = type;
            _name = name;
            _defaultValue = defaultValue;
        }
开发者ID:JamesJustinHarrell,项目名称:niviok,代码行数:9,代码来源:ParameterImpl.cs


示例17: RegisterRequest

		internal int RegisterRequest (IWorker worker)
		{
			int result = worker.GetHashCode ();
			lock (requests) {
				requests [result] = worker;
			}

			return result;
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:9,代码来源:BaseRequestBroker.cs


示例18: Job

 public Job(JobFactory creator, IFailureService failureService, IWorker worker, QueuedItem item,
            string queue)
 {
     Creator = creator;
     FailureService = failureService;
     Worker = worker;
     Payload = item;
     Queue = queue;
 }
开发者ID:paulduran,项目名称:Resque.Bootstrap.Autofac,代码行数:9,代码来源:JobFactory.cs


示例19: castDown

 public static IWorker castDown(IWorker source, IInterface face)
 {
     Debug.Assert(inheritsOrIs(source.face, face));
     if( source.face == face )
     return source;
     foreach( IWorker child in source.childWorkers )
     if( inheritsOrIs(child.face, face) )
         return castDown(child, face);
     throw new ClientException("the object does not implement this interface");
 }
开发者ID:JamesJustinHarrell,项目名称:niviok,代码行数:10,代码来源:globals.cs


示例20: AddWorker

        public void AddWorker(IWorker worker)
        {
            if (_isRootInstance)
            {
                Thread workerThread = new Thread(RunWorker);
                workerThread.Start(worker);

                _workerThreads.Add(workerThread);
            }
        }
开发者ID:petrohi,项目名称:Stratosphere,代码行数:10,代码来源:WorkerInstance.cs



注:本文中的IWorker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWorkerContext类代码示例发布时间:2022-05-24
下一篇:
C# IWorkbook类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap