Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Media Player - Play MP3. Pin
RichardGrimmer21-Nov-16 4:42
RichardGrimmer21-Nov-16 4:42 
QuestionNetwork File Path Problem Pin
Kevin Marois18-Nov-16 10:30
professionalKevin Marois18-Nov-16 10:30 
AnswerRe: Network File Path Problem Pin
OriginalGriff18-Nov-16 21:44
mveOriginalGriff18-Nov-16 21:44 
AnswerRe: Network File Path Problem Pin
Bernhard Hiller20-Nov-16 21:10
Bernhard Hiller20-Nov-16 21:10 
AnswerRe: Network File Path Problem Pin
Richard Deeming21-Nov-16 2:58
mveRichard Deeming21-Nov-16 2:58 
GeneralRe: Network File Path Problem Pin
Kevin Marois21-Nov-16 4:43
professionalKevin Marois21-Nov-16 4:43 
QuestionHow To Refactor This Pin
Kevin Marois18-Nov-16 4:48
professionalKevin Marois18-Nov-16 4:48 
AnswerRe: How To Refactor This Pin
Pete O'Hanlon18-Nov-16 5:41
mvePete O'Hanlon18-Nov-16 5:41 
Something like this:
C#
private List<string> terms = new List<string>();

// In the constructor (or wherever)
terms.Add("Extension 2 RTD out range. Reading:");
terms.Add("Denature 1 RTD in range. Reading:");
terms.Add("Denature 1 RTD out of range. Reading:");
// and so on...

// In the method that we want to check
foreach (string term in terms)
{
  if (Parse(term))
  {
    break;
  }
}

private bool Parse(string text)
{
  int index = line.IndexOf(text);
  if (index > -1)
  {
    string data = line.Subsctring(index + text.Length);
    double value;
    if (double.TryParse(data, out value))
    {
      ((RTDTestModel)model).Extension2ActualValue = value;
    }
  }
}

This space for rent

GeneralRe: How To Refactor This Pin
Kevin Marois18-Nov-16 6:03
professionalKevin Marois18-Nov-16 6:03 
GeneralRe: How To Refactor This Pin
Gerry Schmitz18-Nov-16 7:49
mveGerry Schmitz18-Nov-16 7:49 
GeneralRe: How To Refactor This Pin
Kevin Marois18-Nov-16 9:03
professionalKevin Marois18-Nov-16 9:03 
GeneralRe: How To Refactor This Pin
Gerry Schmitz18-Nov-16 10:44
mveGerry Schmitz18-Nov-16 10:44 
QuestionSaving Datagridview Pin
Member 1285691017-Nov-16 12:23
Member 1285691017-Nov-16 12:23 
AnswerRe: Saving Datagridview Pin
Dave Kreskowiak17-Nov-16 13:00
mveDave Kreskowiak17-Nov-16 13:00 
QuestionWinForm Installation Config files directory .. Pin
JP9017-Nov-16 6:05
JP9017-Nov-16 6:05 
AnswerRe: WinForm Installation Config files directory .. Pin
OriginalGriff17-Nov-16 6:38
mveOriginalGriff17-Nov-16 6:38 
Questionenquary Pin
Ramesh_sahu16-Nov-16 22:22
Ramesh_sahu16-Nov-16 22:22 
AnswerRe: enquary PinPopular
Richard MacCutchan16-Nov-16 22:27
mveRichard MacCutchan16-Nov-16 22:27 
GeneralRe: enquary Pin
Pete O'Hanlon16-Nov-16 22:55
mvePete O'Hanlon16-Nov-16 22:55 
GeneralRe: enquary Pin
Richard MacCutchan16-Nov-16 23:23
mveRichard MacCutchan16-Nov-16 23:23 
AnswerRe: enquary Pin
Pete O'Hanlon16-Nov-16 23:01
mvePete O'Hanlon16-Nov-16 23:01 
GeneralRe: enquary Pin
Mycroft Holmes16-Nov-16 23:05
professionalMycroft Holmes16-Nov-16 23:05 
GeneralRe: enquary Pin
OriginalGriff16-Nov-16 23:11
mveOriginalGriff16-Nov-16 23:11 
GeneralRe: enquary Pin
Pete O'Hanlon17-Nov-16 0:42
mvePete O'Hanlon17-Nov-16 0:42 
AnswerRe: enquary Pin
ZurdoDev17-Nov-16 1:11
professionalZurdoDev17-Nov-16 1:11 

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.