Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
QuestionWindows Shell Context Menu Pin
95ulisse25-Mar-10 5:51
95ulisse25-Mar-10 5:51 
AnswerRe: Windows Shell Context Menu Pin
95ulisse28-Mar-10 4:38
95ulisse28-Mar-10 4:38 
QuestionExchange Web Services (EWS) Pin
MWRivera25-Mar-10 4:40
MWRivera25-Mar-10 4:40 
AnswerRe: Exchange Web Services (EWS) Pin
MWRivera25-Mar-10 6:50
MWRivera25-Mar-10 6:50 
AnswerRe: Exchange Web Services (EWS) Pin
Ravi Bhavnani25-Mar-10 7:06
professionalRavi Bhavnani25-Mar-10 7:06 
GeneralRe: Exchange Web Services (EWS) Pin
MWRivera29-Mar-10 5:09
MWRivera29-Mar-10 5:09 
GeneralRe: Exchange Web Services (EWS) Pin
Travis Citrine2-Jul-15 17:56
Travis Citrine2-Jul-15 17:56 
QuestionExceptions across invoke Pin
richasea25-Mar-10 4:23
richasea25-Mar-10 4:23 
Hi,

In my code I have interactions with a WPF control, so using Invoke I am able to call my functions, the problem I am having is that the code inside the function throws an exception, and I was wondering if it is possible to move the exception across the Invoke call. so that my code in the calling thread can handle it.

here is my code which hopefully shows the problem better:

<br />
        public void SetProperty(String Path, String Value)<br />
        {<br />
			if (!this.Dispatcher.CheckAccess())<br />
			{<br />
                                Exception exception = null;<br />
				this.Dispatcher.Invoke((Action<String, String>)((path, val) => { <br />
                    <br />
                    try<br />
                    {<br />
                        SetProperty(path, val); // throws an exception<br />
                    }<br />
                    catch (System.Exception e)<br />
                    {<br />
                        exception = e;<br />
                    }<br />
                }), Path, Value, exception);<br />
                if(exception != null){<br />
                    MessageBox.Show(exception.Message);<br />
                }<br />


unfortunately this code doesn't work and I was wondering if there was a way around it.

Thank you in advance.
AnswerRe: Exceptions across invoke Pin
ricmil4225-Mar-10 4:50
ricmil4225-Mar-10 4:50 
GeneralRe: Exceptions across invoke Pin
richasea25-Mar-10 5:40
richasea25-Mar-10 5:40 
GeneralRe: Exceptions across invoke Pin
Keith Barrow25-Mar-10 6:17
professionalKeith Barrow25-Mar-10 6:17 
Questionproblem accessing a control from a thread (the callback is in another user defined class) Pin
George Nistor25-Mar-10 2:57
George Nistor25-Mar-10 2:57 
AnswerRe: problem accessing a control from a thread (the callback is in another user defined class) Pin
Covean25-Mar-10 3:33
Covean25-Mar-10 3:33 
GeneralRe: problem accessing a control from a thread (the callback is in another user defined class) Pin
George Nistor25-Mar-10 3:45
George Nistor25-Mar-10 3:45 
GeneralRe: problem accessing a control from a thread (the callback is in another user defined class) Pin
Covean25-Mar-10 3:59
Covean25-Mar-10 3:59 
QuestionHow to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 1:42
igalep13225-Mar-10 1:42 
AnswerRe: How to get values after dictionary sorting by values with linq Pin
Not Active25-Mar-10 1:46
mentorNot Active25-Mar-10 1:46 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 1:56
igalep13225-Mar-10 1:56 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 2:06
igalep13225-Mar-10 2:06 
AnswerRe: How to get values after dictionary sorting by values with linq Pin
Keith Barrow25-Mar-10 2:02
professionalKeith Barrow25-Mar-10 2:02 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 2:07
igalep13225-Mar-10 2:07 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 5:04
igalep13225-Mar-10 5:04 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
Keith Barrow25-Mar-10 5:25
professionalKeith Barrow25-Mar-10 5:25 
GeneralRe: How to get values after dictionary sorting by values with linq Pin
igalep13225-Mar-10 14:27
igalep13225-Mar-10 14:27 
AnswerRe: How to get values after dictionary sorting by values with linq Pin
lukaszbl25-Mar-10 2:04
lukaszbl25-Mar-10 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.