本文整理汇总了C#中Platform类的典型用法代码示例。如果您正苦于以下问题:C# Platform类的具体用法?C# Platform怎么用?C# Platform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Platform类属于命名空间,在下文中一共展示了Platform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InfoService
public InfoService (Platform platform, VLogger logger)
{
this.platform = platform;
this.logger = logger;
string homeIdPart = string.Empty;
//if (HomeOS.Shared.Globals.HomeId != null)
//{
// homeIdPart = "/" + HomeOS.Shared.Globals.HomeId;
//}
host = new ServiceHost(this, new Uri(HomeOS.Hub.Common.Constants.InfoServiceAddress + homeIdPart));
host.AddServiceEndpoint(typeof(IHomeOSInfo), new WebHttpBinding(), "").Behaviors.Add(new System.ServiceModel.Description.WebHttpBehavior());
var smb = new System.ServiceModel.Description.ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
host.Description.Behaviors.Add(smb);
try
{
host.Open();
}
catch (Exception e)
{
logger.Log("Could not open the service host: " + e.Message + @"
Possible issues: 1) are you running the command prompt / Visual Studio in administrator mode?
2) is another instance of Platform running?
3) is a local copy of Gatekeeper running?
4) is another process occupying the InfoServicePort (51430)?");
throw e;
}
}
示例2: Program
public Program(LoadedImage image, ImageMap imageMap, IProcessorArchitecture arch, Platform platform) : this()
{
this.Image = image;
this.ImageMap = imageMap;
this.Architecture = arch;
this.Platform = platform;
}
示例3: ExePackLoader
public ExePackLoader(IServiceProvider services, string filename, byte[] imgRaw)
: base(services, filename, imgRaw)
{
arch = new IntelArchitecture(ProcessorMode.Real);
platform = new MsdosPlatform(Services, arch);
var exe = new ExeImageLoader(services, filename, imgRaw);
this.exeHdrSize = (uint)(exe.e_cparHeader * 0x10U);
this.hdrOffset = (uint)(exe.e_cparHeader + exe.e_cs) * 0x10U;
ImageReader rdr = new LeImageReader(RawImage, hdrOffset);
this.ip = rdr.ReadLeUInt16();
this.cs = rdr.ReadLeUInt16();
rdr.ReadLeUInt16();
this.cbExepackHeader = rdr.ReadLeUInt16();
this.sp = rdr.ReadLeUInt16();
this.ss = rdr.ReadLeUInt16();
this.cpUncompressed = rdr.ReadLeUInt16();
int offset = ExePackHeaderOffset(exe);
if (LoadedImage.CompareArrays(imgRaw, offset, signature, signature.Length))
{
relocationsOffset = 0x012D;
}
else if (LoadedImage.CompareArrays(imgRaw, offset, signature2, signature2.Length))
{
relocationsOffset = 0x0125;
}
else
throw new ApplicationException("Not a recognized EXEPACK image.");
}
示例4: Main
public static void Main(string[] args)
{
// setup test data
var PlatformSet = new HashSet<Platform>();
Platform Platform0;
PlatformSet.Add(Platform0 = new Platform());
var ManSet = new HashSet<Man>();
Man Man0;
ManSet.Add(Man0 = new Man());
Man Man1;
ManSet.Add(Man1 = new Man());
Man0.ceiling = Platform0;
Man1.ceiling = Platform0;
Man0.floor = Platform0;
Man1.floor = Platform0;
var DateSet = new HashSet<Date>();
var PersonSet = new HashSet<Person>();
Eve Eve0;
PersonSet.Add(Eve0 = Eve.Instance);
var WomanSet = new HashSet<Woman>();
WomanSet.Add(Eve0);
var EveSet = new HashSet<Eve>();
EveSet.Add(Eve0);
// check test data
Contract.Assert(Contract.ForAll(ManSet, m => ManSet.Where(n => FuncClass.Above(m, n)).Count() == 1), "BelowToo");
}
示例5: Build
public SystemService Build(Platform platform)
{
SystemService svc = new SystemService();
svc.Name = Name;
svc.SyscallInfo = new SyscallInfo();
svc.SyscallInfo.Vector = Convert.ToInt32(SyscallInfo.Vector, 16);
if (SyscallInfo.RegisterValues != null)
{
svc.SyscallInfo.RegisterValues = new RegValue[SyscallInfo.RegisterValues.Length];
for (int i = 0; i < SyscallInfo.RegisterValues.Length; ++i)
{
svc.SyscallInfo.RegisterValues[i] = new RegValue
{
Register = platform.Architecture.GetRegister(SyscallInfo.RegisterValues[i].Register),
Value = Convert.ToInt32(SyscallInfo.RegisterValues[i].Value, 16),
};
}
}
else
{
svc.SyscallInfo.RegisterValues = new RegValue[0];
}
TypeLibraryLoader loader = new TypeLibraryLoader(platform, true);
var sser = platform.CreateProcedureSerializer(loader, "stdapi");
svc.Signature = sser.Deserialize(Signature, platform.Architecture.CreateFrame());
svc.Characteristics = Characteristics != null ? Characteristics : DefaultProcedureCharacteristics.Instance;
return svc;
}
示例6: defineSourcePlatform
void defineSourcePlatform()
{
if (platformSourceCombo.Items.Count > 0)
SourcePlatform = new Platform(platformSourceCombo.SelectedItem.ToString(), GameVersion.RS2014.ToString());
else
SourcePlatform = new Platform(GamePlatform.None, GameVersion.None);
}
示例7: LzExeUnpacker
public LzExeUnpacker(IServiceProvider services, ExeImageLoader exe, string filename, byte [] rawImg) : base(services, filename, rawImg)
{
this.arch = new IntelArchitecture(ProcessorMode.Real);
this.platform = new MsdosPlatform(services, arch);
Validate(exe);
}
示例8: ChangeAniso
static void ChangeAniso(int newLevel, Platform somePlatform = Platform.Default)
{
Debug.Log(System.String.Format("{0} Set AnisoLevel '{2}' @ {1} platform", logTitle, somePlatform, newLevel));
TextureImportParams tiParams = new TextureImportParams(Actions.SetAniso, somePlatform);
tiParams.anisoLevel = newLevel;
SelectedChangeAnyPlatformSettings(tiParams);
}
示例9: SetUp
public void SetUp()
{
var appKey = "";
var appSecret = "";
var password = "";
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_KEY")))
{
appKey = Environment.GetEnvironmentVariable("APP_KEY");
}
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_SECRET")))
{
appSecret = Environment.GetEnvironmentVariable("APP_SECRET");
}
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("USER_NAME")))
{
UserName = Environment.GetEnvironmentVariable("USER_NAME");
ToPhone = UserName;
}
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PASSWORD")))
{
password = Environment.GetEnvironmentVariable("PASSWORD");
}
RingCentralClient = new RingCentral.SDK.SDK(appKey, appSecret, ApiEndPoint,"C Sharp Test Suite", "1.0.0");
Platform = RingCentralClient.GetPlatform();
Platform._client = new HttpClient(MockResponseHandler) { BaseAddress = new Uri(ApiEndPoint) };
AuthResult = Platform.Authorize(UserName, Extension, password, true);
}
示例10: SceneManager
public SceneManager(Platform platform, Engine engine, Scene startScene)
{
this.platform = platform;
this.engine = engine;
nextScene = startScene;
sceneRenderer = new SceneRenderer(platform);
}
示例11: changeRing
// move the inner level into the 'ring' of outer level
// NOTE: called when the player enters the inner level
public void changeRing()
{
if(camObject == null)
camObject = GameObject.Find("Menu Camera").GetComponent<CameraScript>();
else
if(!plyr.rigidbody2D.isKinematic)
camObject.jiggle = true;
if (outer == null) {
// there should be one and only one ring now
outer = GameObject.Find("Platform");
Platform plat = outer.GetComponent<Platform>();
plat.ratio = platformRatio;
outerPlatform = plat;
} else {
levelCount++;
//if(levelCount%5==0)
plyr.IncreaseJumps(levelCount);
levelText.setValue (levelCount);
Platform plat=outer.GetComponent<Platform>();
plat.die();
outer = inner;
inner = null;
outerPlatform = outer.GetComponent<Platform>();
}
}
示例12: HeartbeatService
public HeartbeatService(Platform platform, VLogger log)
{
this.platform = platform;
this.logger = log;
this.tcb = SendHeartbeat;
this.sequenceNumber = 0;
try
{
this.uri = new Uri("https://" + GetHeartbeatServiceHostString() + ":" + Constants.HeartbeatServiceSecurePort + "/" +
Constants.HeartbeatServiceWcfListenerEndPointUrlSuffix);
this.heartbeatIntervalMins = Settings.HeartbeatIntervalMins;
if (this.heartbeatIntervalMins < Constants.MinHeartbeatIntervalInMins)
this.heartbeatIntervalMins = Constants.MinHeartbeatIntervalInMins;
if (this.heartbeatIntervalMins > Constants.MaxHeartbeatIntervalInMins)
this.heartbeatIntervalMins = Constants.MaxHeartbeatIntervalInMins;
this.perfCountPercentProcTime = new PerformanceCounter("Process", "% Processor Time", Process.GetCurrentProcess().ProcessName, true);
this.perfCountWorkingSet = new PerformanceCounter("Process", "Working Set", Process.GetCurrentProcess().ProcessName, true);
}
catch (Exception e)
{
logger.Log("Platform failed failed to construct heartbeat service , Exception={0}", e.Message);
}
}
示例13: Engine
public Engine(Platform platform)
{
this.Assets = new Assets (platform);
this.InputEventSystem = new InputEventSystem (platform);
this.DebugRenderer = new DebugRenderer (platform);
this.PrimitiveRenderer = new PrimitiveRenderer (platform);
}
示例14: Mandelbrot
public Mandelbrot( Platform platform, int width, int height )
{
openCLPlatform = platform;
openCLDevices = openCLPlatform.QueryDevices(DeviceType.ALL);
openCLContext = openCLPlatform.CreateDefaultContext();
openCLCQ = openCLContext.CreateCommandQueue(openCLDevices[0], CommandQueueProperties.PROFILING_ENABLE);
mandelBrotProgram = openCLContext.CreateProgramWithSource(File.ReadAllText("Mandelbrot.cl"));
try
{
mandelBrotProgram.Build();
}
catch (OpenCLException)
{
string buildLog = mandelBrotProgram.GetBuildLog(openCLDevices[0]);
MessageBox.Show(buildLog,"Build error(64 bit debug sessions in vs2008 always fail like this - debug in 32 bit or use vs2010)");
Application.Exit();
}
mandelbrotKernel = mandelBrotProgram.CreateKernel("Mandelbrot");
Left = -2.0f;
Top = 2.0f;
Right = 2.0f;
Bottom = -2.0f;
BitmapWidth = width;
BitmapHeight = height;
mandelbrotMemBuffer = openCLContext.CreateBuffer((MemFlags)((long)MemFlags.WRITE_ONLY), width*height*4, IntPtr.Zero);
}
示例15: ItemCatalog
public ItemCatalog(ItemData[] items_data)
{
_items = new Dictionary<ulong, Item>(items_data.GetLength(0) * 2);
foreach (ItemData itemData in items_data)
{
Item item;
FileStream textureStream = new FileStream(Environment.SpecialFolder.Resources + "\\Custom\\" + itemData.UniversalTexture, FileMode.Open);
Texture2D universalTexture = Texture2D.FromStream(Game.GraphicsInstance.GraphicsDevice, textureStream);
switch (itemData.ClassType)
{
case "Teraform.Platform":
item = new Platform(new Point(0, 0), universalTexture, Item.ITEM_STATE.IN_INVENTORY);
break;
case "Teraform.Block":
item = new Block(new Point(0,0), universalTexture, Item.ITEM_STATE.IN_INVENTORY);
break;
default:
throw new NotSupportedException(string.Concat("Error, item type ", itemData.ClassType ," not recognized; check the world\'s .xml file"));
}
item._itemId = itemData.Id;
item._itemName = itemData.Name;
_items.Add(itemData.Id, item);
}
}