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


C# GenericEventArgs类代码示例

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


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


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