Click here to Skip to main content
15,887,083 members
Home / Discussions / C#
   

C#

 
QuestionRe: Create an ASMX web service and a web client to simulate a stock exchange and a user customizable stocks ticker Pin
ZurdoDev11-Apr-17 4:34
professionalZurdoDev11-Apr-17 4:34 
AnswerRe: ASMX Web Services Pin
Gerry Schmitz11-Apr-17 7:26
mveGerry Schmitz11-Apr-17 7:26 
AnswerRe: ASMX Web Services Pin
sasolanki00730-Apr-17 17:57
sasolanki00730-Apr-17 17:57 
QuestionC# Task Faulted Problem Pin
Kevin Marois10-Apr-17 8:39
professionalKevin Marois10-Apr-17 8:39 
AnswerRe: C# Task Faulted Problem Pin
User 418025410-Apr-17 10:09
User 418025410-Apr-17 10:09 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois10-Apr-17 10:32
professionalKevin Marois10-Apr-17 10:32 
GeneralRe: C# Task Faulted Problem Pin
User 418025410-Apr-17 10:58
User 418025410-Apr-17 10:58 
AnswerRe: C# Task Faulted Problem Pin
Pete O'Hanlon10-Apr-17 20:21
mvePete O'Hanlon10-Apr-17 20:21 
For continuations, I find it best to use the explicit continuation that suits that particular status. So, your tasks would look something like this:
C#
Task task = Task.Factory.StartNew(() =>
    {
        service.Start();
 
    }, TaskCreationOptions.LongRunning, service.CancellationTokenSource.Token);
task.ContinueWith(antecedent => { AddStatus(string.Format("Service '{0}' completed", service.ServiceId)) }, TaskContinuationOptions.OnlyOnRanToCompletion);
task.ContinueWith(antecedent => { AddStatus(string.Format("Service '{0}' cancelled", service.ServiceId)) }, TaskContinuationOptions.OnlyOnCanceled);
task.ContinueWith(antecedent => { 
  AddStatus(string.Format("Service '{0}' errored", service.ServiceId));
  AddStatus(task.Exception.ToString());
}, TaskContinuationOptions.OnlyOnFaulted);
task.ContinueWith(antecedent => {
  // Remove the service
  App.Current.Dispatcher.Invoke(() =>
  {
    // Remove the model from the UI
    Services.Remove(SelectedService);
    SelectedService = null;
    // If you haven't reached this point, then you don't have a current App Dispatcher...
    AddStatus("Removed from the dispatcher");
  });
  _services.Remove(service);
});

This space for rent

GeneralRe: C# Task Faulted Problem Pin
Kevin Marois11-Apr-17 4:23
professionalKevin Marois11-Apr-17 4:23 
GeneralRe: C# Task Faulted Problem Pin
Pete O'Hanlon11-Apr-17 5:09
mvePete O'Hanlon11-Apr-17 5:09 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois11-Apr-17 5:30
professionalKevin Marois11-Apr-17 5:30 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois11-Apr-17 5:34
professionalKevin Marois11-Apr-17 5:34 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois11-Apr-17 5:49
professionalKevin Marois11-Apr-17 5:49 
GeneralRe: C# Task Faulted Problem Pin
Pete O'Hanlon11-Apr-17 7:01
mvePete O'Hanlon11-Apr-17 7:01 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois11-Apr-17 7:06
professionalKevin Marois11-Apr-17 7:06 
GeneralRe: C# Task Faulted Problem Pin
Pete O'Hanlon11-Apr-17 7:55
mvePete O'Hanlon11-Apr-17 7:55 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois12-Apr-17 6:52
professionalKevin Marois12-Apr-17 6:52 
GeneralRe: C# Task Faulted Problem Pin
Pete O'Hanlon12-Apr-17 21:45
mvePete O'Hanlon12-Apr-17 21:45 
GeneralRe: C# Task Faulted Problem Pin
Kevin Marois13-Apr-17 5:34
professionalKevin Marois13-Apr-17 5:34 
QuestionXML inputs to telnet console in c# Pin
nikhil201510-Apr-17 2:47
nikhil201510-Apr-17 2:47 
QuestionRe: XML inputs to telnet console in c# Pin
Richard MacCutchan10-Apr-17 2:53
mveRichard MacCutchan10-Apr-17 2:53 
AnswerRe: XML inputs to telnet console in c# Pin
Pete O'Hanlon10-Apr-17 2:55
mvePete O'Hanlon10-Apr-17 2:55 
Questionc# Events Redirection in Designer.cs and Visual Studio 2017 More Problems. Pin
zequion7-Apr-17 20:57
professionalzequion7-Apr-17 20:57 
AnswerRe: c# Events Redirection in Designer.cs and Visual Studio 2017 More Problems. Pin
Richard MacCutchan7-Apr-17 21:33
mveRichard MacCutchan7-Apr-17 21:33 
AnswerRe: c# Events Redirection in Designer.cs and Visual Studio 2017 More Problems. Pin
Gerry Schmitz9-Apr-17 8:56
mveGerry Schmitz9-Apr-17 8:56 

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.