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


C# Interfaces类代码示例

本文整理汇总了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;
    }
开发者ID:ivladyka,项目名称:Ekran,代码行数:32,代码来源:SqlClientEntityControlBase.cs

示例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; }
        }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:28,代码来源:Equipment.cs

示例3: AddMessage

 public void AddMessage(Protocol.IMessage message, Interfaces.IUserAgent user)
 {
     lock (this)
     {
         mQueue.Enqueue(new MessageToken { Message = message, UserAgent = user });
     }
 }
开发者ID:GameHackers,项目名称:siqi,代码行数:7,代码来源:Desk.cs

示例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;
 }
开发者ID:joycode,项目名称:LibNVim,代码行数:7,代码来源:AbstractVimEditionInsertText.cs

示例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;
         }
 }
开发者ID:kensniper,项目名称:castle-butcher,代码行数:26,代码来源:AckOperating.cs

示例6: PolicyDesignerErrorProvider

 public PolicyDesignerErrorProvider(
     Interfaces.IErrorProviderCollection errorProviderCollection,
     ErrorProvider errorProvider)
 {
     m_parentCollection = errorProviderCollection;
     m_errorProvider = errorProvider;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:PolicyDesignerErrorProvider.cs

示例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;
        }
开发者ID:joycode,项目名称:LibNVim,代码行数:33,代码来源:EditionYankPaste.cs

示例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;
		}
开发者ID:jakubfijalkowski,项目名称:Kingdoms-Clash.NET,代码行数:14,代码来源:PlayerInfo.cs

示例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();
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:7,代码来源:ArsenalsTable.cs

示例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();
            });       
        }
开发者ID:coolweb,项目名称:CollectionneurRecettes.Addon,代码行数:29,代码来源:SyncMenuViewModel.cs

示例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();
                    }
                }
            }
        }
开发者ID:Smjert,项目名称:c-raft,代码行数:29,代码来源:Sheep.cs

示例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;
        }
开发者ID:joycode,项目名称:LibNVim,代码行数:27,代码来源:MotionGotoCharFindNext.cs

示例13: DebugLogEventArgs

 public DebugLogEventArgs(Data.DebugLogLevel level, Interfaces.IPlugin p, Exception e, string msg)
 {
     Plugin = p;
     Message = msg;
     Level = level;
     Exception = e;
 }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:7,代码来源:DebugLogEventArgs.cs

示例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");
        }
开发者ID:soljakwinever,项目名称:ElegyOfDisharmony,代码行数:33,代码来源:BasicEffectObject.cs

示例15: MainPageViewModel

 public MainPageViewModel(Interfaces.IDialogService dialogService,
     IEventAggregator eventAggregator,INavigationService navigationService)
 {
     this._dialogService = dialogService;
     this._eventAggregator = eventAggregator;
     this._navigationService = navigationService;
 }
开发者ID:acb122,项目名称:App3,代码行数:7,代码来源:MainPageViewModel.cs


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