• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Interfaces类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Interfaces的典型用法代码示例。如果您正苦于以下问题:C# Interfaces类的具体用法?C# Interfaces怎么用?C# Interfaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Interfaces类属于命名空间,在下文中一共展示了Interfaces类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: RequestAuthentication

        private Interfaces.IAuthenticationResponse RequestAuthentication(Interfaces.IAuthenticationRequest request)
        {
            Identifier id;
            if (!Identifier.TryParse(request.Url, out id))
            {
                _logger.Info(string.Format("OpenID Error...invalid url. url='{0}'", request.Url));
                return Factory.AuthenticationResponse(Interfaces.AuthenticationState.Errored);
            }

            try
            {
                var authenticationRequest = _openIdRelyingParty.CreateRequest(request.Url);
                var fetch = new FetchRequest();
                fetch.Attributes.AddRequired(WellKnownAttributes.Contact.Email);
                fetch.Attributes.AddRequired(WellKnownAttributes.Name.First);
                fetch.Attributes.AddRequired(WellKnownAttributes.Name.Last);
                authenticationRequest.AddExtension(fetch);

                var actionResult = authenticationRequest.RedirectingResponse.AsActionResult();
                return Factory.AuthenticationResponse(actionResult);
            }
            catch (ProtocolException ex)
            {
                _logger.Error("OpenID Exception...", ex);
                return Factory.AuthenticationResponse(Interfaces.AuthenticationState.Errored);
            }
        }
开发者ID:binarymash,项目名称:OpenIdDemo,代码行数:27,代码来源:AuthenticationProvider.cs


示例17: OnMouseRightClick

 public void OnMouseRightClick(Interfaces.MouseEventArgs e)
 {
     if (MouseRightClick != null)
     {
         MouseRightClick(this, e);
     }
 }
开发者ID:Cosmin-Parvulescu,项目名称:Kamaus,代码行数:7,代码来源:MouseListener.cs


示例18: OnMouseMove

 public void OnMouseMove(Interfaces.MouseMoveEventArgs e)
 {
     if (MouseMove != null)
     {
         MouseMove(this, e);
     }
 }
开发者ID:Cosmin-Parvulescu,项目名称:Kamaus,代码行数:7,代码来源:MouseListener.cs


示例19: DisplayOptionToUser

 public override bool DisplayOptionToUser(IOption option, Interfaces.IScriptBaseObject iteratorObject)
 {
     try
     {
         if (option.DisplayToUserValue.HasValue)
         {
             return option.DisplayToUserValue.Value;
         }
         if (string.IsNullOrEmpty(option.DisplayToUserFunction))
         {
             return true;
         }
         if (iteratorObject == null)
         {
             object[] parameters = new object[0];
             return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
         }
         else
         {
             object[] parameters = new object[] { iteratorObject };
             return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
         }
     }
     catch (MissingMethodException)
     {
         object[] parameters = new object[] { iteratorObject };
         return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
     }
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:29,代码来源:DebugProject.cs


示例20: Configure

 public void Configure(Interfaces.Configuration c)
 {
     foreach (Uri uri in c.SlaveWsdlUrls)
     {
         clients.Add(new KeyValueBaseSlaveClient(uri));
     }
 }
开发者ID:Eckankar,项目名称:pcsd-2012,代码行数:7,代码来源:ReplicatorImpl.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Internal类代码示例发布时间:2022-05-24
下一篇:
C# Interface类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap