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

C# GenericEventArgs类代码示例

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

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



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

示例1: fabric_AddRobotAction

 void fabric_AddRobotAction(object sender, GenericEventArgs<Robot> e)
 {
     RobotButton robotButton = robotPanel.AddRobot(e.Value).GetComponent<RobotButton>();
     _robotButtons.Add(robotButton);
     robotButton.ClickAction += robotButton_ClickAction;
     e.Value.ReturnAction += robots_ReturnAction;
 }
开发者ID:Vilvarin,项目名称:RobotsGame,代码行数:7,代码来源:ControlPresenter.cs


示例2: PrimitiveCommandHandler

 void PrimitiveCommandHandler(object sender, GenericEventArgs<string> e)
 {
     if (current.Triangle != null)
     {
         InvokePrimitive(e.Argument);
     }
 }
开发者ID:cmberryau,项目名称:Triangle.NET-3.5,代码行数:7,代码来源:FormTopology.cs


示例3: _taskManager_TaskCompleted

        async void _taskManager_TaskCompleted(object sender, GenericEventArgs<TaskResult> e)
        {
            var result = e.Argument;

            if (result.Status == TaskCompletionStatus.Failed)
            {
                foreach (var user in _userManager
                    .Users
                    .Where(i => i.Configuration.IsAdministrator)
                    .ToList())
                {
                    var notification = new Notification
                    {
                        UserId = user.Id,
                        Category = "ScheduledTaskFailed",
                        Name = result.Name + " failed",
                        RelatedId = result.Name,
                        Description = result.ErrorMessage,
                        Level = NotificationLevel.Error
                    };

                    try
                    {
                        await _notificationsRepo.AddNotification(notification, CancellationToken.None).ConfigureAwait(false);
                    }
                    catch (Exception ex)
                    {
                        _logger.ErrorException("Error adding notification", ex);
                    }
                }
            }
        }
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:32,代码来源:Notifier.cs


示例4: _deviceDiscovery_DeviceDiscovered

        void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs<UpnpDeviceInfo> e)
        {
            var info = e.Argument;

            string st = null;
            string nt = null;
            info.Headers.TryGetValue("ST", out st);
            info.Headers.TryGetValue("NT", out nt);

            if (string.Equals(st, "urn:ses-com:device:SatIPServer:1", StringComparison.OrdinalIgnoreCase) ||
                string.Equals(nt, "urn:ses-com:device:SatIPServer:1", StringComparison.OrdinalIgnoreCase))
            {
                string location;
                if (info.Headers.TryGetValue("Location", out location) && !string.IsNullOrWhiteSpace(location))
                {
                    _logger.Debug("SAT IP found at {0}", location);

                    // Just get the beginning of the url
                    Uri uri;
                    if (Uri.TryCreate(location, UriKind.Absolute, out uri))
                    {
                        var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase)
                                .TrimEnd('/');

                        AddDevice(apiUrl, location);
                    }
                }
            }
        }
开发者ID:t-andre,项目名称:Emby,代码行数:29,代码来源:SatIpDiscovery.cs


示例5: _deviceDiscovery_DeviceDiscovered

        void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs<UpnpDeviceInfo> e)
        {
            string server = null;
            var info = e.Argument;

            if (info.Headers.TryGetValue("SERVER", out server) && server.IndexOf("HDHomeRun", StringComparison.OrdinalIgnoreCase) != -1)
            {
                string location;
                if (info.Headers.TryGetValue("Location", out location))
                {
                    //_logger.Debug("HdHomerun found at {0}", location);

                    // Just get the beginning of the url
                    Uri uri;
                    if (Uri.TryCreate(location, UriKind.Absolute, out uri))
                    {
                        var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase)
                                .TrimEnd('/');

                        //_logger.Debug("HdHomerun api url: {0}", apiUrl);
                        AddDevice(apiUrl);
                    }
                }
            }
        }
开发者ID:t-andre,项目名称:Emby,代码行数:25,代码来源:HdHomerunDiscovery.cs


示例6: OnFileUploadComplete

 // Invoke the Changed event; called whenever list changes
 protected virtual void OnFileUploadComplete(GenericEventArgs<string> e)
 {
     if (FileUploadComplete != null)
     {
         FileUploadComplete(this,e);
     }
 }
开发者ID:chuckconway,项目名称:chucksoft-gallery,代码行数:8,代码来源:Uploader.cs


示例7: Demon_OnCollisionWithPlayer

 void Demon_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e)
 {
     if (attackCounter > attackRate)
     {
         e.Data.Damage(DemonDamage);
         attackCounter = TimeSpan.Zero;
     }
 }
开发者ID:NullSoldier,项目名称:Moxy,代码行数:8,代码来源:Demon.cs


示例8: AngryRock_OnCollisionWithPlayer

 void AngryRock_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e)
 {
     if (currentTime >= RockAttackSpeed)
     {
         currentTime = TimeSpan.Zero;
         e.Data.Damage(RockRamage);
     }
 }
开发者ID:NullSoldier,项目名称:Moxy,代码行数:8,代码来源:AngryRock.cs


示例9: ConnectionManagerOnConnected

 private void ConnectionManagerOnConnected(object sender, GenericEventArgs<ConnectionResult> e)
 {
     var apiClient = e.Argument.ApiClient;
     if (apiClient != null)
     {
         apiClient.UserUpdated -= ApiClientOnUserUpdated;
         apiClient.UserUpdated += ApiClientOnUserUpdated;
     }
 }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:9,代码来源:AuthenticationService.cs


示例10: _taskManager_TaskCompleted

 void _taskManager_TaskCompleted(object sender, GenericEventArgs<TaskResult> e)
 {
     if (Plugin.Instance.Configuration.Notifications.Tasks)
     {
         if (e.Argument.Status.ToString() == "Failed")
         {
             _pusher.Push("Media Server Task " + e.Argument.Name + " Error : " + e.Argument.ErrorMessage, 0);
         }
     }
 }
开发者ID:snazy2000,项目名称:MBNotifications,代码行数:10,代码来源:ServerEntryPoint.cs


示例11: PlayAudio

        async void PlayAudio(object sender, GenericEventArgs<Stream> args)
        {
            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
            {
                Stream str = args.EventData;
                InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream();

                await str.CopyToAsync(ras.AsStreamForWrite());
                Windows.Media.Playback.BackgroundMediaPlayer.Current.SetStreamSource(ras);
            });
        }
开发者ID:AdrianDiaz81,项目名称:Codemotion2015,代码行数:11,代码来源:SearchTextView.xaml.cs


示例12: commandHandler_StartMoveAction

        void commandHandler_StartMoveAction(object sender, GenericEventArgs<Robot> e)
        {
            foreach (Platform platform in _platforms)
                platform.DarkenPlatform();

            foreach (RobotButton button in _robotButtons)
            {
                if (button.FixedRobot == e.Value)
                    button.Deactivate();
            }
        }
开发者ID:Vilvarin,项目名称:RobotsGame,代码行数:11,代码来源:ControlPresenter.cs


示例13: _config_ConfigurationUpdating

        void _config_ConfigurationUpdating(object sender, GenericEventArgs<ServerConfiguration> e)
        {
            var options = e.Argument.SubtitleOptions;

            if (options != null &&
                !string.IsNullOrWhiteSpace(options.OpenSubtitlesPasswordHash) &&
                !options.OpenSubtitlesPasswordHash.StartsWith(PasswordHashPrefix, StringComparison.OrdinalIgnoreCase))
            {
                options.OpenSubtitlesPasswordHash = EncryptPassword(options.OpenSubtitlesPasswordHash);
            }
        }
开发者ID:rsolmn,项目名称:MediaBrowser,代码行数:11,代码来源:OpenSubtitleDownloader.cs


示例14: ConnectionManagerOnLocalUserSignIn

 private void ConnectionManagerOnLocalUserSignIn(object sender, GenericEventArgs<UserDto> e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         LoggedInUser = e.Argument;
         if (AuthenticationResult != null && _connectionManager.CurrentApiClient != null)
         {
             _connectionManager.CurrentApiClient.SetAuthenticationInfo(AuthenticationResult.AccessToken, LoggedInUserId);
         }
     });
 }
开发者ID:zardaloop,项目名称:Emby.WindowsPhone,代码行数:11,代码来源:AuthenticationService.cs


示例15: ApiClientOnUserUpdated

        private void ApiClientOnUserUpdated(object sender, GenericEventArgs<UserDto> e)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                SetUser(e.Argument);

                var apiClient = sender as IApiClient;
                if (apiClient != null)
                {
                    SetAccessToken(apiClient.AccessToken);
                }
            });
        }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:13,代码来源:AuthenticationService.cs


示例16: _userManager_UserLockedOut

        async void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
        {
            var type = NotificationType.UserLockedOut.ToString();

            var notification = new NotificationRequest
            {
                NotificationType = type
            };

            notification.Variables["UserName"] = e.Argument.Name;

            await SendNotification(notification).ConfigureAwait(false);
        }
开发者ID:jrags56,项目名称:MediaBrowser,代码行数:13,代码来源:Notifications.cs


示例17: _appHost_ApplicationUpdated

        async void _appHost_ApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e)
        {
            var type = NotificationType.ApplicationUpdateInstalled.ToString();

            var notification = new NotificationRequest
            {
                NotificationType = type
            };

            notification.Variables["Version"] = e.Argument.versionStr;
            notification.Variables["ReleaseNotes"] = e.Argument.description;

            await SendNotification(notification).ConfigureAwait(false);
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:14,代码来源:Notifications.cs


示例18: Client_Connected

 /// <summary>
 /// Event handler for when a client connects.
 /// Makes sure there is enough room on the server before allowing it to proceed.
 /// if successful it starts the client read/write threads.
 /// </summary>
 /// <param name="sender">Client that is connecting</param>
 /// <param name="e">the handshake (contains its name)</param>
 public void Client_Connected(Client sender, GenericEventArgs<String> e)
 {
     if (!Interlocked.Equals(this.connectedClients, this.maxClients))
     {
         Interlocked.Increment(ref this.connectedClients);
         this.On_Client_Sending += sender.Client_Sending; //subscribe to the send to all event
         sender.StartUp();
         Console.WriteLine("Client connected: {0}", sender.Name);
     }
     else
     {
         sender.Close_Connection();
         Console.WriteLine("Client refused, server full: {0}", sender.Name);
     }
 }
开发者ID:dylanbrodiefafard,项目名称:GoFish,代码行数:22,代码来源:Server.cs


示例19: _serverEvents_UserDataChanged

        void _serverEvents_UserDataChanged(object sender, GenericEventArgs<UserDataChangeInfo> e)
        {
            var key = _item.UserData == null ? string.Empty : _item.UserData.Key;

            if (!string.IsNullOrEmpty(key))
            {
                var data = e.Argument.UserDataList.FirstOrDefault(i => string.Equals(key, i.Key, StringComparison.OrdinalIgnoreCase));

                if (data != null)
                {
                    _item.UserData = data;
                    RefreshUserDataFields();
                }
            }
        }
开发者ID:TomGillen,项目名称:MediaBrowser.Theater,代码行数:15,代码来源:ItemViewModel.cs


示例20: TweetReceived

        private void TweetReceived(GenericEventArgs<ITweet> tweetEvent)
        {
            if (!tweetEvent.Value.Text.Contains(ConfigurationManager.AppSettings["AccountName"])) return;

            var tweet = tweetEvent.Value;

            var scoreInfo = new ScoreInfo
                {
                    Id = tweet.Id,
                    TextScore = StripMentions(tweet.Text),
                    Username = tweet.Creator.ScreenName,
                    DateTime = tweet.CreatedAt,
                };

            if (Received != null) Received(scoreInfo);
        }
开发者ID:robbell,项目名称:drum-score,代码行数:16,代码来源:TwitterScoreFeed.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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