3 using System
.Collections
;
4 using System
.Collections
.Generic
;
8 static int Main (string [] args
)
11 string sourcefile
= args
[0];
12 string cpp_symbol
= args
[1];
14 string destfile
= Path
.ChangeExtension (sourcefile
, ".h");
15 string [] source
= File
.ReadAllLines (sourcefile
);
16 List
<string> dest
= new List
<string> ();
18 dest
.Add (string.Format (@"/*
19 * {0}: the xaml for the fullscreen message.
22 * Moonlight List (moonlight-list@lists.ximian.com)
24 * Copyright 2007 Novell, Inc. (http://www.novell.com)
26 * See the LICENSE file included with the distribution for details.
30 dest
.Add (string.Format ("#define {0} \\", cpp_symbol
));
32 for (int i
= 0; i
< source
.Length
; i
++) {
34 StringBuilder sb
= new StringBuilder ();
35 /* put the leading whitespace in the file */
36 for (j
= 0; j
< source
[i
].Length
; j
++) {
37 if (!Char
.IsWhiteSpace (source
[i
], j
))
40 if (j
> 0) sb
.Append (source
[i
].Substring (0, j
));
41 sb
.Append ("\"" + source
[i
].Substring (j
).Replace ("\"", "\\\"") + (source
[i
][source
[i
].Length
-1] == '>' ? "" : " ") + "\" \\");
42 dest
.Add (sb
.ToString());
46 File
.WriteAllLines (destfile
, dest
.ToArray ());
49 } catch (Exception ex
) {
50 Console
.WriteLine (ex
.Message
);
51 Console
.WriteLine (ex
.StackTrace
);