本文整理汇总了C#中Interfaces类的典型用法代码示例。如果您正苦于以下问题:C# Interfaces类的具体用法?C# Interfaces怎么用?C# Interfaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Interfaces类属于命名空间,在下文中一共展示了Interfaces类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEditableEntity
protected virtual EditableEntity GetEditableEntity(Interfaces.IValueHolder valueHolder)
{
if (valueHolder == null)
throw new NullReferenceException("valueHolder can't be null");
valueHolder.GetKeySynonym = new Interfaces.GetKeySynonymDelegate(this.GetKeySynonym);
EditableEntity entity = this.CreateEditableEntityInstance();
string[] keys;
if (this.IsNew)
{
keys = this.GetPrimaryKeysForNewEntity();
entity.AddNew();
foreach (string key in keys)
{
entity[key] = valueHolder[key];
}
return entity;
}
keys = this.GetPrimaryKeys();
foreach (string key in keys)
{
if (!entity.SetWhereParamValue(key, valueHolder[key]))
throw new Exception(string.Format("Can't set SqlClientEntity where parameter [{0}] to value [{1}]", key, valueHolder[key]));
}
if (!entity.Load())
throw new Exception("Can't load SqlClientEntity of type " + entity.GetType());
return entity;
}
示例2: Add
public bool Add(Interfaces.IConquerItem item, Enums.ItemUse use)
{
try
{
if (item.Position < 20)
{
if (objects[item.Position - 1] == null)
{
objects[item.Position - 1] = item;
item.Mode = Enums.ItemMode.Default;
if (use != Enums.ItemUse.None)
{
UpdateItemview(item);
EntityEquipment equips = new EntityEquipment(true);
equips.ParseHero(Owner);
Owner.Send(equips);
item.Send(Owner);
Owner.LoadItemStats(item);
}
return true;
}
else return false;
}
else return false;
}
catch { return false; }
}
示例3: AddMessage
public void AddMessage(Protocol.IMessage message, Interfaces.IUserAgent user)
{
lock (this)
{
mQueue.Enqueue(new MessageToken { Message = message, UserAgent = user });
}
}
示例4: Apply
public override bool Apply(Interfaces.IVimHost host)
{
this.OnBeforeInsert(host);
Modes.ModeInsert mode = new Modes.ModeInsert(host, host.CurrentMode, this);
host.CurrentMode = mode;
return true;
}
示例5: SendPacketNeededAck
public void SendPacketNeededAck(Interfaces.IPacket Packet)
{
lock (DictionaryLock)
{
packetIdCounter.Next();
Packet.PacketId = new UDPClientServerCommons.Usefull.PacketIdCounter(packetIdCounter.Value);
packetsWaitingForAck.Add(packetIdCounter.Value, Packet);
}
if (packetsWaitingForAck.Count == 0)
{
//theres no packages that needed ack
//so the timer has stoped
//it needs to be started again when needed
AckTimer.Change(0, 10);
}
else
switch (packetsWaitingForAck.Count)
{
case (1):
AckTimer.Change(0, 2*_SENDING_DELAY);
break;
default:
AckTimer.Change(0, _SENDING_DELAY);
break;
}
}
示例6: PolicyDesignerErrorProvider
public PolicyDesignerErrorProvider(
Interfaces.IErrorProviderCollection errorProviderCollection,
ErrorProvider errorProvider)
{
m_parentCollection = errorProviderCollection;
m_errorProvider = errorProvider;
}
示例7: Apply
public override bool Apply(Interfaces.IVimHost host)
{
string reg_text = _register.GetText(host);
if (reg_text == null) {
return false;
}
if (_register.IsTextLines) {
string text = reg_text;
for (int i = 0; i < (this.Repeat - 1); i++) {
text = text + host.LineBreak + reg_text;
}
host.OpenLineBelow();
host.InsertTextAtCurrentPosition(text);
}
else {
string text = "";
for (int i = 0; i < this.Repeat; i++) {
text = text + reg_text;
}
host.CaretRight();
host.InsertTextAtCurrentPosition(text);
}
if (host.IsCurrentPositionAtEndOfLine()) {
host.MoveToEndOfLine();
host.CaretLeft();
}
return true;
}
示例8: PlayerInfo
/// <summary>
/// Inicjalizuje obiekt.
/// </summary>
/// <param name="name"></param>
/// <param name="nation"></param>
/// <param name="controller"></param>
/// <param name="showStatistics"></param>
public PlayerInfo(string name, Interfaces.Units.INation nation, IPlayerController controller, bool showStatistics)
{
this.Name = name;
this.Nation = nation;
this.Controller = controller;
this.ShowStatistics = showStatistics;
}
示例9: Inscribe
public static void Inscribe(Game.ConquerStructures.Society.ArsenalType Type, uint Donation, Interfaces.IConquerItem item, Game.Entity Entity)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("guild_arsenalsdonation").Insert("d_uid", Entity.UID).Insert("guild_uid", Entity.GuildID).Insert("name", Entity.Name).Insert("item_uid", item.UID).Insert("item_donation", Donation).Insert("item_arsenal_type", (byte)Type).Execute();
cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("items").Set("Inscribed", 1).Where("UID", item.UID).Execute();
}
示例10: SyncMenuViewModel
public SyncMenuViewModel(
Interfaces.ICollectorReceiptManager receiptManager,
Interfaces.IGoogleManager googleManager,
IEventAggregator eventAggregator)
{
if (receiptManager == null)
{
throw new ArgumentNullException("receiptManager");
}
if (googleManager == null)
{
throw new ArgumentNullException("googleManager");
}
if (eventAggregator == null)
{
throw new ArgumentNullException("eventAggregator");
}
this.eventAggregator = eventAggregator;
this.receiptManager = receiptManager;
this.googleManager = googleManager;
this.eventAggregator.GetEvent<Events.StartSyncEvent>().Subscribe((o) =>
{
this.StartSync();
});
}
示例11: DoInteraction
protected override void DoInteraction(Client client, Interfaces.ItemStack item)
{
base.DoInteraction(client, item);
if (client != null && !Chraft.Interfaces.ItemStack.IsVoid(item))
{
if (item.Type == (short)Chraft.World.BlockData.Items.Shears && !Data.Sheared)
{
// Drop wool when sheared
sbyte count = (sbyte)Server.Rand.Next(2, 4);
if (count > 0)
Server.DropItem(World, UniversalCoords.FromWorld(Position.X, Position.Y, Position.Z), new Interfaces.ItemStack((short)Chraft.World.BlockData.Blocks.Wool, count, (short)Data.WoolColor));
Data.Sheared = true;
SendMetadataUpdate();
}
else if (item.Type == (short)Chraft.World.BlockData.Items.Ink_Sack)
{
// Set the wool colour of this Sheep based on the item.Durability
// Safety check. Values of 16 and higher (color do not exist) may crash the client v1.8.1 and below
if (item.Durability >= 0 && item.Durability <= 15)
{
//this.Data.WoolColor = (WoolColor)Enum.ToObject(typeof(WoolColor), (15 - item.Durability));
Data.WoolColor = DyeColorToWoolColor((MetaData.Dyes)Enum.ToObject(typeof(MetaData.Dyes), item.Durability));
SendMetadataUpdate();
}
}
}
}
示例12: Move
public override VimPoint Move(Interfaces.IVimHost host)
{
if (host.IsCurrentPositionAtEndOfLine()) {
return host.CurrentPosition;
}
VimPoint bak = host.CurrentPosition;
for (int i = 0; i < this.Repeat; i++) {
do {
if (host.IsCurrentPositionAtEndOfLine()) {
host.MoveCursor(bak);
return host.CurrentPosition;
}
host.CaretRight();
char ch = host.GetCharAtCurrentPosition();
if (ch == _toSearch) {
break;
}
}
while (true);
}
return host.CurrentPosition;
}
示例13: DebugLogEventArgs
public DebugLogEventArgs(Data.DebugLogLevel level, Interfaces.IPlugin p, Exception e, string msg)
{
Plugin = p;
Message = msg;
Level = level;
Exception = e;
}
示例14: DrawWithEffect
public void DrawWithEffect(Interfaces.IDrawableGeom geom)
{
/*if (_cNode != null)
{
View = _cNode.View;
Projection = _cNode.Projection;
}*/
if (geom.Ready)
{
object oldState = null;
if (_samplerstate != null)
{
oldState = BasicEffect.GraphicsDevice.SamplerStates[0];
BasicEffect.GraphicsDevice.SamplerStates[0] = _samplerstate;
}
_deviceReference.BlendState = BlendState.AlphaBlend;
_deviceReference.DepthStencilState = EquestriEngine.DepthState;
foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
{
pass.Apply();
_deviceReference.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.TriangleList, geom.Vertices, 0, geom.Vertices.Length,
geom.Indices, 0, 2);
}
if (oldState != null)
BasicEffect.GraphicsDevice.SamplerStates[0] = oldState as SamplerState;
}
else
Systems.ConsoleWindow.WriteLine("Failed to draw geometry");
}
示例15: MainPageViewModel
public MainPageViewModel(Interfaces.IDialogService dialogService,
IEventAggregator eventAggregator,INavigationService navigationService)
{
this._dialogService = dialogService;
this._eventAggregator = eventAggregator;
this._navigationService = navigationService;
}