Exemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder content = new StringBuilder();

            content.Append("var htDocumentData={");

            // Document file version which format is x.x.x.x, see VersionHistory.txt in details.
            content.AppendFormat("\"fileVersion\":\"{0}\",", _service.RenderingDocument.FileVersion);

            JsSitemap site = new JsSitemap(_service);

            content.Append(site.ToString());

            content.Append(",");

            JsViewport view     = new JsViewport(_service);
            string     viewport = view.ToString();

            if (!String.IsNullOrEmpty(viewport))
            {
                content.Append(viewport);
                content.Append(",");
            }

            content.AppendFormat("\"protoNowVer\":\"{0}\",", _service.ProductVersionInfo);

            JsHelper.RemoveLastComma(content);

            content.Append("};");

            return(content.ToString());
        }
Exemplo n.º 2
0
        public override string ToString()
        {
            StringBuilder content = new StringBuilder();

            content.Append(@"var PNComparingData={""projects"":[");

            for (int i = 0; i < _documents.Count; i++)
            {
                //head
                content.Append(@"{");

                _service.RenderingDocument = _documents[i];
                content.AppendFormat("\"id\":\"{0}\",", i);
                content.AppendFormat("\"name\":\"{0}\",", Path.GetFileNameWithoutExtension(_service.RenderingDocument.Name));
                if (_service.RenderingDocument.TimeStamp.StartsWith("2000-01-01"))
                {
                    content.AppendFormat("\"timestamp\":\"\",");
                }
                else
                {
                    content.AppendFormat("\"timestamp\":\"{0}\",", _service.RenderingDocument.TimeStamp);
                }

                content.AppendFormat("\"fileVersion\":\"{0}\",", _service.RenderingDocument.FileVersion);

                JsSitemap site = new JsSitemap(_service);
                content.Append(site.ToString());
                content.Append(",");

                JsViewport view     = new JsViewport(_service);
                string     viewport = view.ToString();
                if (!String.IsNullOrEmpty(viewport))
                {
                    content.Append(viewport);
                    content.Append(",");
                }

                content.AppendFormat("\"protoNowVer\":\"{0}\",", _service.ProductVersionInfo);
                JsHelper.RemoveLastComma(content);

                //tail
                if (i < _documents.Count - 1)
                {
                    content.Append(@"},");
                }
                else
                {
                    content.Append(@"}");
                }
            }


            content.Append(@"]};");
            return(content.ToString());
        }