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
2
votes
1 answer

How to add an event handler using reflection when do not have access to EventArgs type?

I have the following code in one assembly: namespace MyLibrary { class InternalClass { public event EventHandler MyEvent; public void RaiseMyEvent() { MyEvent(this, new MyArgs()); } …
cubetwo1729
  • 1,438
  • 1
  • 11
  • 18
2
votes
1 answer

Passing a value on SelectedIndexChange

My page currently looks like this:
JimmyK
  • 4,801
  • 8
  • 35
  • 47
2
votes
3 answers

Can someone please explain to me in the most layman terms how to use EventArgs?

I know they have something to do with delegates. I've tried but I still don't comprehend how to use those either. I know a little about event handlers but what I really want to know is how I can use plain old eventargs that are part of most…
jetstreamin
  • 407
  • 5
  • 19
2
votes
1 answer

'System.EventArgs' does not contain a definition for 'Location'

I want to zoom a chart private void toolStripButtonZoom_Click(object sender, System.EventArgs e) { double posXStart = chartMain.ChartAreas[0].AxisX.PixelPositionToValue(e.Location.X) - (xMax - xMin) / 0.5; double posXFinish =…
aysekucuk
  • 461
  • 5
  • 16
2
votes
1 answer

Is it possible to find location of UIBarButtonItem when pressed in Monotouch?

In my MonoTouch application, when the user presses a UIBarButtonItem in the NavigationBar, I am trying to display a small UIMenuController relative to where the user touched the screen. I was able to do this previously in Objective C with the…
cain
  • 1,028
  • 1
  • 12
  • 26
2
votes
1 answer

How to cast KeyValuePair passed as Parameter to Command_Executed?

Seemingly simple concept but can't get past this. I have a Command...the _Executed method receives a KeyValuePair (types don't matter) as it's Parameter. myCommand_Executed(object sender, ExecutedRoutedEventArgs e) { …
tronious
  • 1,547
  • 2
  • 28
  • 45
2
votes
2 answers

NUnit Testing Event Args Data

I have always got around this problem by - unfortunately - using events less. However this time I came up with a nifty trick, however I don't think the following would be considered a proper approach. Is there a recommended method to achieve the…
Matt Canty
  • 2,395
  • 5
  • 35
  • 50
2
votes
5 answers

C# Custom Events based on time

I have a function OnCreate() that runs once every second. OnCreate calls other functions based on the current time (current second). But instead of having to write each function individually inside of OnCreate, I would like to be able to group…
ryanb9
  • 211
  • 3
  • 4
1
vote
3 answers

Invoke methods in a thread

I can't use eventArgs from a method trigged for a second Thread: public class MovilinkCommunication { //Method Declarations public delegate void MovilinkWatchParametersEventMethod(ParameterAddress sender, MovilinkEventArgs e); private…
1
vote
3 answers

VB.Net, EventArgs, ByRef and ByVal

In VB.Net, I have an object named WorkflowButtonEventArgs that inherits from System.EventArgs. The WorkflowButtonEventArgs class contains two ByRef Properties. These are objects that are in memory, and I do not want them duplicated or copied in any…
1
vote
2 answers

Using the properties of a System.EventArgs in C#

I have an application which was using a System.Windows.Forms.WebBrowser to enable users to navigate to a web page in order to allow an OAuth2 autentication to take place. This works for one authentication but for another it seems that WebBrowser…
1
vote
1 answer

Handling a ComboBox Selection using WPF,MVVM, and the SelectionChanged Event

I have a ComboBox. When users try change the selectedItem on the ComboBox, I want a MessageBox to pop up and confirm whether or not they want to change their selection. If not, the selection should not change. This is what I originally…
1
vote
0 answers

Inject different EventArgs into event per for each listener?

So I have an EventHandler: public event EventHandler Confirmed; protected void RaiseConfirmed() { Confirmed?.Invoke(this, new CustomEventArgs(Color.red)); } And I have a couple of event listeners in different classes, such…
WavyRancheros
  • 121
  • 1
  • 4
1
vote
0 answers

c# ObservableCollection NotifyCollectionChangedEventArgs Members

Why the class NotifyCollectionChangedEventArgs in the ObservableCollection's event CollectionChanged have the properties: IList NewItems IList OldItems As IList (notice the s at the end, also when I use it I have to call it like NewItems[0]) if the…
Taher
  • 565
  • 1
  • 14
  • 32
1
vote
2 answers

invoke datagridview events in wpf programmatically

(Beginner's question, if offended please move on, otherwise your input is welcome) Im trying to invoke datagridview events in Wpf code. Implementing the event calling is straight forward. for example: dgv1.ColumnHeaderMouseClick+=delegate( …