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

C# INotification类代码示例

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

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



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

示例1: HandleNotification

		public override void HandleNotification (INotification notification)
		{
            switch((NotificationEnum)notification.NotifyEnum)
			{
				case NotificationEnum.HERO_INIT:
				{
                    HeroRecord record = notification.Body as HeroRecord;
                    HandleHeroInit(record);
					break;
				}
                case NotificationEnum.MOUSE_HIT_OBJECT:
                {
                    HandleHeroClick();
                    break;
                }
				case NotificationEnum.HERO_CONVERT:
				{
					int heroKid = (int)notification.Body;
					HandleHeroConvert(heroKid);
					break;
				}
				case NotificationEnum.BATTLE_PAUSE:
				{
					bool isPause = (bool)notification.Body;
					HandleBattlePause(isPause);
					break;
				}
				case NotificationEnum.HERO_TRANSPORT:
				{
					Vector3 destPosition = (Vector3)notification.Body;
					HandleHeroTransport(destPosition);
					break;
				}
			}
		}
开发者ID:sigmadruid,项目名称:NewMaze,代码行数:35,代码来源:HeroMediator.cs


示例2: SendNotification

		public void SendNotification(INotification notification, SendNotificationCallbackDelegate callback)
		{
			if (string.IsNullOrEmpty(googleAuthToken))
				RefreshGoogleAuthToken();

			var msg = notification as C2dmNotification;

			var result = new C2dmMessageTransportResponse();
			result.Message = msg;

			//var postData = msg.GetPostData();

			var webReq = (HttpWebRequest)WebRequest.Create(C2DM_SEND_URL);
			//webReq.ContentLength = postData.Length;
			webReq.Method = "POST";
			webReq.ContentType = "application/x-www-form-urlencoded";
			webReq.UserAgent = "PushSharp (version: 1.0)";
			webReq.Headers.Add("Authorization: GoogleLogin auth=" + googleAuthToken);

			webReq.BeginGetRequestStream(requestStreamCallback, new C2dmAsyncParameters()
			{
				Callback = callback,
				WebRequest = webReq,
				WebResponse = null,
				Message = msg,
				GoogleAuthToken = googleAuthToken,
				SenderId = androidSettings.SenderID,
				ApplicationId = androidSettings.ApplicationID
			});
		}
开发者ID:GrimReio,项目名称:PushSharp,代码行数:30,代码来源:C2dmPushChannel.cs


示例3: Execute

        /**
         * Constructor.
         */
        /**
         * Fabricate a result by multiplying the input by 2
         *
         * @param event the <code>IEvent</code> carrying the <code>MacroCommandTestVO</code>
         */
        public override void Execute(INotification note)
        {
            MacroCommandTestVO vo = (MacroCommandTestVO) note.Body;

            // Fabricate a result
            vo.result1 = 2 * vo.input;
        }
开发者ID:guidgets,项目名称:XamlGrid,代码行数:15,代码来源:MacroCommandTestSub1Command.cs


示例4: SaveNotificationToXml

 public override void SaveNotificationToXml(INotification notification, XmlElement notificationElement)
 {
     var n = notification as PopupNotification;
     notificationElement.SetAttribute("notificationText", n.NotificationText);
     notificationElement.SetAttribute("caption", n.Caption);
     notificationElement.SetAttribute("icon", n.Icon.ToString());
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:PopupNotifier.cs


示例5: validate

protected override void validate(object target, object rawValue, INotification notification)
{
    if (rawValue == null || rawValue.ToString() == string.Empty)
            {
                logMessage(notification, GetMessage(this, Property));
            }
}
开发者ID:rauhryan,项目名称:kokugen,代码行数:7,代码来源:RequiredAttribute.cs


示例6: SaveSettingsToNotification

 public void SaveSettingsToNotification(INotification notification)
 {
     var n = notification as UsbLampNotification;
     n.Enabled = this.settingsPanel.NotificationEnabled;
     n.FlashCount = this.settingsPanel.FlashesCount;
     n.FlashColor = this.settingsPanel.LampColor;
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:UsbLampNotificationGuiController.cs


示例7: SendNotification

        public void SendNotification(INotification notification, SendNotificationCallbackDelegate callback)
        {
            var message = notification as FirefoxOSNotification;
            var data = Encoding.UTF8.GetBytes(message.ToString());

            var request = (HttpWebRequest)WebRequest.Create(message.EndPointUrl);

            request.Method = "PUT";
            request.ContentLength = data.Length;
            request.UserAgent = string.Format("PushSharp (version: {0})", version);

            using (var rs = request.GetRequestStream())
            {
                rs.Write(data, 0, data.Length);
            }

            try
            {
                request.BeginGetResponse(ResponseCallback, new object[] { request, message, callback });
            }
            catch (WebException ex)
            {
                callback(this, new SendNotificationResult(message, false, ex));
            }
        }
开发者ID:StrangerMosr,项目名称:PushSharp,代码行数:25,代码来源:FirefoxOSPushChannel.cs


示例8: NotifyAsync

        public override async Task NotifyAsync(IVssRequestContext requestContext, INotification notification, BotElement bot, EventRuleElement matchingRule)
        {
            var token = bot.GetSetting("token");
            if (string.IsNullOrEmpty(token)) throw new ArgumentException("Missing token!");

            var tasks = new List<Task>();
            var slackClient = new SlackClient();

            foreach (string tfsUserName in notification.TargetUserNames)
            {
                var userId = bot.GetMappedUser(tfsUserName);

                if (userId != null)
                {
                    Message slackMessage = ToSlackMessage((dynamic)notification, bot, null, true);
                    if (slackMessage != null)
                    {
                        slackMessage.AsUser = true;
                        var t = Task.Run(async () =>
                        {
                            var response = await slackClient.SendApiMessageAsync(slackMessage, token, userId);
                            response.EnsureSuccessStatusCode();
                            var content = await response.Content.ReadAsStringAsync();
                        });
                        tasks.Add(t);
                    }
                }
            }

            await Task.WhenAll(tasks);
        }
开发者ID:kria,项目名称:TfsNotificationRelay,代码行数:31,代码来源:DirectMessageNotifier.cs


示例9: HandleNotification

		public override void HandleNotification (INotification notification)
		{
            switch((NotificationEnum)notification.NotifyEnum)
			{
				case NotificationEnum.NPC_INIT:
					HandleNPCInit();
					break;
				case NotificationEnum.NPC_DISPOSE:
					HandleNPCDispose();
					break;
				case NotificationEnum.TOWN_NPC_SPAWN:
					HandleTownNPCSpawn();
					break;
                case NotificationEnum.BLOCK_SPAWN:
				{
					Block block = notification.Body as Block;
					HandleNPCSpawn(block);
					break;
				}
                case NotificationEnum.BLOCK_DESPAWN:
				{
					Block block = notification.Body as Block;
					HandleNPCDespawn(block);
					break;
				}
				case NotificationEnum.NPC_DIALOG_SHOW:
					NPC npc = notification.Body as NPC;
					HandleDialogShow(npc);
					break;
			}
		}
开发者ID:sigmadruid,项目名称:NewMaze,代码行数:31,代码来源:NPCMediator.cs


示例10: ProcessEvent

        /// <summary>
        /// This is the one where all the magic happens.
        /// </summary>
        /// <returns>The outcome of the policy Execution as per ISubscriber's contract</returns>
        /// <param name="requestContext">TFS Request Context</param>
        /// <param name="notification">The <paramref name="notification"/> containing the WorkItemChangedEvent</param>
        public ProcessingResult ProcessEvent(IRequestContext requestContext, INotification notification)
        {
            var result = new ProcessingResult();

            Policy[] policies = this.FilterPolicies(this.settings.Policies, requestContext, notification).ToArray();

            if (policies.Any())
            {
                IWorkItem workItem = this.store.GetWorkItem(notification.WorkItemId);

                foreach (var policy in policies)
                {
                    this.logger.ApplyingPolicy(policy.Name);
                    this.ApplyRules(workItem, policy.Rules);
                }

                this.SaveChangedWorkItems();
                result.StatusCode = 0;
                result.StatusMessage = "Success";
            }
            else
            {
                result.StatusCode = 1;
                result.StatusMessage = "No operation";
            }

            return result;
        }
开发者ID:DEllingsworth,项目名称:tfsaggregator,代码行数:34,代码来源:EventProcessor.cs


示例11: Execute

        public override void Execute(INotification notification)
        {
            var programArgsProxy = Facade.RetrieveProxy<ProgramArgsProxy>(Globals.ProgramArgsProxy);
            var typeOfCommand = programArgsProxy.Args.OutputFileFormat;
            var serializationResult = string.Empty;

            switch (typeOfCommand)
            {
                case OutputReportType.FLAT:
                    serializationResult = OutputCommandsToFlat();
                    break;
                case OutputReportType.JSON:
                    serializationResult = OutputCommandsToJson();
                    break;
                case OutputReportType.XML:
                    serializationResult = OutputCommandsToXml();
                    break;
            }

            switch (programArgsProxy.Args.OutputFile)
            {
                case "":
                    Console.WriteLine(serializationResult);
                    break;
                default:
                    using (var outFile = new StreamWriter(programArgsProxy.Args.OutputFile))
                    {
                        outFile.Write(serializationResult);
                    }
                    break;
            }
        }
开发者ID:helios2k6,项目名称:Similar-File-Reporter,代码行数:32,代码来源:OutputReportsCommand.cs


示例12: HandleNotification

        public override void HandleNotification( INotification note )
        {
            UserVo User = note.Body as UserVo;

            switch( note.Name )
            {
                case ApplicationFacade.NEW_USER:
                    ClearForm();
                    UserForm.Username.IsEnabled = true;
                    UserForm.User = User;
                    UserForm.Mode = UserForm.MODE_ADD;
                    UserForm.SubmitButton.Content = "Add User";
                    UserForm.IsEnabled = true;
                    UserForm.First.Focus();
                    UserForm.Username.IsEnabled = true;
                break;

                case ApplicationFacade.USER_DELETED:
                    UserForm.User = null;
                    ClearForm();
                break;

                case ApplicationFacade.USER_SELECTED:
                    ClearForm();
                    UserForm.IsEnabled = true;
                    UserForm.Username.IsEnabled = false;

                    UserForm.User = User;
                    UserForm.Confirm.Password = User.Password;
                    UserForm.Mode = UserForm.MODE_EDIT;
                    UserForm.First.Focus();
                    UserForm.SubmitButton.Content = "Update User";
                break;
            }
        }
开发者ID:pkdevboxy,项目名称:puremvc-csharp-demo-silverlight-employeeadmin,代码行数:35,代码来源:UserFormMediator.cs


示例13: GetWindow

        /// <summary>
        /// Returns the window to display as part of the trigger action.
        /// </summary>
        /// <param name="notification">The notification to be set as a DataContext in the window.</param>
        /// <returns></returns>
        protected override Window GetWindow(INotification notification)
        {
            Window wrapperWindow;

            if (WindowContent != null)
            {
                wrapperWindow = CreateWindow();

                if (wrapperWindow == null)
                    throw new NullReferenceException("CreateWindow cannot return null");

                // If the WindowContent does not have its own DataContext, it will inherit this one.
                wrapperWindow.DataContext = notification;
                wrapperWindow.Title = notification.Title;

                PrepareContentForWindow(notification, wrapperWindow);
            }
            else
            {
                wrapperWindow = CreateDefaultWindow(notification);
            }

            if (AssociatedObject != null)
                wrapperWindow.Owner = Window.GetWindow(AssociatedObject);

            // If the user provided a Style for a Window we set it as the window's style.
            if (WindowStyle != null)
                wrapperWindow.Style = WindowStyle;

            return wrapperWindow;
        }
开发者ID:Synvert,项目名称:Multi-Monitor-Toolkit,代码行数:36,代码来源:MetroPopupWindowAction.cs


示例14: HandleNotification

 public void HandleNotification(INotification notification)
 {
     if (_interestNotifications.Contains(notification.name))
     {
         _HandleNotification(notification);
     }
 }
开发者ID:fuutou89,项目名称:AngeVierge,代码行数:7,代码来源:Mediator.cs


示例15: HandleNotification

		public override void HandleNotification (INotification notification)
		{
            switch((NotificationEnum)notification.NotifyEnum)
			{
				case NotificationEnum.BLOCK_INIT:
				{
					HandleBlockInit();
					break;
				}
				case NotificationEnum.BLOCK_DISPOSE:
				{
                    HandleBlockDispose();
					break;
				}
				case NotificationEnum.BLOCK_REFRESH:
				{
					Vector3 position = (Vector3)notification.Body;
					HandleRefreshBlocks(position);
					break;
				}
                case NotificationEnum.BLOCK_SHOW_ALL:
                {
                    HandleShowAllBlocks();
                    break;
                }
			}
		}
开发者ID:sigmadruid,项目名称:NewMaze,代码行数:27,代码来源:BlockMediator.cs


示例16: Execute

    public override void Execute(INotification notification)
    {
        //-----------------关联命令-----------------------
      //  Facade.RegisterCommand(NotiConst.DISPATCH_MESSAGE, typeof(SocketCommand));

        //-----------------初始化管理器-----------------------
     /*   Facade.AddManager(ManagerName.Lua, new LuaScriptMgr());

        Facade.AddManager<PanelManager>(ManagerName.Panel);
        Facade.AddManager<MusicManager>(ManagerName.Music);
        Facade.AddManager<TimerManager>(ManagerName.Timer);
        Facade.AddManager<NetworkManager>(ManagerName.Network);
        Facade.AddManager<ResourceManager>(ManagerName.Resource);
     */
        //-----------------初始化管理器-----------------------
        Facade.AddManager(ManagerName.Lua, new LuaScriptMgr());


        //添加资源管理器
        Facade.AddManager<ResManager>(ManagerName.Resource);

        //游戏对象管理器
       Facade.AddManager<ObjManager>(ManagerName.ObjMgr);

        //添加音效管理器
       Facade.AddManager<AudioManager>(ManagerName.Music);

        //添加游戏管理器......!!资源管理器对其他管理器对象有依赖,,,必须放所有管理器对象后面添加
        Facade.AddManager<GameManager>(ManagerName.Game);


        

        Debug.Log("SimpleFramework StartUp-------->>>>>");
    }
开发者ID:shiqinghui,项目名称:LuaSpaceShoot,代码行数:35,代码来源:BootstrapCommands.cs


示例17: Execute

        public override void Execute(INotification notification)
        {
            if (notification.Name == Application.APPSTART)
            {
                //取得活动列表
                WebBusiness.PartList();
                return;
            }

            UserNote note = notification as UserNote;
            if (note != null)
            {
                ExecuteNote(note);
            }

            Notification nf = notification as Notification;
            if (nf != null)
            {
                if (nf.Name == WebCommand.GetPartList)
                {
                    WebBusiness.PartList();
                    PlayersProxy.CallAll(WebCommand.UpdatePartListR, new object[] { true });
                }
            }
        }
开发者ID:abel,项目名称:sinan,代码行数:25,代码来源:WebMediator.cs


示例18: SetBreakPoint

 internal void SetBreakPoint(CorModule module, string className, string methodName, INotification _lisenter)
 {
     BreakPointInfo breakpoint = new BreakPointInfo(module.Name, className, methodName, null, _lisenter);
     if (!breakStringVsBP.ContainsKey(breakpoint.Identifier)){
         int token = 0;
         CorFunction fun = null;
         try{
             module.Importer.FindTypeDefByName(className, 0, out token);
         } catch (Exception){
             throw new BreakPointException(className + " class is not found in" + module.Name);
         }
         MetaType type = new MetaType(module.Importer, token);
         try{
             List<BreakPointInfo> bps = new List<BreakPointInfo>();
             foreach (MetadataMethodInfo methodInfo in type.GetMethods(methodName)){
                 BreakPointInfo bp = new BreakPointInfo(module.Name, className, methodName, null, _lisenter);
                 fun = module.GetCorFuntion((uint)methodInfo.MetadataToken);
                 bp.bpoint = fun.CreateBreakPoint();
                 bp.bpoint.Activate();
                 bps.Add(bp);
             }
             if(bps.Count > 0){
                 breakStringVsBP.Add(bps[0].Identifier, bps);
             }
         } catch (Exception) {
             throw new BreakPointException(methodName + " Method is not found in" + className);
         }
     }
 }
开发者ID:balaramaraju,项目名称:DotNetProcessViewer,代码行数:29,代码来源:MDBGManager.cs


示例19: GetWindow

        protected override Window GetWindow( INotification notification )
        {
            var window = base.GetWindow( notification );

            if( WindowWidth.HasValue )
            {
                window.Width = WindowWidth.Value;
            }

            if( WindowHeight.HasValue )
            {
                window.Height = WindowHeight.Value;
            }

            window.ResizeMode = ResizeMode;

            if( WindowWidth.HasValue || WindowHeight.HasValue )
            {
                // unfortunately we cannot tell base class to NOT set SizeToContent so we correct it afterwards
                var d = DependencyPropertyDescriptor.FromProperty( Window.SizeToContentProperty, typeof( Window ) );
                d.AddValueChanged( window, OnSizeToContentChanged );
            }

            if( UseNotificationContentAsDataContext )
            {
                window.DataContext = notification.Content;
            }

            window.Closed += OnWindowClosed;

            return window;
        }
开发者ID:JackWangCUMT,项目名称:Plainion,代码行数:32,代码来源:PopupViewAction.cs


示例20: LoadNotificationFromXml

 public override void LoadNotificationFromXml(INotification notification, XmlElement notificationElement)
 {
     var n = notification as PopupNotification;
     n.NotificationText = notificationElement.GetAttribute("notificationText");
     n.Caption = notificationElement.GetAttribute("caption");
     n.Icon = (ToolTipIcon)Enum.Parse(typeof(ToolTipIcon), notificationElement.GetAttribute("icon"));
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:PopupNotifier.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# INotificationManager类代码示例发布时间:2022-05-24
下一篇:
C# INonceStore类代码示例发布时间: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