Change to .NET 3.5

This commit is contained in:
2015-05-29 23:26:32 +02:00
parent 453e637504
commit eef5e3dbbf
28 changed files with 2270 additions and 2217 deletions

View File

@@ -0,0 +1,27 @@
using System;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class FrmBoard : PageCommon
{
private int _idBoard = 0;
public FrmBoard()
{
Init += FrmBoard_Init;
}
void FrmBoard_Init(object sender, EventArgs e)
{
Title = "Board";
var lblTest = new CLabel { Text = "Hello World", Tag = "h2" };
Controls.Add(lblTest);
ChatControl chatControl = new ChatControl();
chatControl.IDBoard = _idBoard;
chatControl.UserName = Convert.ToString(new Random().Next());
Controls.Add(chatControl);
}
}
}

View File

@@ -1,21 +1,25 @@
using System.Web;
using Scrummer.Code.JSON;
namespace Scrummer.Code.Pages
{
public class FrmEcho : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
var jsonWritter = new JSONWriter(true);
context.Response.Write("<pre><code>");
context.Response.Write(jsonWritter.Write(context.Request));
context.Response.Write("</code></pre>");
}
}
}
using System.Web;
using Scrummer.Code.JSON;
namespace Scrummer.Code.Pages
{
public class FrmEcho : IHttpHandler
{
#region IHttpHandler
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
var jsonWritter = new JSONWriter(true);
context.Response.Write("<pre><code>");
context.Response.Write(jsonWritter.Write(context.Request));
context.Response.Write("</code></pre>");
}
#endregion
}
}

View File

@@ -1,48 +1,65 @@
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class FrmError : PageCommon
{
Exception _ex = null;
public FrmError(Exception ex)
{
_ex = ex;
Init += FrmError_Init;
}
void FrmError_Init(object sender, EventArgs e)
{
Title = "Application Error";
CLabel lblErrorTitle = new CLabel { Text = Title, Tag = "h2" };
Controls.Add(lblErrorTitle);
Exception exAux = _ex;
if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
while (exAux != null)
{
CLabel lblMessage = new CLabel { Tag = "P" };
lblMessage.Text = String.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message));
Controls.Add(lblMessage);
CLabel lblStacktraceTitle = new CLabel { Tag = "p" };
lblStacktraceTitle.Text = String.Format("<b>{0}:</b>", "Stacktrace");
Controls.Add(lblStacktraceTitle);
Panel pnlStacktrace = new Panel();
pnlStacktrace.CssClass = "divCode";
Controls.Add(pnlStacktrace);
LiteralControl litStackTrace = new LiteralControl(
String.Format("<pre><code>{0}</code></pre>", HttpUtility.HtmlEncode(exAux.StackTrace)));
pnlStacktrace.Controls.Add(litStackTrace);
exAux = exAux.InnerException;
}
}
}
}
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class FrmError : PageCommon
{
#region Declarations
Exception _ex = null;
#endregion
#region Page life cycle
public FrmError(Exception ex)
{
_ex = ex;
Init += FrmError_Init;
}
void FrmError_Init(object sender, EventArgs e)
{
InitializeControls();
}
#endregion
#region Private methods
private void InitializeControls()
{
Title = "Application Error";
CLabel lblErrorTitle = new CLabel { Text = Title, Tag = "h2" };
Controls.Add(lblErrorTitle);
Exception exAux = _ex;
if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
while (exAux != null)
{
CLabel lblMessage = new CLabel { Tag = "P" };
lblMessage.Text = String.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message));
Controls.Add(lblMessage);
CLabel lblStacktraceTitle = new CLabel { Tag = "p" };
lblStacktraceTitle.Text = String.Format("<b>{0}:</b>", "Stacktrace");
Controls.Add(lblStacktraceTitle);
Panel pnlStacktrace = new Panel();
pnlStacktrace.CssClass = "divCode";
Controls.Add(pnlStacktrace);
LiteralControl litStackTrace = new LiteralControl(
String.Format("<pre><code>{0}</code></pre>", HttpUtility.HtmlEncode(exAux.StackTrace)));
pnlStacktrace.Controls.Add(litStackTrace);
exAux = exAux.InnerException;
}
}
#endregion
}
}

View File

@@ -1,92 +1,92 @@
using System;
using System.Reflection;
using System.Text;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class PageCommon : Page
{
#region Declarations
private HtmlHead _head;
private HtmlGenericControl _body;
private HtmlForm _form;
private Panel _pnlContainer = new Panel();
#endregion
#region Properties
public new ControlCollection Controls
{
get { return _pnlContainer.Controls; }
}
#endregion
#region Life cycle
public PageCommon()
{
Init += PageCommon_Init;
PreRender += PageCommon_PreRender;
}
void PageCommon_Init(object sender, EventArgs e)
{
CreateControls();
}
void PageCommon_PreRender(object sender, EventArgs e)
{
_head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Globals.Title, Globals.TitleSeparator, Title);
}
#endregion
#region Private methods
private void CreateControls()
{
Context.Response.Charset = Encoding.UTF8.WebName;
var doctype = new LiteralControl("<!DOCTYPE html>\n");
base.Controls.Add(doctype);
var html = new HtmlGenericControl("html");
base.Controls.Add(html);
_head = new HtmlHead();
html.Controls.Add(_head);
_head.Controls.Add(new HtmlMeta { HttpEquiv = "content-type", Content = "text/html; charset=utf-8" });
_head.Controls.Add(new HtmlMeta { Name = "author", Content = Globals.Author });
_head.Controls.Add(new HtmlMeta { Name = "Copyright", Content = Globals.Copyright });
Assembly asm = Assembly.GetExecutingAssembly();
string version = asm.GetName().Version.ToString();
_head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?t={0}\"></script>\n", version)));
_head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?t={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
_body = new HtmlGenericControl("body");
html.Controls.Add(_body);
_form = new HtmlForm { ID = "formMain" };
_body.Controls.Add(_form);
var pnlHeader = new Panel { CssClass = "divHeader" };
_form.Controls.Add(pnlHeader);
var lblTitle = new CLabel { Text = Globals.Title, Tag = "h1" };
pnlHeader.Controls.Add(lblTitle);
_pnlContainer.CssClass = "divContent";
_form.Controls.Add(_pnlContainer);
}
#endregion
}
}
using System;
using System.Reflection;
using System.Text;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class PageCommon : Page
{
#region Declarations
private HtmlHead _head;
private HtmlGenericControl _body;
private HtmlForm _form;
private Panel _pnlContainer = new Panel();
#endregion
#region Properties
public new ControlCollection Controls
{
get { return _pnlContainer.Controls; }
}
#endregion
#region Life cycle
public PageCommon()
{
Init += PageCommon_Init;
PreRender += PageCommon_PreRender;
}
void PageCommon_Init(object sender, EventArgs e)
{
CreateControls();
}
void PageCommon_PreRender(object sender, EventArgs e)
{
_head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Globals.Title, Globals.TitleSeparator, Title);
}
#endregion
#region Private methods
private void CreateControls()
{
Context.Response.Charset = Encoding.UTF8.WebName;
var doctype = new LiteralControl("<!DOCTYPE html>\n");
base.Controls.Add(doctype);
var html = new HtmlGenericControl("html");
base.Controls.Add(html);
_head = new HtmlHead();
html.Controls.Add(_head);
_head.Controls.Add(new HtmlMeta { HttpEquiv = "content-type", Content = "text/html; charset=utf-8" });
_head.Controls.Add(new HtmlMeta { Name = "author", Content = Globals.Author });
_head.Controls.Add(new HtmlMeta { Name = "Copyright", Content = Globals.Copyright });
Assembly asm = Assembly.GetExecutingAssembly();
string version = asm.GetName().Version.ToString();
_head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?t={0}\"></script>\n", version)));
_head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?t={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
_body = new HtmlGenericControl("body");
html.Controls.Add(_body);
_form = new HtmlForm { ID = "formMain" };
_body.Controls.Add(_form);
var pnlHeader = new Panel { CssClass = "divHeader" };
_form.Controls.Add(pnlHeader);
var lblTitle = new CLabel { Text = Globals.Title, Tag = "h1" };
pnlHeader.Controls.Add(lblTitle);
_pnlContainer.CssClass = "divContent";
_form.Controls.Add(_pnlContainer);
}
#endregion
}
}