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

C# IRuntime类代码示例

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

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



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


示例16: InstallCommand

 public InstallCommand(IRuntime runtime, IFileSystem fileSystem, ICakeEnvironment environment,
     ICakeLog log, INuGetPackageConfigurationCreator packageConfigCreator,
     IFileCopier fileCopier, IHttpDownloader downloader, IGitIgnorePatcher gitIgnorePatcher)
 {
     _runtime = runtime;
     _fileSystem = fileSystem;
     _environment = environment;
     _log = log;
     _packageConfigCreator = packageConfigCreator;
     _fileCopier = fileCopier;
     _downloader = downloader;
     _gitIgnorePatcher = gitIgnorePatcher;
 }
开发者ID:gep13,项目名称:bootstrapper,代码行数:13,代码来源:InstallCommand.cs


示例17: TryGetSupportCode

        public static bool TryGetSupportCode(IRuntime runtime, out string supportCode)
        {
            if (runtime == null || runtime.GetStateStorageContainer() == null)
            {
                supportCode = null;
                return false;
            }
            StateStorageItem item;
            var result = runtime.GetStateStorageContainer().TryGetItem("supportCode", out item);
            if (item != null && item.Value != null) supportCode = (string)item.Value;
            else supportCode = null;
            return result;

        }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:14,代码来源:LoggingActionFilter.cs


示例18: SetMessageValuesIfNotSetInClient

 private static void SetMessageValuesIfNotSetInClient(IRequestBase message, IRuntime runtime)
 {
     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 = ConfigurationManagerHelper.GetValueOnKey("configSet");
     if (message.TimeStamp == null)
         message.TimeStamp = DateTime.UtcNow;
     if (runtime.RequestContext.IsInstance())
         message.ReferingMessageId = runtime.RequestContext.MessageId;
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:15,代码来源:InstanceIdentityInspector.cs


示例19: GetGenerator

        private static LanguageGenerator GetGenerator(string language, string knockoutPrefix, IRuntime runtime)
        {
            switch (language)
                {
                    case TypeScriptGenerator.Id:
                        return new TypeScriptGenerator();

                    case KnockoutMappingGenerator.Id:
                        return new KnockoutMappingGenerator(knockoutPrefix);

                    default:
                        runtime.Error("Unknown language: {0}", language);
                        System.Environment.Exit(-1);
                        return (LanguageGenerator)null;
            }
        }
开发者ID:spelltwister,项目名称:TypeWalker,代码行数:16,代码来源:Program.cs


示例20: NetPlugin

		// --- constructors ---
		internal NetPlugin(string pluginFile, string trainFolder, IRuntime api, TrainManager.Train train) {
			base.PluginTitle = System.IO.Path.GetFileName(pluginFile);
			base.PluginValid = true;
			base.PluginMessage = null;
			base.Train = train;
			base.Panel = null;
			base.SupportsAI = false;
			base.LastTime = 0.0;
			base.LastReverser = -2;
			base.LastPowerNotch = -1;
			base.LastBrakeNotch = -1;
			base.LastAspects = new int[] { };
			base.LastSection = -1;
			base.LastException = null;
			this.PluginFolder = System.IO.Path.GetDirectoryName(pluginFile);
			this.TrainFolder = trainFolder;
			this.Api = api;
			this.SoundHandles = new SoundHandleEx[16];
			this.SoundHandlesCount = 0;
		}
开发者ID:JakubVanek,项目名称:openBVE-1,代码行数:21,代码来源:NetPlugin.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IRuntimeContext类代码示例发布时间:2022-05-24
下一篇:
C# IRunner类代码示例发布时间: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