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


C# Runtime类代码示例

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


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

示例1: SetupKinect

        private void SetupKinect()
        {
            if (Runtime.Kinects.Count == 0)
            {
                this.Title = "No Kinect connected"; 
            }
            else
            {
                //use first Kinect
                nui = Runtime.Kinects[0];

                //Initialize to do skeletal tracking
                nui.Initialize(RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor | RuntimeOptions.UseDepthAndPlayerIndex);

                //add event to receive skeleton data
                nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

                //to experiment, toggle TransformSmooth between true & false and play with parameters            
                nui.SkeletonEngine.TransformSmooth = true;
                TransformSmoothParameters parameters = new TransformSmoothParameters();
                // parameters used to smooth the skeleton data
                parameters.Smoothing = 0.3f;
                parameters.Correction = 0.3f;
                parameters.Prediction = 0.4f;
                parameters.JitterRadius = 0.7f;
                parameters.MaxDeviationRadius = 0.2f;
                nui.SkeletonEngine.SmoothParameters = parameters;

            }
        }
开发者ID:guozanhua,项目名称:kinect-earth,代码行数:30,代码来源:MainWindow.xaml.cs

示例2: CreateLockFileTargetLibrary

        public static LockFileTargetLibrary CreateLockFileTargetLibrary(Runtime.Project projectDependency,
                                                                        RestoreContext context)
        {
            var targetFrameworkInfo = projectDependency.GetCompatibleTargetFramework(context.FrameworkName);

            var lockFileLib = new LockFileTargetLibrary
            {
                Name = projectDependency.Name,
                Version = projectDependency.Version,
                TargetFramework = targetFrameworkInfo.FrameworkName, // null TFM means it's incompatible
                Type = "project"
            };

            var dependencies = projectDependency.Dependencies.Concat(targetFrameworkInfo.Dependencies);

            foreach (var dependency in dependencies)
            {
                if (dependency.LibraryRange.IsGacOrFrameworkReference)
                {
                    lockFileLib.FrameworkAssemblies.Add(
                        LibraryRange.GetAssemblyName(dependency.LibraryRange.Name));
                }
                else
                {
                    lockFileLib.Dependencies.Add(new PackageDependency(
                        dependency.LibraryRange.Name, 
                        dependency.LibraryRange.VersionRange));
                }
            }

            return lockFileLib;
        }
开发者ID:leloulight,项目名称:dnx,代码行数:32,代码来源:LockFileUtils.cs

示例3: Platform

        static Platform()
        {
            var p = (int) Environment.OSVersion.Platform;
            OS = ((p == 4) || (p == 6) || (p == 128)) ? OS.Unix : OS.Windows;

            Runtime = (Type.GetType("Mono.Runtime") == null) ? Runtime.Mono : Runtime.DotNet;
        }
开发者ID:0x0all,项目名称:FFTTools,代码行数:7,代码来源:Platform.cs

示例4:

        //public ArrayList PayLoad
        //{
        //    get { return _payLoad; }
        //}

        //public ArrayList PayLoadCompilationInfo
        //{
        //    get { return _payLoadCompilationInformation; }
        //}

        #region ICompactSerializable Members

        void Runtime.Serialization.ICompactSerializable.Deserialize(Runtime.Serialization.IO.CompactReader reader)
        {
            data = (HashVector)reader.ReadObject();
            transferCompleted = reader.ReadBoolean();
            //_payLoadCompilationInformation = reader.ReadObject() as ArrayList;
            this.sendDataSize = reader.ReadInt64();
        }
开发者ID:javithalion,项目名称:NCache,代码行数:19,代码来源:StateTxfrInfo.cs

示例5: RetryForExceptionAsync

        /// <summary>
        /// Return true if the request should be retried. Implements additional checks 
        /// specific to S3 on top of the checks in DefaultRetryPolicy.
        /// </summary>
        /// <param name="executionContext">Request context containing the state of the request.</param>
        /// <param name="exception">The exception thrown by the previous request.</param>
        /// <returns>Return true if the request should be retried.</returns>
        public override async Task<bool> RetryForExceptionAsync(Runtime.IExecutionContext executionContext, Exception exception)
        {
            var syncResult = RetryForExceptionSync(executionContext, exception);
            if (syncResult.HasValue)
            {
                return syncResult.Value;
            }
            else
            {
                var serviceException = exception as AmazonServiceException;
                string correctedRegion = null;
                AmazonS3Uri s3BucketUri;
                if (AmazonS3Uri.TryParseAmazonS3Uri(executionContext.RequestContext.Request.Endpoint, out s3BucketUri))
                {
                    var credentials = executionContext.RequestContext.ImmutableCredentials;
                    correctedRegion = await BucketRegionDetector.DetectMismatchWithHeadBucketFallbackAsync(s3BucketUri, serviceException, credentials).ConfigureAwait(false);
                }

                if (correctedRegion == null)
                {
                    return base.RetryForException(executionContext, exception);
                }
                else
                {
                    // change authentication region of request and signal the handler to sign again with the new region
                    executionContext.RequestContext.Request.AuthenticationRegion = correctedRegion;
                    executionContext.RequestContext.IsSigned = false;
                    return true;
                }
            }
        }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:38,代码来源:AmazonS3RetryPolicy.cs

示例6: InstallBuilder

 public InstallBuilder(Runtime.Project project, IPackageBuilder packageBuilder, Reports buildReport)
 {
     _project = project;
     _packageBuilder = packageBuilder;
     _buildReport = buildReport;
     IsApplicationPackage = project.Commands.Any();
 }
开发者ID:elanwu123,项目名称:dnx,代码行数:7,代码来源:InstallBuilder.cs

示例7: Main

    public static void Main(string[] args)
    {
        var runtime = new Runtime();
        runtime.Initialize(RuntimeOptions.UseSkeletalTracking);

        var observer = runtime.SkeletonFrameReadyAsObservable();
    }
开发者ID:zoetrope,项目名称:ReactiveRTM,代码行数:7,代码来源:Program.cs

示例8: AddKinectViewer

 private void AddKinectViewer(Runtime runtime)
 {
     var kinectViewer = new KinectDiagnosticViewer();
     kinectViewer.kinectDepthViewer.MouseLeftButtonDown += new MouseButtonEventHandler(kinectDepthViewer_MouseLeftButtonDown);
     kinectViewer.Kinect= runtime;
     viewerHolder.Items.Add(kinectViewer);
 }
开发者ID:CarlaH,项目名称:KinectCollectingData,代码行数:7,代码来源:MainWindow.xaml.cs

示例9: PrintGoal

 private void PrintGoal (Runtime.Goal goal, string type)
 {
     sb.Append (type);
     sb.Append (new string (' ', 4 * goal.Level));
     Runtime.SolutionTreePrinter.Print (goal, sb);
     sb.AppendLine();
 }
开发者ID:carriercomm,项目名称:prolog,代码行数:7,代码来源:Tracer.cs

示例10: Project

        public Project(Runtime.Project runtimeProject)
        {
            ProjectFile = runtimeProject.ProjectFilePath;
            ProjectDirectory = runtimeProject.ProjectDirectory;

            Files = runtimeProject.Files.SourceFiles.Concat(
                    runtimeProject.Files.ResourceFiles.Values.Concat(
                    runtimeProject.Files.PreprocessSourceFiles.Concat(
                    runtimeProject.Files.SharedFiles))).Concat(
                    new string[] { runtimeProject.ProjectFilePath })
                .ToList();

            var projectLockJsonPath = Path.Combine(runtimeProject.ProjectDirectory, LockFileReader.LockFileName);
            var lockFileReader = new LockFileReader();

            if (File.Exists(projectLockJsonPath))
            {
                var lockFile = lockFileReader.Read(projectLockJsonPath);
                ProjectDependencies = lockFile.ProjectLibraries.Select(dep => GetProjectRelativeFullPath(dep.Path)).ToList();
            }
            else
            {
                ProjectDependencies = new string[0];
            }
        }
开发者ID:robbert229,项目名称:dnx-watch,代码行数:25,代码来源:Project.cs

示例11: Init

        public void Init(Ioctls ioctls, Core core, Runtime runtime)
        {
            ioctls.maAudioDataCreateFromResource = delegate(int _mime, int _data, int _offset, int _length, int _flags)
            {

                return MoSync.Constants.MA_AUDIO_ERR_INVALID_SOUND_FORMAT;
            };

            ioctls.maAudioDataDestroy = delegate(int _audioData)
            {

                return MoSync.Constants.MA_AUDIO_ERR_OK;
            };

            ioctls.maAudioInstanceCreate = delegate(int _audioData)
            {

                return MoSync.Constants.MA_AUDIO_ERR_INVALID_DATA;
            };

            ioctls.maAudioInstanceDestroy = delegate(int _audioInstance)
            {

                return MoSync.Constants.MA_AUDIO_ERR_OK;
            };

            ioctls.maAudioPlay = delegate(int _audioInstance)
            {

                return MoSync.Constants.MA_AUDIO_ERR_OK;
            };
        }
开发者ID:N00bKefka,项目名称:MoSync,代码行数:32,代码来源:MoSyncAudioModule.cs

示例12: Deserialize

 public void Deserialize(Runtime.Serialization.IO.CompactReader reader)
 {
     _cacheCleared = reader.ReadBoolean();
     _itemAdded = reader.ReadBoolean();
     _itemRemoved = reader.ReadBoolean();
     _itemUpdated = reader.ReadBoolean();
 }
开发者ID:javithalion,项目名称:NCache,代码行数:7,代码来源:EventStatus.cs

示例13: Init

        public void Init(Ioctls ioctls, Core core, Runtime runtime)
        {
            //			ioctls.maAudioDataCreateFromFile = delegate(int _mime, int _filename, int _flags)
            //			{
            //				return MoSync.Constants.MA_AUDIO_ERR_INVALID_SOUND_FORMAT;
            //			};

            ioctls.maAudioDataCreateFromResource = delegate(int _mime, int _data, int _offset, int _length, int _flags)
            {
                return MoSync.Constants.IOCTL_UNAVAILABLE;
            };

            ioctls.maAudioDataDestroy = delegate(int _audioData)
            {
                return MoSync.Constants.IOCTL_UNAVAILABLE;
            };

            ioctls.maAudioInstanceCreate = delegate(int _audioData)
            {
                return MoSync.Constants.IOCTL_UNAVAILABLE;
            };

            ioctls.maAudioInstanceDestroy = delegate(int _audioInstance)
            {
                return MoSync.Constants.IOCTL_UNAVAILABLE;
            };

            ioctls.maAudioPlay = delegate(int _audioInstance)
            {
                return MoSync.Constants.IOCTL_UNAVAILABLE;
            };
        }
开发者ID:JennYung,项目名称:MoSync,代码行数:32,代码来源:MoSyncAudioModule.cs

示例14: buttonStart_Click

        private void buttonStart_Click(object sender, EventArgs e)
        {
            _nui = Runtime.Kinects.FirstOrDefault();
              if (_nui != null)
              {
            if (buttonStart.Text == Resources.Form1_buttonStart_Click_Start)
            {
              buttonStart.Text = Resources.Form1_buttonStart_Click_Stop;

              _nui.Initialize(RuntimeOptions.UseColor);
              _nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

              _nui.VideoFrameReady += FrameReady;
            }
            else if (buttonStart.Text == Resources.Form1_buttonStart_Click_Stop)
            {
              buttonStart.Text = Resources.Form1_buttonStart_Click_Start;
              _nui.Uninitialize();
            }
              }
              else
              {
            var dr = MessageBox.Show(Resources.Form1_buttonStart_Click_Please_connect_a_Microsoft_Kinect_to_the_computer,
                                 Resources.Form1_buttonStart_Click_Error, MessageBoxButtons.RetryCancel);
            if (dr == DialogResult.Retry)
            {
              buttonStart_Click(sender, e);
            }
              }
        }
开发者ID:felixpp,项目名称:KinectTester,代码行数:30,代码来源:KinectTesterForm.cs

示例15: SetupKinect

        private void SetupKinect()
        {
            // Check to see if there are any Kinect devices connected.
            if (Runtime.Kinects.Count == 0)
            {
                MessageBox.Show("No Kinect connected");
            }
            else
            {
                // Use first Kinect.
                kinectRuntime = Runtime.Kinects[0];

                // Initialize to return skeletal data.
                kinectRuntime.Initialize(RuntimeOptions.UseSkeletalTracking);

                // Attach to the event to receive skeleton frame data.
                kinectRuntime.SkeletonFrameReady += KinectRuntime_SkeletonFrameReady;

                kinectRuntime.SkeletonEngine.TransformSmooth = true;

                TransformSmoothParameters parameters = new TransformSmoothParameters();
                parameters.Smoothing = 0.5f;
                parameters.Correction = 0.3f;
                parameters.Prediction = 0.2f;
                parameters.JitterRadius = .2f;
                parameters.MaxDeviationRadius = 0.5f;

                kinectRuntime.SkeletonEngine.SmoothParameters = parameters;

                kinectRuntime.NuiCamera.ElevationAngle = 0;
            }
        }
开发者ID:NashDotNet,项目名称:Intro-to-Developing-for-the-Kinect,代码行数:32,代码来源:MainWindow.xaml.cs


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