当前位置: 首页>>代码示例>>C#>>正文


C# IRuntime类代码示例

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


IRuntime类属于命名空间,在下文中一共展示了IRuntime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IavaCamera

        /// <summary>
        /// Constructor used for unit testing
        /// </summary>
        /// <param name="runtime">IRuntime object to provide the data to the camera</param>
        internal IavaCamera(IRuntime runtime)
        {
            // Set the IRuntime object
            _runtime = runtime;

            InitializeDevice();
        }
开发者ID:TheCoderPal,项目名称:cpe-656-helix-kinect,代码行数:11,代码来源:IavaCamera.cs

示例2: SetMessageValuesIfNotSetInClient

        private static void SetMessageValuesIfNotSetInClient(RequestHeader message, IRuntime runtime)
        {
            if (runtime == null) return;
            if (message.MessageId.IsNullOrWhiteSpace())
                message.MessageId = Guid.NewGuid().ToString();
            if (message.Environment.IsNullOrWhiteSpace())
                message.Environment = runtime.Environment;
            if (message.ServiceName.IsNullOrWhiteSpace())
                message.ServiceName = runtime.ServiceName;
            if (message.ConfigSet.IsNullOrWhiteSpace())
                message.ConfigSet = Utilities.GetConfigSetName();
            if (message.TimeStamp == null)
                message.TimeStamp = DateTime.UtcNow;
            if (runtime.RequestContext.IsInstance() && runtime.RequestContext.RequestHeader.IsInstance())
            {
                message.ReferingMessageId = runtime.RequestContext.RequestHeader.MessageId;

            }
            string supportCode;
            if (runtime.TryGetSupportCode(out supportCode)) message.SupportCode = supportCode;
            else
            {
                if (runtime.RequestContext.IsInstance() && runtime.RequestContext.RequestHeader.IsInstance())
                {
                    message.SupportCode = runtime.RequestContext.RequestHeader.SupportCode;
                }
            }
        }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:28,代码来源:ClientHeaderInspector.cs

示例3: PartCoverTestIsolationProvider

        /// <summary>
        /// Initializes the isolation provider.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="runtime"/> is null.</exception>
        public PartCoverTestIsolationProvider(IRuntime runtime)
        {
            if (runtime == null)
                throw new ArgumentNullException("runtime");

            this.runtime = runtime;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:12,代码来源:PartCoverTestIsolationProvider.cs

示例4: ReportPrimes

 private static void ReportPrimes(IRuntime runtime, List<int> primes, int n, int client)
 {
     // item 229
     string[] primesAsText = primes
     .Select(p => p.ToString())
     .ToArray();
     // item 226
     string primeString = String.Join(
     "\n",
     primesAsText
     );
     // item 227
     string result = String.Format(
     "Prime numbers up to {0}: {1} found:\n{2}",
     n,
     primes.Count,
     primeString
     );
     // item 228
     runtime.SendMessage(
     client,
     CallResult.Completed,
     result,
     0
     );
 }
开发者ID:snjee,项目名称:actor-http,代码行数:26,代码来源:GuiMachines.cs

示例5: DownloadCompleted

 private static void DownloadCompleted(IRuntime runtime, int caller, DownloadDataCompletedEventArgs e)
 {
     // item 255
     if (e.Cancelled) {
     // item 258
     runtime.SendMessage(
         caller,
         Cancel,
         null,
         0
     );
     } else {
     // item 259
     if (e.Error == null) {
         // item 262
         runtime.SendMessage(
             caller,
             CallResult.Completed,
             e.Result,
             0
         );
     } else {
         // item 261
         runtime.SendMessage(
             caller,
             CallResult.Error,
             e.Error,
             0
         );
     }
     }
 }
开发者ID:snjee,项目名称:actor-http,代码行数:32,代码来源:GuiMachines.cs

示例6: IsolatedProcessHostFactory

        /// <summary>
        /// Creates a host factory.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="runtime"/> is null.</exception>
        public IsolatedProcessHostFactory(IRuntime runtime)
        {
            if (runtime == null)
                throw new ArgumentNullException("runtime");

            runtimePath = runtime.GetRuntimeSetup().RuntimePath;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:12,代码来源:IsolatedProcessHostFactory.cs

示例7: ExternalThread

 public ExternalThread(string name, IRuntime runtime, IActorLogger logger, IErrorHandler errorHandler, Action<Action> dispatchMethod)
 {
     _name = name;
     _runtime = runtime;
     _logger = logger;
     _errorHandler = errorHandler;
     _dispatcher = dispatchMethod;
 }
开发者ID:snjee,项目名称:actor-http,代码行数:8,代码来源:ExternalThread.cs

示例8: NCoverTestIsolationProvider

        /// <summary>
        /// Initializes the isolation provider.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <param name="version">The NCover version.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="runtime"/> is null.</exception>
        public NCoverTestIsolationProvider(IRuntime runtime, NCoverVersion version)
        {
            if (runtime == null)
                throw new ArgumentNullException("runtime");

            this.runtime = runtime;
            this.version = version;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:14,代码来源:NCoverTestIsolationProvider.cs

示例9: CreateSeleniumArgs

        public static LazyDownloadArgs CreateSeleniumArgs(IRuntime runtime, int line, int threadCount, string cssElement, int cssTimeout, Table<ResultRow> table)
        {
            var args = new LazyDownloadArgs(runtime, threadCount);
            foreach (var row in table)
                args.Wires.Add(new SeleniumHttpWire(row[0].ToString(), cssElement, cssTimeout, runtime, line));

            return args;
        }
开发者ID:bitsummation,项目名称:pickaxe,代码行数:8,代码来源:LazyDownloadArgs.cs

示例10: CreateWebRequestArgs

        public static LazyDownloadArgs CreateWebRequestArgs(IRuntime runtime, int line, int threadCount, Table<ResultRow> table)
        {
            var args = new LazyDownloadArgs(runtime, threadCount);
            foreach (var row in table)
                args.Wires.Add(new WebRequestHttpWire(row[0].ToString(), runtime, line));

            return args;
        }
开发者ID:bitsummation,项目名称:pickaxe,代码行数:8,代码来源:LazyDownloadArgs.cs

示例11: Deactivate

 public static void Deactivate(IRuntime runtime)
 {
     lock (_currentLock)
     {
         _active.ContainsKey(Thread.CurrentThread).AssertTrue();
         ReferenceEquals(_active[Thread.CurrentThread], runtime).AssertTrue();
         _active.Remove(Thread.CurrentThread);
     }
 }
开发者ID:xeno-by,项目名称:conflux,代码行数:9,代码来源:Runtimes.cs

示例12: DedicatedThread

 public DedicatedThread(string name, IRuntime runtime, IActorLogger logger, IErrorHandler errorHandler, int actorId, IActor actor)
 {
     _actor = actor;
     _actorId = actorId;
     _name = name;
     _runtime = runtime;
     _logger = logger;
     _errorHandler = errorHandler;
 }
开发者ID:snjee,项目名称:actor-http,代码行数:9,代码来源:DedicatedThread.cs

示例13: DownloadImage

        public static RuntimeTable<DownloadImage> DownloadImage(IRuntime runtime, string url, int line)
        {
            var table = new RuntimeTable<DownloadImage>();

            var image = GetImage(runtime.RequestFactory, new WebRequestHttpWire(url, runtime, line));

            table.Add(image);
            return table;
        }
开发者ID:bitsummation,项目名称:pickaxe,代码行数:9,代码来源:Http.cs

示例14: Activate

 public static IDisposable Activate(IRuntime runtime)
 {
     lock (_currentLock)
     {
         _active.ContainsKey(Thread.CurrentThread).AssertFalse();
         _active.ContainsValue(runtime).AssertFalse();
         _active.Add(Thread.CurrentThread, runtime);
         return new DisposableAction(() => Deactivate(runtime));
     }
 }
开发者ID:xeno-by,项目名称:conflux,代码行数:10,代码来源:Runtimes.cs

示例15: DownloadPage

        private static RuntimeTable<DownloadPage> DownloadPage(IRuntime runtime, IHttpWire[] wires)
        {
            var table = new RuntimeTable<DownloadPage>();
            foreach (var wire in wires)
            {
                int contentlength;
                var doc = GetDocument(runtime.RequestFactory, wire, out contentlength);
                table.Add(new DownloadPage() { url = wire.Url, nodes = new[] { doc.DocumentNode }, date = DateTime.Now, size = contentlength });
            }

            return table;
        }
开发者ID:bitsummation,项目名称:pickaxe,代码行数:12,代码来源:Http.cs


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