internal static void FindTask(TaskService ts, System.IO.TextWriter output, params string[] arg)
 {
     try
     {
         Task t = ts.FindTask(arg[0]);
         if (t == null)
             output.WriteLine(string.Format("Task '{0}' not found.", arg[0]));
         else
         {
             output.WriteLine(string.Format("Task '{0}' found. Created on {1:g} and last run on {2:g}.", t.Name, t.Definition.RegistrationInfo.Date, t.LastRunTime));
             if (t.Definition.Triggers.ContainsType(typeof(CustomTrigger)))
             {
                 foreach (var tr in t.Definition.Triggers)
                 {
                     CustomTrigger ct = tr as CustomTrigger;
                     if (ct != null && ct.Properties.Count > 0)
                     {
                         output.WriteLine("Custom Trigger Properties:");
                         int i = 0;
                         foreach (var name in ct.Properties.Names)
                             output.WriteLine("{0}. {1} = {2}", ++i, name, ct.Properties[name]);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         output.WriteLine(ex.ToString());
     }
 }
Example #2
0
        public void Export_SpriteMaskData(System.IO.TextWriter tw)
        {
            if (m_nExportSpriteID != 0)
                tw.WriteLine("");

            tw.WriteLine("\t// Sprite : " + m_strName);

            // Calc # of int32s required.
            int xsize = ((PixelWidth + MaskWordWidth - 1) / MaskWordWidth);
            int ysize = PixelHeight;
            int size = xsize * ysize;
            int mask;

            for (int y = 0; y < ysize; y++)
            {
                for (int x = 0; x < xsize; x++)
                {
                    mask = 0;
                    for (int i = 0; i < MaskWordWidth; i++)
                    {
                        mask <<= 1;
                        if (x * MaskWordWidth + i < PixelWidth)
                        {
                            if (GetPixel(x * MaskWordWidth + i, y) != 0)
                                mask |= 1;
                        }
                    }
                    tw.WriteLine(String.Format("\t0x{0:x8},", mask));
                }
            }
        }
Example #3
0
        protected override void EndAttribute(System.IO.StreamWriter sw)
        {
            sw.WriteLine(")>]");

            // In F# attributes are always applied to something. So add 'something'
            sw.WriteLine("()");
        }
 public void ShowDistribution(System.IO.TextWriter textWriter)
 {
     textWriter.WriteLine("");
     textWriter.WriteLine("Player 1 Score Delta distribution");
     textWriter.WriteLine("=================================");
     this.pointSpreadHistogramData.WriteBuckets(textWriter);
 }
        public virtual void Render(System.IO.TextWriter writer, UI.UIControlState state, params HtmlAttribute[] attributes)
        {


            writer.Write("<div class=\"");
            if (state.Validated)
            {
                if (string.IsNullOrEmpty(state.ErrorMessage))
                {
                    writer.Write("control-group form-group success");
                }
                else
                {
                    writer.Write("control-group form-group error");
                }
            }
            else
            {
                writer.Write("control-group form-group");
            }

            writer.WriteLine("\">");

            RenderLabel(writer, state);

            writer.WriteLine("<div class=\"controls\">");
            RenderInput(writer, state, attributes);
            RenderHintOrError(writer, state);
            writer.WriteLine("</div>");


            writer.WriteLine("</div>");

        }
Example #6
0
        protected override void Render( System.Web.UI.HtmlTextWriter writer )
        {
            DataTable dt;
            string cachename = String.Format( "forumjump_{0}_{1}", ForumPage.User.Name, ForumPage.User.IsAuthenticated );
            if ( Page.Cache [cachename] != null )
            {
                dt = ( DataTable ) Page.Cache [cachename];
            }
            else
            {
                dt = DB.forum_listall_sorted( ForumPage.PageBoardID, ForumPage.PageUserID );
                Page.Cache [cachename] = dt;
            }

            writer.WriteLine( String.Format( "<select name=\"{0}\" onchange=\"{1}\" language=\"javascript\" id=\"{0}\">", this.UniqueID, Page.GetPostBackEventReference( this ) ) );

            int nForumID = ForumPage.PageForumID;
            if ( nForumID <= 0 )
                writer.WriteLine( "<option/>" );

            foreach ( DataRow row in dt.Rows )
            {
                writer.WriteLine( string.Format( "<option {2}value='{0}'>{1}</option>", row ["ForumID"], row ["Title"], Convert.ToString( row ["ForumID"] ) == nForumID.ToString() ? "selected=\"selected\" " : "" ) );
            }

            writer.WriteLine( "</select>" );
        }
Example #7
0
 public override void dump(System.IO.TextWriter str, int n)
 {
     dumpLineaColumna(str, n);
     str.WriteLine("_literal");
     if(tipo_expr!=null) str.WriteLine(Utilidades.pad(n+2)+"Tipo: " + tipo_expr);
     dump_SimboloAbstracto(str, n + 2, token);
 }
Example #8
0
        /// Implementation of the IObjectRenderer interface. Called on when an
        /// exception is logged.
        public void RenderObject(RendererMap map, object obj, System.IO.TextWriter writer)
        {
            Exception ex = obj as Exception;

            for (; ex != null; ex = ex.InnerException) {
                if (ex is COMException && ex.Message.StartsWith("<?xml")) {
                    writer.WriteLine();
                    writer.Write("HFMException message XML contents:");
                    writer.Write(YAML.XML.ConvertXML(ex.Message));
                }
                else {
                    writer.Write(ex.GetType().Name);
                    writer.Write(": ");
                    writer.Write(ex.Message);
                }
                if (ex.InnerException != null) {
                    writer.WriteLine();
                }
                else if (_logHierarchy.Root.Level.CompareTo(log4net.Core.Level.Fine) < 0) {
                    writer.WriteLine();
                    writer.WriteLine("Backtrace:");
                    writer.Write(ex.StackTrace);
                }
            }
        }
Example #9
0
    public static void dump_DOT(System.IO.TextWriter str,
	                            Dictionary<EntityLink,double> graph)
    {
        // This function has some ugliness, but IO/format
        // conversions often do.
        str.WriteLine ("digraph SimpleGraph {");
        foreach (KeyValuePair<EntityLink,double> g in graph) {
            string lname;
            string rname;
            if (((EntityLink)g.Key).leftmost.Type ==
                SourceCodeEntityType.COMMENT) {
                lname = "commentL" +
                    g.Key.leftmost.LineStart.ToString () +
                        "C" + g.Key.leftmost.ColumnStart.ToString () +
                        " (" + g.Key.leftmost.parent_file.FileName + ")";
            } else {
                lname = g.Key.leftmost.Name + " (" + g.Key.leftmost.parent_file.FileName + ")";
            }
            if (g.Key.rightmost.Type ==
                SourceCodeEntityType.COMMENT) {
                rname = "commentL" +
                    g.Key.rightmost.LineStart.ToString () +
                        "C" + g.Key.rightmost.ColumnStart.ToString ();
            } else {
                rname = g.Key.rightmost.Name + " (" + g.Key.rightmost.parent_file.FileName + ")";
            }
            str.WriteLine ("\"" + lname.Replace ("\"", "\'\'") + "\" -> \"" +
                            rname.Replace ("\"", "\'\'") + "\" [weight=" +
                           g.Value.ToString ("F16") + " penwidth=" + g.Value.ToString ("F16") + "];");
        }
        str.WriteLine ("}");
    }
 public void DumpErrors(System.IO.TextWriter tw)
 {
     foreach (String s in Errors) {
         tw.WriteLine(s);
     }
     tw.WriteLine("--------------------------------------------------------------------------------");
 }
Example #11
0
        /// <summary>
        /// Export the image as an array of direct 16-bit color values.
        /// </summary>
        /// <param name="tw"></param>
        public void Export_BgImageData_Direct(System.IO.TextWriter tw)
        {
            StringBuilder sb = null;
            int nPerLine = 32;

            for (int iy = 0; iy < m_height; iy++)
            {
                tw.WriteLine("\t// Row {0}", iy);
                for (int ix = 0; ix < m_width; ix++)
                {
                    if ((ix % nPerLine) == 0)
                    {
                        if (sb != null)
                            tw.WriteLine(sb.ToString());
                        sb = new StringBuilder("\t");
                    }
                    short palette_index = m_ImageData[ix, iy];
                    Color c = m_mapId2Color[palette_index];
                    int encoded = Color555.Encode(c);
                    sb.Append(String.Format("0x{0:x4},", encoded));
                }
                if (sb != null)
                    tw.WriteLine(sb.ToString());
                sb = null;
            }
        }
Example #12
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.ViewStateMode = ViewStateMode.Disabled;
            this.CreateChildControls();
            string styleString = "";

            foreach (string key in this.Style.Keys)
            {
                styleString += key + ":" + this.Style[key] + ";";
            }

            writer.WriteLine("<div class=\"control-group umb-control-group\" style='" + styleString + "'>");

            try
            {
                this.RenderChildren(writer);
            }
            catch (Exception ex)
            {
                writer.WriteLine("Error creating control <br />");
                writer.WriteLine(ex.ToString());
            }

            writer.WriteLine("</div>");
        }
Example #13
0
        public override void GenerateJavaScript(JSContext context, System.IO.TextWriter textWriter)
        {
            textWriter.Write("if (");
            _condition.GenerateJavaScript(context, textWriter);
            textWriter.WriteLine(") {");
            context.Indentation++;
            textWriter.Write(context.IndentationText);
            _thenExpression.GenerateJavaScript(context, textWriter);
            textWriter.WriteLine();

            context.Indentation--;
            textWriter.Write(context.IndentationText);

            if (_elseExpression != null)
            {

                textWriter.WriteLine("} else {");
                context.Indentation++;
                textWriter.Write(context.IndentationText);

                _elseExpression.GenerateJavaScript(context, textWriter);
                context.Indentation--;

                textWriter.WriteLine();
                textWriter.Write(context.IndentationText);
            }

            textWriter.WriteLine("}");
        }
Example #14
0
        // muestra el formulario para el nuevo comentario
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            //base.Render(writer);
            if (this.idArticulo.HasValue)
            {
                writer.WriteLine("<div class='comment'>");
                writer.WriteLine("<h1>Escribe tu opinión</h1>");

                writer.WriteLine("<label for='txtUsuario'>Nombre / Alias:</label><br />");
                writer.WriteLine("<input type='text' name='txtUsuario' /><br />");

                writer.WriteLine("<label for='txtComentario'>Comentario:</label><br />");
                writer.WriteLine("<textarea name='txtComentario' rows='10' cols='40'></textarea><br />");

                captcha.RenderControl(writer);
                //if (!captchaOK)
                //{
                //    writer.WriteLine("<div class='error'>Introduzca código correcto</div>");
                //}

                writer.WriteLine("<input id='btnsubmit' type='image' src='/img/enviar.png' />");

                writer.WriteLine("</div>");
            }
        }
Example #15
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.ViewStateMode = ViewStateMode.Disabled;
            this.CreateChildControls();

            string styleString = "";

            foreach (string key in this.Style.Keys)
            {
                styleString += key + ":" + this.Style[key] + ";";
            }

            
            writer.WriteLine("<div class=\"umb-pane " + this.CssClass +  "\" style='" + styleString + "'>");
            if (!string.IsNullOrEmpty(m_title))
                writer.WriteLine("<h5 class='umb-pane-title'>" + m_title + "</h5>");
            writer.WriteLine("<div class=\"control-group umb-control-group\" style='" + styleString + "'>");

            if (!string.IsNullOrEmpty(m_Text))
                writer.WriteLine("<p class=\"umb-abstract\">" + m_Text + "</p>");

            try
            {
                this.RenderChildren(writer);
            }
            catch (Exception ex)
            {
                writer.WriteLine("Error creating control <br />");
                writer.WriteLine(ex.ToString());
            }

            writer.WriteLine("</div>");
            writer.WriteLine("</div>");

        }
        public static void ProduceCSV(DataTable dt, System.IO.StreamWriter file, bool WriteHeader)
        {
            if (WriteHeader)
            {
                string[] arr = new String[dt.Columns.Count];
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    arr[i] = dt.Columns[i].ColumnName;
                    arr[i] = GetWriteableValue(arr[i]);
                }

                file.WriteLine(string.Join(",", arr));
            }

            for (int j = 0; j < dt.Rows.Count; j++)
            {
                string[] dataArr = new String[dt.Columns.Count];
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    object o = dt.Rows[j][i];
                    dataArr[i] = GetWriteableValue(o);
                }
                file.WriteLine(string.Join(",", dataArr));
            }
        }
        public override void WriteLaTeX(System.IO.TextWriter writer)
        {
            writer.Write("\\begin{tabular}{");
            foreach (var col in _colSpecs)
                col.WriteLaTeX(writer);
            writer.WriteLine("}");
            int hi = 0, l = 0;
            Action<int> checkLine = line => {
                while (hi < _hlines.Count && _hlines[hi] == line) {
                    writer.WriteLine("\\hline");
                    ++hi;
                }
            };

            checkLine(l);
            foreach (var row in _rows) {
                foreach (var col in row) {
                    col.WriteLaTeX(writer);
                    if (col != row.Last()) writer.Write(" & ");
                }
                writer.WriteLine(" \\\\");
                checkLine(++l);
            }
            writer.WriteLine("\\end{tabular}");
        }
Example #18
0
        protected override void AddReturn(System.IO.TextWriter writer)
        {
            var returnType = this._methodInfo.ReturnType;
            if (returnType == null || returnType.FullName == "System.Void")
                return;


            writer.WriteLine("<div class=\"sectionbody\">");
                writer.WriteLine("<div class=\"returnType\">");
                    writer.WriteLine("<strong class=\"subHeading\">Return Value</strong><br />");
                writer.WriteLine("</div>");

                string url, target;
                returnType.GetHelpURL(this._version, out url, out target);

                if (url == null)
                    writer.WriteLine("<div class=\"returnTypeName\">Type: {0}</div>", returnType.GetDisplayName(false));
                else
                    writer.WriteLine("<div class=\"returnTypeName\">Type: <a href=\"{0}\" {2}>{1}</a></div>", url, returnType.GetDisplayName(false), target);

                var ndoc = GetSummaryDocumentation();
                if (ndoc != null)
                {
                    var returnDoc = NDocUtilities.FindReturnDocumentation(ndoc);
                    if (returnDoc != null)
                    {
                        writer.WriteLine("<div class=\"returnTypeDoc\">{0}</div>", returnDoc);
                    }
                }

            writer.WriteLine("</div>");
        }
Example #19
0
		public static void Output(Blam.Halo3.CacheFileBase c, System.IO.StreamWriter s, cache_file_resource_gestalt_group def)
		{
			resource_type_block.Output(s, def.ResourceTypes);
			s.WriteLine();
			resource_structure_type_block.Output(s, def.ResourceStructureTypes);
			s.WriteLine();
			cache_file_resource_gestalt_tag_resource_block.Output(s, def.TagResources);
			s.WriteLine();
			cache_file_resource_gestalt_64_block.Output(s, def.Block64, "64-general");
			cache_file_resource_gestalt_64_block.Output(s, def.Block70, "70-global");
			cache_file_resource_gestalt_64_block.Output(s, def.Block7C, "7C-attached?");
			cache_file_resource_gestalt_64_block.Output(s, def.Block88, "88-unattached");
			cache_file_resource_gestalt_64_block.Output(s, def.Block94, "94-dvd_forbidden");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockA0, "A0-dvd_always_streaming");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockAC, "AC-bsp zones-1");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockB8, "B8-bsp zones-2");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockC4, "C4-bsp zones-3");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockD0, "D0-?");
			cache_file_resource_gestalt_64_block.Output(s, def.BlockDC, "DC-zone sets");

			cache_file_resource_gestalt_100_block.Output(s, def.Block100);

			cache_file_resource_gestalt_164_block.Output(s, def.Block164);
			Output(s, def.Block1D0);
			s.WriteLine();
			cache_file_resource_gestalt_1DC_block.Output(s, def.Block1DC);
			s.WriteLine();
			cache_file_resource_gestalt_1E8_block.Output(s, def.Block1E8);
			s.WriteLine();
			cache_file_resource_gestalt_1F4_block.Output(s, def.Block1F4);
			s.WriteLine();
			cache_file_resource_gestalt_200_block.Output(c, s, def.Block200);
			s.WriteLine();
		}
        protected override void Render(System.Web.UI.HtmlTextWriter output)
        {
            var searchLinkManager = new SearchLinkManager();
            int pages = Total / PageSize;

            if (Total % PageSize > 0)
            {
                pages = pages + 1;
            }

            if (pages > 1)
            {

                for (int i = 1; i <= pages; i++)
                {
                    output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Class, "searchPagination");

                    if (i != Page)
                    {
                        output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Href, searchLinkManager.GetPageLink(i));
                        output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.A);
                        output.WriteLine(i.ToString());
                        output.RenderEndTag();
                    }
                    else
                    {
                        output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Span);
                        output.WriteLine(i.ToString());
                        output.RenderEndTag();
                    }
                }
            }
        }
Example #21
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer) {
            ErrorHeaderControl.Text = ErrorHeader;
            CreateChildControls();
            writer.WriteLine("<div id='" + this.ClientID + "' class='tabpage'>");
            if (HasMenu) {
                writer.WriteLine("<div class='menubar'>");
                Menu.Width = this.Width;
                Menu.RenderControl(writer);
                writer.WriteLine("</div>");
            }
            int ScrollingLayerHeight = (int)((System.Web.UI.WebControls.WebControl)this.Parent).Height.Value - 22;
            int ScrollingLayerWidth = (int)((System.Web.UI.WebControls.WebControl)this.Parent).Width.Value;
            if (HasMenu)
                ScrollingLayerHeight = ScrollingLayerHeight - 28;
            writer.WriteLine("<div class='tabpagescrollinglayer' id='" + this.ClientID + "_contentlayer' style='height:" + ScrollingLayerHeight + "px;width:" + ScrollingLayerWidth + "px'>");

            string styleString = "";
            foreach (string key in this.Style.Keys) {
                styleString += key + ":" + this.Style[key] + ";";
            }

            writer.WriteLine("<div class=\"tabpageContent\" style='" + styleString + "'>");

            _tempErr.RenderControl(writer);
            
            foreach (System.Web.UI.Control C in this.Controls) {
                if (C.ClientID != _Menu.ClientID && C.ClientID != _tempErr.ClientID ) {
                    C.RenderControl(writer);
                }
            }
            writer.WriteLine("</div>");
            writer.WriteLine("</div>");
            writer.WriteLine("</div>");
        }
Example #22
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (writer == null)
                return;

            if (this.Controls.Count > 0 && this.Controls[0].Controls.Count > 0 || this.Controls.Count > 1
                || (this.Parent != null && (this.Parent.Controls.Count > 0 && this.Parent.Controls[0].Controls.Count > 1 || this.Parent.Controls.Count > 1)))
            {
                writer.WriteLine(Environment.NewLine);
            }

            writer.WriteBeginTag("input");

            writer.WriteAttribute("type", Attributes["type"]);

            foreach (var key in this.Attributes.Keys)
            {
                string attr = (string)key;

                if (attr != "name" && attr != "type")
                    writer.WriteAttribute(attr, Attributes[attr]);
            }

            writer.Write(HtmlTextWriter.SelfClosingTagEnd);
            if (this.Controls.Count > 0 && this.Controls[0].Controls.Count > 0 || this.Controls.Count > 1
                || (this.Parent != null && (this.Parent.Controls.Count > 0 && this.Parent.Controls[0].Controls.Count > 1 || this.Parent.Controls.Count > 1)))
            {
                writer.WriteLine(Environment.NewLine);
            }
        }
Example #23
0
		public void SaveStateText(System.IO.TextWriter writer)
		{
			var s = SaveState();
			ser.Serialize(writer, s);
			// write extra copy of stuff we don't use
			writer.WriteLine();
			writer.WriteLine("Frame {0}", Frame);
		}
Example #24
0
 public override void dump(System.IO.TextWriter str, int n)
 {
     dumpLineaColumna(str, n);
     str.WriteLine("_menor_que");
     if (tipo_expr != null) str.WriteLine(Utilidades.pad(n + 2) + "Tipo: " + tipo_expr);
     expr1.dump(str, n+2);
     expr2.dump(str, n + 2);
 }
 public override void Render_Template_HTML(System.IO.TextWriter Output, Resource_Object.SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, Users.User_Object Current_User, Configuration.Web_Language_Enum CurrentLanguage, Application_State.Language_Support_Info Translator, string Base_URL)
 {
     Output.WriteLine("  <!-- Literal Element -->");
     Output.WriteLine("  <tr>");
     Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
     Output.WriteLine("    <td colspan=\"2\">" + html_text + "</td>");
     Output.WriteLine("  </tr>");
 }
Example #26
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     writer.WriteLine("<div class='{0}'>", this.CssClass);
     writer.WriteLine("<a href='{0}' {1}>", this.Url, string.IsNullOrWhiteSpace(this.Target) ? string.Empty : string.Format("target='{0}'", this.Target));
     writer.WriteLine("<img src='{0}' alt='{1}' />", this.ImageUrl, this.Alt);
     writer.WriteLine("</a>");
     writer.WriteLine("</div>");
 }
Example #27
0
        public override void RenderBeginTag(System.Web.UI.HtmlTextWriter writer)
        {
            writer.WriteLine("<div class='action' abierto='no'>", this.ClientID);
            writer.WriteLine(this.Caption);
            writer.WriteLine("</div>");

            writer.WriteLine("<div class='content'>", this.ClientID);
        }
Example #28
0
 public static void PrintStackTrace(Exception e, System.IO.TextWriter writer) {
     writer.WriteLine(e.ToString());
     string trace = e.StackTrace ?? string.Empty;
     foreach (string line in trace.Split('\n', '\r')) {
         if (!string.IsNullOrEmpty(line))
             writer.WriteLine("        " + line);
     }
 }
Example #29
0
 public override void WriteCommand(System.IO.TextWriter writer)
 {
     writer.WriteLine("Translate {");
     foreach (string[] key in _stringmapping.Keys) {
         writer.WriteLine("{0} => {1}", ProjectSerializer.SecureList(key), ProjectSerializer.SecureList(_stringmapping[key]));
     }
     writer.WriteLine("}");
 }
Example #30
0
 private void WritePolicy(System.IO.StreamWriter writer, IPolicy policy)
 {
     System.Text.StringBuilder outText = new System.Text.StringBuilder();
     outText.Append("Policy: ");
     outText.Append(policy.Name.Value);
     writer.WriteLine(outText.ToString());
     WriteConditions(writer, policy.Conditions);
     writer.WriteLine("------------------------------------------------------------------------");
 }