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