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

C# Notification类代码示例

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

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



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

示例1: checkIfOnBalloon

    void checkIfOnBalloon()
    {
        float playerSize = this.renderer.bounds.size.y;
        Vector3 position1 = transform.position;
        Vector3 position2 = transform.position;
        position1.x = position1.x - playerSize;
        position1.y = position1.y;
        position2.x = position2.x + playerSize;
        position2.y = position2.y - 2 * playerSize;

        Collider2D[] hits = Physics2D.OverlapAreaAll(new Vector2(position1.x, position1.y), new Vector2(position2.x, position2.y));
        Notification collision = new Notification(NotificationType.OnBalloonPlayerCollision, "Balloon Collided!");

        int i = 0;
        bool temp = false;
        while (i < hits.Length)  {
            Collider2D hit = hits[i];
            if (hit != null) {
                if (hit.tag == "platform") {
                    NotificationCenter.defaultCenter.postNotification(collision);
                    temp = true;
                }
            }
            i++;
        }
        this.GetComponent<Jump>().setGrounded(check);
    }
开发者ID:ErraticUnicorn,项目名称:balloonacy,代码行数:27,代码来源:CollisionController.cs


示例2: Handle

        public override void Handle(Connection connection)
        {
            var account = connection.Session.Account;
            var notification = new Notification();

            notification.UserId = account.Id;
            notification.Regex = new Regex(RegexPattern);
            notification.DeviceToken = DeviceToken;

            if (Program.NotificationManager.Exists(DeviceToken))
            {
                notification.Save();
            }
            else
            {
                if (Program.NotificationManager.FindWithId(account.Id).Count() < 5)
                {
                    notification.Insert();
                }
                else
                {
                    connection.SendSysMessage("You may only have 5 devices registered for push notifications.");
                    return;
                }
            }

            Program.NotificationsDirty = true;

            var notificationSubscription = new NotificationSubscription();
            notificationSubscription.DeviceToken = DeviceToken;
            notificationSubscription.RegexPattern = RegexPattern;
            notificationSubscription.Registered = true;

            connection.Send(notificationSubscription);
        }
开发者ID:Rohansi,项目名称:RohBot,代码行数:35,代码来源:NotificationSubscriptionRequest.cs


示例3: GameOver

    void GameOver(Notification noti)
    {
        List<int> pointsList = stateGame.userLoged.getPoints ();

        if (pointsList.Count < 11 && pointsList.Count > 0) {

            if(pointsList.Count < 10 && !pointsList.Contains(points)) {
                stateGame.userLoged.addPoints (points);
            }else {
                if(!pointsList.Contains(points)) {
                    if (pointsList [0] < points) {
                        stateGame.userLoged.getPoints ()[0] = points;
                    }
                }
            }
            stateGame.userLoged.getPoints ().Sort ();

        } else {
            if(pointsList.Count == 0) {
                stateGame.userLoged.addPoints (points);
                stateGame.userLoged.getPoints ().Sort ();
            }
        }
        stateGame.Save (stateGame.userLoged);

        /*if (points > StateGame.stateGame.highScore) {
            StateGame.stateGame.highScore = points;
            StateGame.stateGame.usuario = user;
            StateGame.stateGame.Save();
        }*/
    }
开发者ID:DodgingCone,项目名称:DodgingConeUnity,代码行数:31,代码来源:Points.cs


示例4: valid_should_return_valid_notification

 public void valid_should_return_valid_notification()
 {
     var notification = new Notification();
     notification
         .IsValid()
         .ShouldBeTrue();
 }
开发者ID:stevematney,项目名称:fubuvalidation,代码行数:7,代码来源:NotificationTester.cs


示例5: DisplayData

 private void DisplayData(Notification notification)
 {
     EnableAppBarStatus(true);
     // Navigate to the appropriate destination page, configuring the new page
     // by passing required information as a navigation parameter
     frmNotification.Navigate(typeof(NotificationDetailFrame), notification);
 }
开发者ID:stavrianosy,项目名称:BudgetManagementAssistant,代码行数:7,代码来源:NotificationItemsPage.xaml.cs


示例6: GetChildReturnsValidIfNoChild

        public void GetChildReturnsValidIfNoChild()
        {
            var notification = new Notification();
            var child = notification.GetChild("anything");

            child.IsValid().ShouldBeTrue();
        }
开发者ID:rauhryan,项目名称:kokugen,代码行数:7,代码来源:NotificationTester.cs


示例7: Deliver

        public bool Deliver(Notification notification)
        {
            bool success = false;
            try
            {
                notification.Retry = false;
                notification.Status = "Processing";

                var configuration = FtpClientConfiguration.GetFtpConfigurationFromSettings(notification.UserData);

                FtpClient ftpClient = FtpClient.GetClientFromSettings(configuration);
                RenderedOutputFile outputFile = notification.Report.Render(configuration.FileFormat, String.Empty)[0];
                outputFile.Data.Position = 0;
                using (var stream = outputFile.Data)
                {
                    byte[] bytes = new byte[stream.Length];
                    stream.Read(bytes, 0, bytes.Length);
                    stream.Close();
                    ftpClient.UploadFile(bytes);
                }
                notification.Status = "Success";
                success = true;
            }
            catch (Exception ex)
            {
                notification.Status = String.Format("Error: {0}", ex.Message);
                success = false;
            }
            finally
            {
                notification.Save();
            }

            return success;
        }
开发者ID:ifandelse,项目名称:Starfish.Extensions,代码行数:35,代码来源:FtpDeliveryExtension.cs


示例8: ReceiveNotification

 public void ReceiveNotification(Notification notification)
 {
     foreach (var n in notification.GetAllNotifications())
     {
         WebsiteMain.notifications.Add(n);
     }
 }
开发者ID:njfsilva,项目名称:RememberVinilWebStore,代码行数:7,代码来源:WebsiteNotificationService.cs


示例9: Validate

        public void Validate(object target, Notification notification)
        {
            var validatedType = _typeResolver.ResolveType(target);
            var context = ContextFor(target, notification);

            _graph.PlanFor(validatedType).Execute(context);
        }
开发者ID:joemcbride,项目名称:fubuvalidation,代码行数:7,代码来源:Validator.cs


示例10: acabarTorre

 private void acabarTorre(Notification notification)
 {
     u.moverApunto(transform, "nodoTorreBase", velTorre, new Vector2(separacionRunner.x, separacionRunner.y - 500), "salimosDeTorre");
     cambiarZoom(zoomNormal, velZoomNormal, "");
     cambiarEscalaLimitadores("_limitadoresBalas", new Vector3(1f, 1f, 1f));
     NotificationCenter.DefaultCenter().PostNotification(this, "empezarParallax");
 }
开发者ID:ZenekeZene,项目名称:El-Especialista,代码行数:7,代码来源:ControlCamara.cs


示例11: GMAuctionList

        /// <summary>
        /// GM取得拍卖行数据
        /// </summary>
        /// <param name="note"></param>
        public static object GMAuctionList(Notification note)
        {
            string[] strs = GMBusiness.GetCommand(note);
            if (strs.Length < 3)
                return null;
            PlayerBusiness player = PlayersProxy.FindPlayerByName(strs[0].Trim());
            if (player == null)
                return null;
            int pageIndex = 0;

            if (!int.TryParse(strs[1].Trim(), out pageIndex))
                return null;
            int pageSize = 6;

            int total = 0;
            int curIndex = 0;
            List<Auction> auctionList = AuctionAccess.Instance.AuctionSellerList(player.ID, pageSize, pageIndex, out total, out curIndex);
            List<Variant> list = new List<Variant>();
            foreach (Auction model in auctionList)
            {
                Variant mv = model.Value;
                Variant v = new Variant();
                foreach (var item in mv)
                {
                    v.Add(item.Key, item.Value);
                }
                v.Add("ID", model.ID);
                v.Add("Name", model.Name);
                list.Add(v);
            }
            return new object[] { list, total, curIndex };
        }
开发者ID:abel,项目名称:sinan,代码行数:36,代码来源:ManageAuction.cs


示例12: RegisterNewCompanyCommand

 public RegisterNewCompanyCommand(ICompanyFactory factory, Notification notification,
                                  ICompanyRepository companies)
 {
     this.factory = factory;
     this.notification = notification;
     this.companies = companies;
 }
开发者ID:mokhan,项目名称:mo.money,代码行数:7,代码来源:RegisterNewCompanyCommand.cs


示例13: Should_return_true_if_Messages_contains_only_messages_with_Info_Severity

 public void Should_return_true_if_Messages_contains_only_messages_with_Info_Severity()
 {
     var notification = new Notification();
     var messageTest = new NotificationMessage(NotificationSeverity.Info, "");
     notification.Add(messageTest);
     Assert.IsTrue(notification.IsValid);
 }
开发者ID:mvbalaw,项目名称:MvbaCore,代码行数:7,代码来源:NotificationTests_IsValid.cs


示例14: OnCognitivLiftEvent

    void OnCognitivLiftEvent(Notification notification)
    {
        if (canLift)
        {
            liftCounter++;

            timeUntilCanLiftNext = Time.time + timeBetweenLifts;
            canLift = false;

            if (liftCounter == 1)
            {
                StartCoroutine(explainMana());
            }
            else if (liftCounter == numberOfTimesToLift)
            {
                EventFactory.FireDisplayTextEvent(this, "Good job! You have learned LIFT!", 5.0f);

                NotificationCenter.DefaultCenter.PostNotification(this, "LiftCompleted");
            }
        }
        else
        {
            EventFactory.FireDisplayTextEvent(this, "Why don't you try lifting in " + (int) (timeUntilCanLiftNext - Time.time) + " seconds?", timeUntilCanLiftNext - Time.time);
        }
    }
开发者ID:bkha1,项目名称:CerebralAcademy,代码行数:25,代码来源:Tutor.cs


示例15: PlayNotes

        public static SmiResultCode PlayNotes(int handle,
            uint noteCount,
            HapticsNote[] notes,
            bool repeat,
            Notification callback)
        {
            CallbackItem item= new CallbackItem();
            c_Notification cN = new c_Notification(Haptics.NotificationCallbakHandler);

            item.callback   = callback;
            item.handle     = handle;
            item.notesArray = notes;
            item.c_callback = cN; // reserve callback until callback is done

            lock (_locker)
            {
                // protect the _list inside of critical section
                _list.Add(item);
            }

            SmiResultCode result = c_PlayNotes(handle,
                               noteCount,
                               notes,
                               repeat,
                               cN);

            //System.Console.WriteLine("@PlayNotes handle     = " + handle);
            //System.Console.WriteLine("@PlayNotes noteCount  = " + noteCount);
            //System.Console.WriteLine("@PlayNotes repeat     = " + repeat);
            //System.Console.WriteLine("@PlayNotes result  = " + result);

            return result;
        }
开发者ID:slay22,项目名称:TrainstationAdvisor,代码行数:33,代码来源:Haptics.cs


示例16: IsValid

        public bool IsValid(Notification notification)
        {
            var isRemoteOpValid = _sequence.OfType<IOperateRemote>().All(x => x.IsValid(notification));
            var isCompositeSeqValid = _sequence.OfType<CompositeSequence>().All(x => x.IsValid(notification));

            return isRemoteOpValid && isCompositeSeqValid;
        }
开发者ID:brigs,项目名称:ConDep,代码行数:7,代码来源:InfrastructureSequence.cs


示例17: Validate

 public Notification Validate(object target)
 {
     var validatedType = typeResolver.ResolveType(target);
     var notification = new Notification(validatedType);
     Validate(target, notification);
     return notification;
 }
开发者ID:caiokf,项目名称:smart-track,代码行数:7,代码来源:FluentValidator.cs


示例18: acabarShooter

 public void acabarShooter(Notification notification)
 {
     rigidbody2D.isKinematic = false;
     gen.estado = 1;
     gen.animator.SetInteger("Estado", gen.estado);
     run.saltar(1500, run.fuerzaSalto * 7);
 }
开发者ID:ZenekeZene,项目名称:El-Especialista,代码行数:7,代码来源:controlShooter.cs


示例19: MainPage

        // Constructor
        public MainPage()
        {
            
            InitializeComponent();
            ser = new NotificationClass();
            obj = new Notification(ser);

            //NotificationSwitch is set by user to start or stop push notifications.
            if (IsolatedStorageSettings.ApplicationSettings.Contains("notificationSwitch"))
            {
                //If notificationSwitch is ON(True) then only start notification service.
                if ((bool)IsolatedStorageSettings.ApplicationSettings["notificationSwitch"])
                {
                    //Start in-app Notification listening every time application starts.
                    obj.SetupNotification();
                }
            }
            else
            {
                //By Default Notifications are disabled.
                IsolatedStorageSettings.ApplicationSettings["notificationSwitch"] = false;
            }

            
        }
开发者ID:pankajc-optimus,项目名称:windows-lib,代码行数:26,代码来源:NotifyMe.xaml.cs


示例20: Notify

 public void Notify(Story story)
 {
     var frontpageItem = story.Item;
     var notification = new Notification(ApplicationName, NotificationTypeName, "ID", frontpageItem.Title, frontpageItem.Link);
     var callback = new CallbackContext(frontpageItem.Link);
     _growl.Notify(notification, callback);
 }
开发者ID:tltjr,项目名称:HnNotify,代码行数:7,代码来源:GrowlNotification.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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