Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ProcessWatchImpl/Croissant/MessageFormatter.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 43 by netseed, Mon Dec 7 13:19:52 2009 UTC revision 44 by netseed, Tue Dec 15 16:20:54 2009 UTC
# Line 8  namespace Toast Line 8  namespace Toast
8                  private static readonly Pair<string, string> UriConvert = new Pair<string, string>("@url", "{0}");                  private static readonly Pair<string, string> UriConvert = new Pair<string, string>("@url", "{0}");
9                  private static readonly Pair<string, string> TitleConvert = new Pair<string, string>("@title", "{1}");                  private static readonly Pair<string, string> TitleConvert = new Pair<string, string>("@title", "{1}");
10    
11                  private string FormatString_;                  private string formatString;
12                  private string RawFormatString_;                  private string rawFormatString;
13    
14    
15                  public MessageFormatter(string formatString)                  public MessageFormatter(string formatString)
# Line 19  namespace Toast Line 19  namespace Toast
19                                  throw new ArgumentNullException("formatString");                                  throw new ArgumentNullException("formatString");
20                          }                          }
21    
22                          this.FormatString = formatString;                          FormatString = formatString;
23    
24                  }                  }
25    
# Line 27  namespace Toast Line 27  namespace Toast
27                  {                  {
28                          get                          get
29                          {                          {
30                                  return FormatString_;                                  return formatString;
31                          }                          }
32                          set                          set
33                          {                          {
# Line 36  namespace Toast Line 36  namespace Toast
36                                          throw new ArgumentNullException("FormatString");                                          throw new ArgumentNullException("FormatString");
37                                  }                                  }
38    
39                                  FormatString_ = value;                                  formatString = value;
40    
41                                  RawFormatString_ = FormatString_.Replace(UriConvert.ValueT, UriConvert.ValueU);                                  rawFormatString = formatString.Replace(UriConvert.ValueT, UriConvert.ValueU);
42                                  RawFormatString_ = RawFormatString_.Replace(TitleConvert.ValueT, TitleConvert.ValueU);                                  rawFormatString = rawFormatString.Replace(TitleConvert.ValueT, TitleConvert.ValueU);
43                          }                          }
44                  }                  }
45    
# Line 57  namespace Toast Line 57  namespace Toast
57                          }                          }
58    
59    
60                          return string.Format(RawFormatString_, uri, title);                          return string.Format(rawFormatString, uri, title);
61                  }                  }
62    
63                  public string BuildMessage(LiveProgram Source)                  public string BuildMessage(LiveProgram Source)

Legend:
Removed from v.43  
changed lines
  Added in v.44

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26