本文整理汇总了C#中Runtime类的典型用法代码示例。如果您正苦于以下问题:C# Runtime类的具体用法?C# Runtime怎么用?C# Runtime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Runtime类属于命名空间,在下文中一共展示了Runtime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: SetObjectData
public override object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
base.SetObjectData(obj,info,context,selector);
Model model = (Model) obj;
model.SuspendEvents = true;
model.Suspend();
model.AlignGrid = info.GetBoolean("AlignGrid");
model.DragScroll = info.GetBoolean("DragScroll");
model.DrawGrid = info.GetBoolean("DrawGrid");
model.DrawPageLines = info.GetBoolean("DrawPageLines");
model.DrawSelections = info.GetBoolean("DrawSelections");
model.GridColor = Color.FromArgb(Convert.ToInt32(info.GetString("GridColor")));
model.GridSize = Serialize.GetSize(info.GetString("GridSize"));
model.GridStyle = (GridStyle) Enum.Parse(typeof(GridStyle), info.GetString("GridStyle"));
model.PageLineSize = Serialize.GetSizeF(info.GetString("PageLineSize"));
if (Serialize.Contains(info,"DragSelect")) model.DragSelect = info.GetBoolean("DragSelect");
mRuntime = (Runtime) info.GetValue("Runtime",typeof(Runtime));
model.SuspendEvents = false;
model.Resume();
return model;
}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:ModelSerialize.cs
示例17: SelectFrameworks
public static IEnumerable<FrameworkName> SelectFrameworks(Runtime.Project project,
IEnumerable<string> userSelection,
FrameworkName fallbackFramework,
out string errorMessage)
{
var specifiedFrameworks = userSelection.ToDictionary(f => f, FrameworkNameHelper.ParseFrameworkName);
var projectFrameworks = new HashSet<FrameworkName>(
project.GetTargetFrameworks()
.Select(c => c.FrameworkName));
IEnumerable<FrameworkName> frameworks = null;
if (projectFrameworks.Count > 0)
{
// Specified target frameworks have to be a subset of the project frameworks
if (!ValidateFrameworks(projectFrameworks, specifiedFrameworks, out errorMessage))
{
return null;
}
frameworks = specifiedFrameworks.Count > 0 ? specifiedFrameworks.Values : (IEnumerable<FrameworkName>)projectFrameworks;
}
else
{
frameworks = new[] { fallbackFramework };
}
errorMessage = string.Empty;
return frameworks;
}
开发者ID:elanwu123,项目名称:dnx,代码行数:31,代码来源:FrameworkSelectionHelper.cs
示例18: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Runtime kinectRuntime = new Runtime();
kinectRuntime.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking);
kinectRuntime.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);
kinectRuntime.SkeletonFrameReady += kinectRuntime_SkeletonFrameReady;
kinectRuntime.DepthFrameReady += kinectRuntime_DepthFrameReady;
kinectRuntime.SkeletonEngine.TransformSmooth = true;
var parameters = new TransformSmoothParameters
{
Smoothing = 0.75f,
Correction = 0.0f,
Prediction = 0.0f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.04f
};
kinectRuntime.SkeletonEngine.SmoothParameters = parameters;
using (game = new Game1())
{
game.Exiting += game_Exiting;
game.Run();
}
kinectRuntime.Uninitialize();
}
开发者ID:ProjPossibility,项目名称:USC-AccessibleKinect,代码行数:30,代码来源:MainWindow.xaml.cs
示例19: AssemblyUtil
private static Dictionary<string, Type> _typeTable = new Dictionary<string, Type>(); // <type name, Type> pairs.
#endregion Fields
#region Constructors
static AssemblyUtil()
{
PlatformID id = Environment.OSVersion.Platform;
if( id == PlatformID.Win32NT
|| id == PlatformID.Win32S
|| id == PlatformID.Win32Windows
|| id == PlatformID.WinCE)
{
platform_ = Platform.Windows;
}
else
{
platform_ = Platform.NonWindows;
}
if(System.Type.GetType("Mono.Runtime") != null)
{
runtime_ = Runtime.Mono;
}
else
{
runtime_ = Runtime.DotNET;
}
System.Version v = System.Environment.Version;
runtimeMajor_ = v.Major;
runtimeMinor_ = v.Minor;
runtimeBuild_ = v.Build;
runtimeRevision_ = v.Revision;
v = System.Environment.OSVersion.Version;
osx_ = false;
if (platform_ == Platform.NonWindows)
{
try
{
Assembly a = Assembly.Load(
"Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
Type syscall = a.GetType("Mono.Unix.Native.Syscall");
if(syscall != null)
{
MethodInfo method = syscall.GetMethod("uname", BindingFlags.Static | BindingFlags.Public);
if(method != null)
{
object[] p = new object[1];
method.Invoke(null, p);
if(p[0] != null)
{
Type utsname = a.GetType("Mono.Unix.Native.Utsname");
osx_ = ((string)utsname.GetField("sysname").GetValue(p[0])).Equals("Darwin");
}
}
}
}
catch(System.Exception)
{
}
}
}
开发者ID:externl,项目名称:ice,代码行数:66,代码来源:AssemblyUtil.cs
示例20: Platform
static Platform()
{
int p = (int)Environment.OSVersion.Platform;
_os = ((p == 4) || (p == 128)) ? OS.Linux : OS.Windows;
_runtime = (Type.GetType("System.MonoType", false) != null) ? Runtime.Mono : Runtime.DotNet;
}
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:7,代码来源:Platform.cs
注:本文中的Runtime类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论