本文整理汇总了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;
}
示例2: PrimitiveCommandHandler
void PrimitiveCommandHandler(object sender, GenericEventArgs<string> e)
{
if (current.Triangle != null)
{
InvokePrimitive(e.Argument);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例6: OnFileUploadComplete
// Invoke the Changed event; called whenever list changes
protected virtual void OnFileUploadComplete(GenericEventArgs<string> e)
{
if (FileUploadComplete != null)
{
FileUploadComplete(this,e);
}
}
示例7: Demon_OnCollisionWithPlayer
void Demon_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e)
{
if (attackCounter > attackRate)
{
e.Data.Damage(DemonDamage);
attackCounter = TimeSpan.Zero;
}
}
示例8: AngryRock_OnCollisionWithPlayer
void AngryRock_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e)
{
if (currentTime >= RockAttackSpeed)
{
currentTime = TimeSpan.Zero;
e.Data.Damage(RockRamage);
}
}
示例9: ConnectionManagerOnConnected
private void ConnectionManagerOnConnected(object sender, GenericEventArgs<ConnectionResult> e)
{
var apiClient = e.Argument.ApiClient;
if (apiClient != null)
{
apiClient.UserUpdated -= ApiClientOnUserUpdated;
apiClient.UserUpdated += ApiClientOnUserUpdated;
}
}
示例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);
}
}
}
示例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);
});
}
示例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();
}
}
示例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);
}
}
示例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);
}
});
}
示例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);
}
});
}