Questions tagged [eventargs]

Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data.

Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data.

This class serves as the base class for all classes that represent event data. For example, the System.AssemblyLoadEventArgs class derives from EventArgs and is used to hold the data for assembly load events. To create a custom event data class, create a class that derives from the EventArgs class and provide the properties to store the necessary data. The name of your custom event data class should end with EventArgs.

http://msdn.microsoft.com/en-us/library/system.eventargs(v=vs.110).aspx

164 questions
1
vote
1 answer

C# NullReferenceException while EventHandler

I get a NullRefernceException even though I subscribed to the event in an Start Methode. Where I create my Event: public EventHandler ClickEvent; private void OnMouseDown() { Debug.Log("Clicked"); CustomArgs args…
Manubown
  • 21
  • 3
1
vote
1 answer

Unity Dark Rift Online Event Args Issue

we are attempting to set up an online server and connect players to a server using Dark Rift, a collection of libraries. We are getting an error with a part of our code that checks when a player joins a game, it spawns a player connected to their…
Zach
  • 21
  • 1
  • 3
1
vote
3 answers

how to access Custom EventArgs class in Button click event?

As a follow up to: access values within custom eventargs class How do I access public variables within custom Eventargs class, using button click or any other method? Example Custom Event Args class: public class TraderEventArgs: EventArgs { …
CraigJSte
  • 912
  • 6
  • 17
  • 33
1
vote
1 answer

Custom EventArgs Messagebox on Function does not show property from sender class

I have a class with two properties: weigh and Id. I want to trigger an event when weigh is set. The event to be triggered is a messageBox showing the Id property. The Messagebox is shown, but it doesn't include the Id property. Here's the entire…
Destroyer
  • 13
  • 2
1
vote
1 answer

Best Practice for IEnumerable in event arguments

I have a DLL including a class for managing audio and midi ports and connections. Whenever ports are registered or deregistered or connections are formed or released, this class fires an event, like ConnectionChanged with custom event arguments…
Residuum
  • 11,878
  • 7
  • 40
  • 70
1
vote
1 answer

.net: In a 3-layer Windows application Project, where it should be declared an EventArg class?

In a 3-layer Windows application Project, where it should be declared an EventArg class?
odiseh
  • 25,407
  • 33
  • 108
  • 151
1
vote
1 answer

Read EventArgs from Richtextbox-Scroll event via Powershell

$DebugPreference = "Continue" [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $form = New-Object system.Windows.Forms.Form $form.size = "400,400" $rtb = New-Object system.Windows.Forms.RichTextBox $rtb.size =…
Moss
  • 325
  • 2
  • 16
1
vote
2 answers

How do I find which eventargs class to use in asp.net control event

If I add an event to my control in the markup, eg in and EntityDataSource add a OnUpdating, how can I find the method parameter list? eg how do I know to put in (object sender, EntityDataSourceChangingEventArgs e) instead of (object sender,…
1
vote
2 answers

using EventToCommand & PassEventArgsToCommand :: how to get sender, or better metaphor?

The point of what I'm doing is that there are a lot of things that need to happen in the viewmodel, but when the view has been loaded, not on constructor. I could wire up event handlers and send messages, but that just seems kinda sloppy to me. I'm…
JoeBrockhaus
  • 2,745
  • 2
  • 40
  • 64
1
vote
2 answers

Xamarin iOS EventArgs missing first property

When using EventArgs attribute on delegate method it generates event handler class with properties based on method parameters except the first one. The first parameter is missing in generated event args class. For example: [Protocol,…
awattar
  • 446
  • 5
  • 19
1
vote
1 answer

Difference between ByVal sender as object.... and Sender as object

I'm completely new to coding, and have been trying do a lot of at home research. I'm currently using VB 2012 and have noticed that on a lot of forums people have (ByVal Sender as Object,... present when I load up a button or form, my code…
1
vote
2 answers

Should EventArgs contain EventArgs?

I'm writing a particle system and have a hierarchy of one emitter containing many particles. Particles fire an event on collision with the world: public event EventHandler onHitCallback; I am in the process of having the…
Vesuvian
  • 697
  • 1
  • 7
  • 22
1
vote
2 answers

Correct usage of generics in event declaration

I have a data object which I pass around : public class TimedResult { public ResultRequest Request { get; set; } public T Data { get; set; } public TimeSpan TimeTaken { get; set; } } In my Manager class I have some work done which…
sprocket12
  • 5,368
  • 18
  • 64
  • 133
1
vote
2 answers

C# NumericUpDown.OnValueChanged, how it was changed?

I would like to ask how to make custom EventArgs for existing event handler. Lets say, that I have NumericUpDown numericUpDown control and I want handler for its OnValueChanged event. Double clicking to ValueChanged in visual studio makes snippet…
Zereges
  • 5,139
  • 1
  • 25
  • 49
1
vote
1 answer

Caliburn.Micro 2.0 and WP 8.1 - Message.Attach not send $eventArgs to event handler

I've developed an app on windows phone 8.1. When the event is triggered is not sent the eventArgs. Why? In the old solution WP 8.0 this syntax works fine....
Fra
  • 91
  • 5