Example #1
0
        /// <summary>
        /// downloads the data files for all stations specified in the
        /// XML file and writes progress to the 'log' message string
        /// </summary>
        /// <param name="stationXmlFile"></param>
        public int DownloadAll(string stationXmlFile, System.Text.StringBuilder log, string format)
        {
            _format = format;

            int numStations = 0;

            //read xml file
            List<Station> stList = Station.ReadListOfStations(stationXmlFile);
            log.AppendLine(DateTime.Now.ToString() + " downloading stations from Fiedler");

            foreach (Station st in stList)
            {
                try
                {
                    if (_format == "CHMI_1")
                    {
                        DownloadFile(st.Id, st.Id + "_chm.txt");
                    }
                    else
                    {
                        DownloadFile(st.Id, st.Id + ".dta");
                    }
                    ++numStations;
                }
                catch (Exception ex)
                {
                    //log the exception's message
                    log.AppendLine("error - " + st.Name + " " + ex.Message);
                }
            }
            return numStations;
        }
Example #2
0
 public override void Serialize(
     System.Text.StringBuilder text,
     int indentLevel)
 {
     var indent = new string('\t', indentLevel);
     var indent2 = new string('\t', indentLevel + 1);
     if (null != this.Name)
     {
         text.AppendFormat("{0}{1} /* {2} */ = {{", indent, this.GUID, this.Name);
     }
     else
     {
         text.AppendFormat("{0}{1} = {{", indent, this.GUID);
     }
     text.AppendLine();
     text.AppendFormat("{0}isa = {1};", indent2, this.IsA);
     text.AppendLine();
     if (null != this.Dependency)
     {
         text.AppendFormat("{0}target = {1} /* {2} */;", indent2, this.Dependency.GUID, this.Dependency.Name);
         text.AppendLine();
     }
     text.AppendFormat("{0}targetProxy = {1} /* {2} */;", indent2, this.Proxy.GUID, this.Proxy.Name);
     text.AppendLine();
     text.AppendFormat("{0}}};", indent);
     text.AppendLine();
 }
Example #3
0
        private string PrintDom(HtmlElementCollection elemColl, System.Text.StringBuilder returnStr, Int32 depth)
        {
            System.Text.StringBuilder str = new System.Text.StringBuilder();

            foreach (HtmlElement elem in elemColl)
            {
                string elemName;

                elemName = elem.GetAttribute("ID");
                if (elemName == null || elemName.Length == 0)
                {
                    elemName = elem.GetAttribute("name");
                    if (elemName == null || elemName.Length == 0)
                    {
                        elemName = "<no name>";
                    }
                }

                str.Append(' ', depth * 4);
                str.Append(elemName + ": " + elem.TagName + "(Level " + depth + ")");
                returnStr.AppendLine(str.ToString());

                if (elem.CanHaveChildren)
                {
                    PrintDom(elem.Children, returnStr, depth + 1);
                }

                str.Remove(0, str.Length);
            }

            return (returnStr.ToString());
        }
		protected override void AppendOperatingSystem (System.Text.StringBuilder sb)
		{
			var psi = new System.Diagnostics.ProcessStartInfo ("uname", "-a") {
				RedirectStandardOutput = true,
				UseShellExecute = false,
			};
			
			var process = System.Diagnostics.Process.Start (psi);
			process.WaitForExit (500);
			if (process.HasExited && process.ExitCode == 0) {
				sb.Append ("\t");
				string val = process.StandardOutput.ReadLine ();

				//wrap the mac value across multiple lines
				if (Platform.IsMac && val != null) {
					var split = val.Split (new string[] { ";", ": " }, StringSplitOptions.RemoveEmptyEntries);
					for (int i = 0; i < split.Length; i++) {
						split[i] = split[i].Trim ();
					}
					val = String.Join ("\n\t    ", split);
				}

				sb.AppendLine (val);
			}
		}
		internal override void AppendOperatingSystem (System.Text.StringBuilder sb)
		{
			sb.Append ("\tWindows ");
			sb.Append (Environment.OSVersion.Version.ToString ());
			if (IntPtr.Size == 8 || Environment.GetEnvironmentVariable ("PROCESSOR_ARCHITEW6432") != null)
				sb.Append (" (64-bit)");
			sb.AppendLine ();
		}
        /// <summary>
        /// Output HTML,  in this case a heading
        /// </summary>
        /// <param name="index"></param>
        public void OutputHtml(System.Text.StringBuilder index, int indent)
        {
            index.Append("<h3>");
            index.Append(this.Text);
            index.AppendLine("</h3>");

            if (Nodes.Count > 0)
            {
                int newIndent = indent + 1;
                index.AppendLine("<blockquote><dl>");
                foreach (var node in this.Nodes)
                {
                    if (node is IHtmlWriter)
                        ((IHtmlWriter)node).OutputHtml(index, newIndent);
                }
                index.AppendLine("</dl></blockquote>");
            }
        }
Example #7
0
        public static System.Text.StringBuilder AppendLine(System.Text.StringBuilder builder)
        {
#if CF2
            return builder.Append("\r\n");
#elif FX11
            return builder.Append(Environment.NewLine);
#else
            return builder.AppendLine();
#endif
        }
Example #8
0
 public override void Export(LevelEditState l, System.Text.StringBuilder texturesDec, System.Text.StringBuilder texturesDef, System.Text.StringBuilder mainString)
 {
     string path = l.form.lstTextures.Items[l.importedTextures.IndexOf(this.Sprite)].ToString();
     string[] tokens = path.Split('\\');
     path = tokens.Last();
     path = path.Substring(0, path.IndexOf('.'));
     if (!texturesDec.ToString().Contains(path))
     {
         texturesDec.AppendLine("protected Texture2D " + path + ';');
         texturesDef.AppendLine(path + " = content.Load<Texture2D>(\"realassets\\\\" + path + "\");");
     }
     mainString.AppendLine("this.interactables.Add(new PressurePlate(new BoundingBox(new Vector3(" + MinX + ", " + MinY + ", 0), new Vector3(" + MaxX + ", " + MaxY + ", 0)), this, " + path + ", REPLACE ME WITH DELEGATE));");
 }
		protected override void GeneratePostInitializationCode(string directiveName, System.Text.StringBuilder codeBuffer, System.CodeDom.Compiler.CodeDomProvider languageProvider, IDictionary<string, string> requiresArguments, IDictionary<string, string> providesArguments)
		{
			if (IsDirectiveSupported(directiveName))
			{
				string ruleName = requiresArguments["RuleName"];

				if (String.IsNullOrEmpty(ruleName))
				{
					throw new ArgumentNullException("ruleName");
				}
				codeBuffer.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "{{ System.Type ruleType = System.Type.GetType(\"{0}\");", ruleName);
				codeBuffer.AppendLine("if (ruleType != null) { this.Store.RuleManager.DisableRule(ruleType); } }");
			}
		}
		protected override void AppendOperatingSystem (System.Text.StringBuilder sb)
		{
			var psi = new System.Diagnostics.ProcessStartInfo ("uname", "-a") {
				RedirectStandardOutput = true,
				UseShellExecute = false,
			};
			
			var process = System.Diagnostics.Process.Start (psi);
			process.WaitForExit (500);
			if (process.HasExited && process.ExitCode == 0) {
				sb.Append ("\t");
				sb.AppendLine (process.StandardOutput.ReadLine ());
			}
		}
Example #11
0
        public override void Write(System.Text.StringBuilder sb)
        {
            ++IndentCount;
            Indent(sb); sb.AppendFormat("export interface {0}", TypeDefinition.ToTypeScriptItemName());

            if (TypeDefinition.HasGenericParameters)
            {
                sb.Append("<");
                TypeDefinition.GenericParameters.For((genericParam, i, isLastItem) =>
                {
                    sb.AppendFormat("{0}{1}", genericParam.ToTypeScriptType(), (isLastItem ? "" : ", "));
                });
                sb.Append(">");
            }

            sb.AppendLine(" {");
            IndentCount++;

            // 'ctor' is at index 0
            // 'invoke' is at index 1
            var invokeMethod = TypeDefinition.Methods[1];
            if (invokeMethod.Parameters.Any())
            {
                var target = invokeMethod.Parameters[0];
                Indent(sb); sb.AppendFormatLine("target: {0};", target.ParameterType.ToTypeScriptType());
            }
            else
            {
                Indent(sb); sb.AppendFormatLine("target: any;");
            }
            Indent(sb); sb.AppendFormatLine("detail: any[];");

            Indent(sb); sb.AppendLine("type: string;");
            IndentCount--;
            Indent(sb); sb.AppendLine("}");

        }
Example #12
0
        public void Print(System.Text.StringBuilder buffer)
        {
            buffer.Append("define ");
            buffer.Append(Name);
            buffer.Append('(');

            for (int i = 0; i < m_argNames.Length; ++i)
            {
                buffer.Append(m_argNames[i]);
                if (i + 1 < m_argNames.Length)
                    buffer.Append(", ");
            }

            buffer.AppendLine(")");

            foreach (Statement statement in m_statements)
            {
                statement.Print(buffer, "\t");
            }
        }
 private static void GetDoorGraphic(System.Text.StringBuilder graphic)
 {
     graphic.AppendLine("-------------");
     graphic.AppendLine("---+######+--");
     graphic.AppendLine("---|#[==]#|--");
     graphic.AppendLine("---|######|--");
     graphic.AppendLine("---|o#####|--");
     graphic.AppendLine("---|######|--");
 }
Example #14
0
 private void diff(System.Text.StringBuilder output, List<string> expected, List<string> actual, int start, int end, string fmt="0")
 {
     for (int i=start; i<=end; i++)
         output.AppendLine(String.Format("-{0:"+fmt+"} {1}", i+1, expected[i]));
     for (int i=start; i<=end; i++)
         output.AppendLine(String.Format("+{0:"+fmt+"} {1}", i+1, actual[i]));
 }
Example #15
0
 /// <param name="output"></param>
 /// <param name="input">Input text</param>
 /// <param name="index">Line index</param>
 /// <param name="before">Number of line before line index</param>
 /// <param name="fmt"></param>
 private void before(System.Text.StringBuilder output, List<string> input, int index, int before, string fmt="0")
 {
     for(int line=index-before; line<index; line++)
         if (line > 0) output.AppendLine(String.Format(" {0:"+fmt+"} {1}", line+1, input[line]));
 }
Example #16
0
 /// <param name="output"></param>
 /// <param name="input">Input text</param>
 /// <param name="index">Line index</param>
 /// <param name="after">Number of line after line index</param>
 /// <param name="fmt"></param>
 private void after(System.Text.StringBuilder output, List<string> input, int index, int after, string fmt="0")
 {
     for(int line=index+1; line<=index+after; line++)
         if (line < input.Count) output.AppendLine(String.Format(" {0:"+fmt+"} {1}", line+1, input[line]));
 }
 private static void GetIntersectionGraphic(System.Text.StringBuilder graphic)
 {
     graphic.AppendLine(@"||\--------/|");
     graphic.AppendLine(@"|||\------/||");
     graphic.AppendLine(@"||||@@@@@@|||");
     graphic.AppendLine(@"||||@@@@@@|||");
     graphic.AppendLine(@"|||/------\||");
     graphic.AppendLine(@"||/--------\|");
 }
Example #18
0
        private void DoToString(System.Text.StringBuilder builder, string format, int depth)
        {
            switch (format)
            {
                case "":
                case null:
                case "g":
                case "G":
                    builder.AppendFormat("{0} {1} {2}", AttributedType.ToString(), AttributedName.ToString(), AttributedValue.ToString());
                    break;

                case "f":
                case "F":
                    builder.Append(' ', 3*depth);
                    builder.AppendFormat("{0} {1} {2} (key = {3})", AttributedType.ToString(), AttributedName.ToString(), AttributedValue.ToString(), Key);
                    if (Parent != null)
                    {
                        builder.AppendLine();
                        Parent.DoToString(builder, format, depth + 1);
                    }
                    break;

                default:
                    builder.Append(base.ToString(format, null));
                    break;
            }
        }
Example #19
0
        private void InternalSerialize(
            System.Text.StringBuilder text,
            int indentLevel)
        {
            var indent = new string('\t', indentLevel);
            var indent2 = new string('\t', indentLevel + 1);
            var indent3 = new string('\t', indentLevel + 2);
            var indent4 = new string('\t', indentLevel + 3);
            text.AppendLine();
            text.AppendFormat("/* Begin PBXProject section */");
            text.AppendLine();

            text.AppendFormat("{0}{1} /* Project object */ = {{", indent, this.GUID);
            text.AppendLine();
            text.AppendFormat("{0}isa = {1};", indent2, this.IsA);
            text.AppendLine();
            text.AppendFormat("{0}attributes = {{", indent2);
            text.AppendLine();

            var clangMeta = Bam.Core.Graph.Instance.PackageMetaData<Clang.MetaData>("Clang");

            text.AppendFormat("{0}LastUpgradeCheck = {1};", indent3, clangMeta.LastUpgradeCheck);
            text.AppendLine();
            text.AppendFormat("{0}}};", indent2);
            text.AppendLine();
            // project configuration list is always the first
            var projectConfigurationList = this.ConfigurationLists[0];
            text.AppendFormat("{0}buildConfigurationList = {1} /* Build configuration list for {2} \"{3}\" */;", indent2, projectConfigurationList.GUID, projectConfigurationList.Parent.IsA, projectConfigurationList.Parent.Name);
            text.AppendLine();
            text.AppendFormat("{0}compatibilityVersion = \"{1}\";", indent2, "Xcode 3.2"); // TODO
            text.AppendLine();
            text.AppendFormat("{0}mainGroup = {1};", indent2, this.MainGroup.GUID);
            text.AppendLine();
            text.AppendFormat("{0}productRefGroup = {1} /* {2} */;", indent2, this.ProductRefGroup.GUID, this.ProductRefGroup.Name);
            text.AppendLine();
            text.AppendFormat("{0}projectDirPath = \"\";", indent2);
            text.AppendLine();
            if (this.ProjectReferences.Count > 0)
            {
                text.AppendFormat("{0}projectReferences = (", indent2);
                text.AppendLine();
                foreach (var projectRef in this.ProjectReferences)
                {
                    text.AppendFormat("{0}{", indent3);
                    text.AppendLine();
                    text.AppendFormat("{0}ProductGroup = {1} /* {2} */;", indent4, projectRef.Key.GUID, projectRef.Key.Name);
                    text.AppendLine();
                    text.AppendFormat("{0}ProjectRef = {1} /* {2} */;", indent4, projectRef.Value.GUID, projectRef.Value.Name);
                    text.AppendLine();
                    text.AppendFormat("{0}},", indent3);
                    text.AppendLine();
                }
                text.AppendFormat("{0});", indent2);
                text.AppendLine();
            }
            text.AppendFormat("{0}targets = (", indent2);
            text.AppendLine();
            foreach (var target in this.Targets.Values)
            {
                text.AppendFormat("{0}{1} /* {2} */,", indent3, target.GUID, target.Name);
                text.AppendLine();
            }
            text.AppendFormat("{0});", indent2);
            text.AppendLine();
            text.AppendFormat("{0}}};", indent);
            text.AppendLine();

            text.AppendFormat("/* End PBXProject section */");
            text.AppendLine();
        }
Example #20
0
 WriteRules(
     System.Text.StringBuilder rules)
 {
     foreach (var target in this.Targets)
     {
         var name = target.VariableName;
         if (null != name)
         {
             rules.AppendFormat("$({0}):", name);
         }
         else
         {
             if (target.IsPhony)
             {
                 rules.AppendFormat(".PHONY: {0}", target.Path);
                 rules.AppendLine();
             }
             rules.AppendFormat("{0}:", target.Path);
         }
         foreach (var pre in this.Prequisities)
         {
             rules.AppendFormat("{0} ", pre.Key.GeneratedPaths[pre.Value]);
         }
         foreach (var pre in this.PrerequisitePaths)
         {
             rules.AppendFormat("{0} ", pre.ParseAndQuoteIfNecessary());
         }
         foreach (var pre in this.PrerequisiteTargets)
         {
             var preName = pre.VariableName;
             if (null == preName)
             {
                 rules.AppendFormat("{0} ", pre.Path.Parse());
             }
             else
             {
                 rules.AppendFormat("$({0}) ", preName);
             }
         }
         if (this.OrderOnlyDependencies.Count > 0)
         {
             rules.AppendFormat("| {0}", this.OrderOnlyDependencies.ToString(' '));
         }
         rules.AppendLine();
         foreach (var command in this.ShellCommands)
         {
             // look for text like $ORIGIN, which needs a double $ prefix (and quotes) to avoid being interpreted as an environment variable by Make
             var escapedCommand = System.Text.RegularExpressions.Regex.Replace(command, @"\$([A-Za-z0-9]+)", @"'$$$$$1'");
             // any parentheses that are not associated with MakeFile commands must be escaped
             if (!System.Text.RegularExpressions.Regex.IsMatch(escapedCommand, @"\$\(.*\)"))
             {
                 EscapeCharacter(ref escapedCommand, '(');
                 EscapeCharacter(ref escapedCommand, ')');
             }
             rules.AppendFormat("\t{0}", escapedCommand);
             rules.AppendLine();
         }
     }
 }
Example #21
0
 public override void Export(LevelEditState l, System.Text.StringBuilder texturesDec, System.Text.StringBuilder texturesDef, System.Text.StringBuilder mainString)
 {
     string path = l.form.lstTextures.Items[l.importedTextures.IndexOf(this.Sprite)].ToString();
     string[] tokens = path.Split('\\');
     path = tokens.Last();
     path = path.Substring(0, path.IndexOf('.'));
     if (!texturesDec.ToString().Contains(path))
     {
         texturesDec.AppendLine("protected Texture2D " + path + ';');
         texturesDef.AppendLine(path + " = content.Load<Texture2D>(\"realassets\\\\" + path + "\");");
     }
     mainString.AppendLine("this.walls.Add(new Rust(new BoundingBox(new Vector3(" + this._X + ", " + this._Y + ", 0), new Vector3(" + this._X + " + " + _Width + ", " + this._Y + " + " + _Height + ", 0)), this, " + this.disappearLength + ", " + path + "));");
 }
 private static void GetWallGraphic(System.Text.StringBuilder graphic)
 {
     graphic.AppendLine("-------------");
     graphic.AppendLine("-------------");
     graphic.AppendLine("-------------");
     graphic.AppendLine("-------------");
     graphic.AppendLine("-------------");
     graphic.AppendLine("-------------");
 }
Example #23
0
 public override void Serialize(
     System.Text.StringBuilder text,
     int indentLevel)
 {
     var indent = new string('\t', indentLevel);
     var indent2 = new string('\t', indentLevel + 1);
     var indent3 = new string('\t', indentLevel + 2);
     if (null != this.Name)
     {
         text.AppendFormat("{0}{1} /* {2} */ = {{", indent, this.GUID, this.Name);
     }
     else
     {
         text.AppendFormat("{0}{1} = {{", indent, this.GUID);
     }
     text.AppendLine();
     text.AppendFormat("{0}isa = {1};", indent2, this.IsA);
     text.AppendLine();
     if (this.Children.Count > 0)
     {
         text.AppendFormat("{0}children = (", indent2);
         text.AppendLine();
         foreach (var child in this.Children.OrderBy(item => item.Name))
         {
             text.AppendFormat("{0}{1} /* {2} */,", indent3, child.GUID, child.Name);
             text.AppendLine();
         }
         text.AppendFormat("{0});", indent2);
         text.AppendLine();
     }
     if (null != this.Name)
     {
         text.AppendFormat("{0}name = \"{1}\";", indent2, this.Name);
         text.AppendLine();
     }
     text.AppendFormat("{0}sourceTree = \"{1}\";", indent2, this.SourceTree);
     text.AppendLine();
     text.AppendFormat("{0}}};", indent);
     text.AppendLine();
 }
Example #24
0
 public override void Export(LevelEditState l, System.Text.StringBuilder texturesDec, System.Text.StringBuilder texturesDef, System.Text.StringBuilder mainString)
 {
     string path = l.form.lstTextures.Items[l.importedTextures.IndexOf(this.Sprite)].ToString();
     string[] tokens = path.Split('\\');
     path = tokens.Last();
     path = path.Substring(0, path.IndexOf('.'));
     if (!texturesDec.ToString().Contains(path))
     {
         texturesDec.AppendLine("protected Texture2D " + path + ';');
         texturesDef.AppendLine(path + " = content.Load<Texture2D>(\"realassets\\\\" + path + "\");");
     }
     mainString.AppendLine("this.doodads.Add(new AnimatedDoodad(" + path + ", " + Width + ", " + Height + ", " + Frames + ", " + Rows + ", " + Repeat + ", " + Milliseconds + ", new Vector2(" + position.X + ", " + position.Y + ")));");
 }
Example #25
0
 public override void Export(LevelEditState l, System.Text.StringBuilder texturesDec, System.Text.StringBuilder texturesDef, System.Text.StringBuilder mainString)
 {
     string path = l.form.lstTextures.Items[l.importedTextures.IndexOf(this.Sprite)].ToString();
     string[] tokens = path.Split('\\');
     path = tokens.Last();
     path = path.Substring(0, path.IndexOf('.'));
     if (!texturesDec.ToString().Contains(path))
     {
         texturesDec.AppendLine("protected Texture2D " + path + ';');
         texturesDef.AppendLine(path + " = content.Load<Texture2D>(\"realassets\\\\" + path + "\");");
     }
     mainString.AppendLine("this.walls.Add(new MovingPlatform(new BoundingBox(new Vector3(" + _X + ", " + _Y + ", 0), new Vector3(" + (_X + _Width) + ", " + (_Y + _Height)+ ", 0)), this, new Point(" + begin.X + ", " + begin.Y + "), new Point(" + end.X + ", " + end.Y + "), MovingPlatformRotationType.Bouncing, " + secondsPerCycle + ", false, false, " + path + "));");
 }
Example #26
0
 public void Export(LevelEditState l, System.Text.StringBuilder texturesDec, System.Text.StringBuilder texturesDef, System.Text.StringBuilder mainString, Boolean t)
 {
     string path = l.form.lstTextures.Items[l.importedTextures.IndexOf(this.Sprite)].ToString();
     string[] tokens = path.Split('\\');
     path = tokens.Last();
     path = path.Substring(0, path.IndexOf('.'));
     if (!texturesDec.ToString().Contains(path))
     {
         texturesDec.AppendLine("protected Texture2D " + path + ';');
         texturesDef.AppendLine(path + " = content.Load<Texture2D>(\"realassets\\\\" + path + "\");");
     }
     mainString.AppendLine("this.background.Add(new Doodad(path, new Vector2(" + position.X + ", " + position.Y + ")));");
 }
Example #27
0
        WriteVariables(
            System.Text.StringBuilder variables)
        {
            foreach (var target in this.Targets)
            {
                var name = target.VariableName;
                if (null == name)
                {
                    continue;
                }

                if (target.IsPhony)
                {
                    variables.AppendFormat(".PHONY: {0}", name);
                    variables.AppendLine();
                }

                // simply expanded variable
                variables.AppendFormat("{0}:={1}", name, target.Path.Parse());
                variables.AppendLine();
            }
        }
 private static void GetHallwayGraphic(System.Text.StringBuilder graphic)
 {
     graphic.AppendLine(@"||\--------/|");
     graphic.AppendLine(@"|||\------/||");
     graphic.AppendLine(@"||||\----/|||");
     graphic.AppendLine(@"||||/----\|||");
     graphic.AppendLine(@"|||/------\||");
     graphic.AppendLine(@"||/--------\|");
 }
        /// <summary>
        /// Output HTML,  in this case a heading
        /// </summary>
        /// <param name="index"></param>
        public void OutputHtml(System.Text.StringBuilder index, int indent)
        {
            bool error = false;
            Exception MyException = null;
            try
            {
                Example.RunExample();
            }
            catch (Exception ex)
            {
                error = true;
                MyException = ex;
            }
            bool found = false;
            foreach (ExampleFile file in Example.Files.Where(x => x.Status == ExampleFile.FileType.HtmlFile))
            {
                //  overview files should come first and be on their own...
                //  they are intended to display on the screen and be
                //  embedded into the index at the appropriate spot
                if (file.Filename.ToLower() == "overview.html")
                {
                    index.AppendLine("<li>");
                    index.AppendLine(file.Contents);
                    index.AppendLine("</li>");
                }
                else
                {
                    index.Append("<dt><a href=\"");
                    index.Append(file.Filename);
                    index.Append("\">");
                    index.Append(Example.Name);
                    index.AppendLine("</a></dt>");
                    index.Append("<dd>");
                    if (error)
                    {
                        index.Append("<p>Error: ");
                        index.Append(MyException.ToString());
                        index.Append("</p>");
                    }
                    index.Append(Example.Description);
                    index.AppendLine("</dd>");

                    HtmlWrapper wrapper = new HtmlWrapper(file.Contents, Example.Files);
                    wrapper.Export(file.Filename);
                    found = true;
                }
            }

            if (!found)
            {
                index.Append("<dt><u>Missing</u> ");
                index.Append(Example.Name);
                index.AppendLine("</dt>");
                index.Append("<dd>");
                index.Append(Example.Description);
                index.AppendLine("</dd>");
            }
        }
Example #30
0
 public override void Serialize(
     System.Text.StringBuilder text,
     int indentLevel)
 {
     if (this.BuildFiles.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXBuildFile section */");
         text.AppendLine();
         foreach (var buildFile in this.BuildFiles.OrderBy(key => key.GUID))
         {
             buildFile.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXBuildFile section */");
         text.AppendLine();
     }
     if (this.ContainerItemProxies.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXContainerItemProxy section */");
         text.AppendLine();
         foreach (var proxy in this.ContainerItemProxies.OrderBy(key => key.GUID))
         {
             proxy.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXContainerItemProxy section */");
         text.AppendLine();
     }
     if (this.CopyFilesBuildPhases.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXCopyFilesBuildPhase section */");
         text.AppendLine();
         foreach (var phase in this.CopyFilesBuildPhases.OrderBy(key => key.GUID))
         {
             phase.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXCopyFilesBuildPhase section */");
         text.AppendLine();
     }
     if (this.FileReferences.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXFileReference section */");
         text.AppendLine();
         foreach (var fileRef in this.FileReferences.OrderBy(key => key.GUID))
         {
             fileRef.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXFileReference section */");
         text.AppendLine();
     }
     if (this.FrameworksBuildPhases.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXFrameworksBuildPhase section */");
         text.AppendLine();
         foreach (var phase in this.FrameworksBuildPhases.OrderBy(key => key.GUID))
         {
             phase.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXFrameworksBuildPhase section */");
         text.AppendLine();
     }
     if (this.Groups.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXGroup section */");
         text.AppendLine();
         foreach (var group in this.Groups.OrderBy(key => key.GUID))
         {
             group.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXGroup section */");
         text.AppendLine();
     }
     if (this.ReferenceProxies.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXReferenceProxy section */");
         text.AppendLine();
         foreach (var proxy in this.ReferenceProxies.OrderBy(key => key.GUID))
         {
             proxy.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXReferenceProxy section */");
         text.AppendLine();
     }
     if (this.Targets.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXNativeTarget section */");
         text.AppendLine();
         foreach (var target in this.Targets.Values.OrderBy(key => key.GUID))
         {
             target.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXNativeTarget section */");
         text.AppendLine();
     }
     this.InternalSerialize(text, indentLevel); //this is the PBXProject :)
     if (this.ShellScriptsBuildPhases.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXShellScriptBuildPhase section */");
         text.AppendLine();
         foreach (var phase in this.ShellScriptsBuildPhases.OrderBy(key => key.GUID))
         {
             phase.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXShellScriptBuildPhase section */");
         text.AppendLine();
     }
     if (this.SourcesBuildPhases.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXSourcesBuildPhase section */");
         text.AppendLine();
         foreach (var phase in this.SourcesBuildPhases.OrderBy(key => key.GUID))
         {
             phase.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXSourcesBuildPhase section */");
         text.AppendLine();
     }
     if (this.TargetDependencies.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin PBXTargetDependency section */");
         text.AppendLine();
         foreach (var dependency in this.TargetDependencies.OrderBy(key => key.GUID))
         {
             dependency.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End PBXTargetDependency section */");
         text.AppendLine();
     }
     if (this.AllConfigurations.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin XCBuildConfiguration section */");
         text.AppendLine();
         foreach (var config in this.AllConfigurations.OrderBy(key => key.GUID))
         {
             config.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End XCBuildConfiguration section */");
         text.AppendLine();
     }
     if (this.ConfigurationLists.Count > 0)
     {
         text.AppendLine();
         text.AppendFormat("/* Begin XCConfigurationList section */");
         text.AppendLine();
         foreach (var configList in this.ConfigurationLists.OrderBy(key => key.GUID))
         {
             configList.Serialize(text, indentLevel);
         }
         text.AppendFormat("/* End XCConfigurationList section */");
         text.AppendLine();
     }
 }