本文整理汇总了C#中Client类的典型用法代码示例。如果您正苦于以下问题:C# Client类的具体用法?C# Client怎么用?C# Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Client类属于命名空间,在下文中一共展示了Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNotes
public static async Task<Note[]> GetNotes(Client client, string orderId)
{
return
(await
client.MakeGetRequest<Notes>(client.ConcatAccountPath(string.Format("{0}/{1}/notes", PortOutPath, orderId))))
.List;
}
示例2: Mesh
/// <summary>
/// Create a new mesh for the given client using shader as the default shader
/// </summary>
/// <param name="client"></param>
/// <param name="shader"></param>
public Mesh(Client client, Shader shader)
{
Client = client;
Shader = shader;
Id = CSycles.scene_add_mesh(Client.Id, Client.Scene.Id, Client.Scene.GetShaderSceneId(shader));
}
示例3: HandleDoProcessStart
public static void HandleDoProcessStart(Packets.ServerPackets.DoProcessStart command, Client client)
{
if (string.IsNullOrEmpty(command.Processname))
{
new Packets.ClientPackets.SetStatus("Process could not be started!").Execute(client);
return;
}
try
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
UseShellExecute = true,
FileName = command.Processname
};
Process.Start(startInfo);
}
catch
{
new Packets.ClientPackets.SetStatus("Process could not be started!").Execute(client);
}
finally
{
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
}
}
示例4: VM
public VM()
{
//get a handler to the Lync Client, then subscribe to state changes.
_client = LyncClient.GetClient();
_client.StateChanged += _client_StateChanged;
SubscribetoPresenceIfSignedIn(_client.State);
}
示例5: FrmRemoteWebcam
public FrmRemoteWebcam(Client c)
{
_connectClient = c;
_connectClient.Value.FrmWebcam = this;
InitializeComponent();
}
示例6: Main
public static void Main(Client client)
{
foreach (var vip in client.Vip.GetCharacters())
{
client.Vip.Remove(vip);
}
}
示例7: Start
void Start()
{
Application.runInBackground = true;
client = new Client(PORT, "192.168.1.101");
client.Work();
sendMessage = forPrint;
}
示例8: SaveSpells
public static void SaveSpells(Client.GameState client)
{
if (client.Entity == null)
return;
if (client.Spells == null)
return;
if (client.Spells.Count == 0)
return;
foreach (Interfaces.ISkill spell in client.Spells.Values)
{
if(spell.Available)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("skills").Set("Level", spell.Level).Set("PreviousLevel", spell.PreviousLevel)
.Set("Experience", spell.Experience).Where("EntityID", client.Entity.UID).And("ID", spell.ID).Execute();
}
else
{
spell.Available = true;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("skills").Insert("Level", spell.Level).Insert("Experience", spell.Experience).Insert("EntityID", client.Entity.UID)
.Insert("Type", "Spell").Insert("ID", spell.ID).Execute();
}
}
}
示例9: Read
protected override void Read(Client client, NReader rdr)
{
Time = rdr.ReadInt32();
BulletId = rdr.ReadByte();
ObjectId = rdr.ReadInt32();
TargetId = rdr.ReadInt32();
}
示例10: HandleDoDownloadFile
public static void HandleDoDownloadFile(Packets.ServerPackets.DoDownloadFile command, Client client)
{
new Thread(() =>
{
try
{
FileSplit srcFile = new FileSplit(command.RemotePath);
if (srcFile.MaxBlocks < 0)
new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1,
srcFile.LastError).Execute(client);
for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
{
if (!client.Connected) return;
if (_canceledDownloads.ContainsKey(command.ID)) return;
byte[] block;
if (srcFile.ReadBlock(currentBlock, out block))
{
new Packets.ClientPackets.DoDownloadFileResponse(command.ID,
Path.GetFileName(command.RemotePath), block, srcFile.MaxBlocks, currentBlock,
srcFile.LastError).Execute(client);
}
else
new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1,
srcFile.LastError).Execute(client);
}
}
catch (Exception ex)
{
new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1, ex.Message)
.Execute(client);
}
}).Start();
}
示例11: StreamFetcher
public StreamFetcher(DataServiceContextWrapper context, EntityBase entity, string propertyName, Client.DataServiceStreamLink link)
{
_context = context;
_entity = entity;
_link = link;
_propertyName = propertyName;
}
示例12: ChangeDungeonCoords
public static void ChangeDungeonCoords(Client client, Enums.Direction dir)
{
int dist = 1;
int rand = Server.Math.Rand(1, 10000);
if (rand <= 66) { //.66% chance warp
exPlayer.Get(client).DungeonX = Server.Math.Rand(0, exPlayer.Get(client).DungeonMaxX-1);
exPlayer.Get(client).DungeonY = Server.Math.Rand(0, exPlayer.Get(client).DungeonMaxY-1);
return;
} else if (rand <= 666) { //6% chance skip
dist = 2;
}
if (dir == Enums.Direction.Up) {
exPlayer.Get(client).DungeonY = exPlayer.Get(client).DungeonY - dist;
if (exPlayer.Get(client).DungeonY < 0) {
exPlayer.Get(client).DungeonY += exPlayer.Get(client).DungeonMaxY;
}
} else if (dir == Enums.Direction.Down) {
exPlayer.Get(client).DungeonY = (exPlayer.Get(client).DungeonY + dist) % exPlayer.Get(client).DungeonMaxY;
} else if (dir == Enums.Direction.Left) {
exPlayer.Get(client).DungeonX = exPlayer.Get(client).DungeonX - dist;
if (exPlayer.Get(client).DungeonX < 0) {
exPlayer.Get(client).DungeonX += exPlayer.Get(client).DungeonMaxX;
}
} else if (dir == Enums.Direction.Right) {
exPlayer.Get(client).DungeonX = (exPlayer.Get(client).DungeonX + dist) % exPlayer.Get(client).DungeonMaxX;
}
}
示例13: UserInfo
public UserInfo(string user, string pass, Client conn)
{
this.UserName = user;
this.Password = pass;
this.LoggedIn = true;
this.Connection = conn;
}
示例14: CanCalculate
public void CanCalculate()
{
var client = new Client(new Uri(AmeeUrl), AmeeUserName, AmeePassword);
var value = client.Calculate("transport/defra/fuel", "9DE1D9435784", new ValueItem("volume", "10"));
Assert.AreEqual(value.Amounts.Amount[0].Value, "4.7385");
}
示例15: Form1
public Form1()
{
InitializeComponent();
// Turn on key preview
this.KeyPreview = true;
// Allocate Kinect data structure for speed
data = new KinectData();
// Allocate bitmaps for speed
//!! Should use System.Windows.Media.Imaging.WriteableBitmap
colorBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
depthBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
testBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
demoBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
// Set up session parameters
SessionParameters sessionParams = new SessionParameters(KinectDataParams.EnableType.All);
sessionParams.DataParams.validityImageEnable = false;
sessionParams.DataParams.testImageEnable = false;
// Connect to a local Kinect and hook up to the data event
client = KinectTableNet.KinectTable.ConnectLocal(sessionParams);
client.DataReady += new Client.DataReadyHandler(client_DataReady);
return;
}