Tuesday, February 2, 2010

Args.cs

using System;
using System.Security.Permissions;
using System.Web;
using PowerTalkBox;
namespace Events
{
public delegate void ReceiveMessageEventHandler(object source, ReceiveMessageEventArgs args);
[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ReceiveMessageEventArgs : EventArgs
{
private string _sender;
private string _reciver;
private string value;

public ReceiveMessageEventArgs()
{

}
///
/// 接收者
///

public string reciver
{
get
{
return this._reciver;
}
set
{
this._reciver = value;
}
}
///
/// 发送者
///

public string sender
{
get
{
return this._sender;
}
set
{
this._sender = value;
}
}
///
/// 内容
///

public string Value
{
get
{
return this.value;
}
set
{
this.value = value;
}
}


}
}

ContrlList.cs

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Globalization;
using System.Resources;
using System.Threading;
namespace PowerTalkBoxEnum.Enum
{

public class ContrlList
{
}
public enum ChatMode
{
///
/// 一对一聊天模式
///

OneToOne,
///
/// 一对多聊天模式
///

OneToMore,
}
public enum SystemMode
{
WebToWeb,
WebToIm
}

}

UserNameTest.cs

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Web.UI;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.Design;
using System.Resources;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Drawing;

namespace PowerTalkBoxContrls.Design
{
public class UserNameTestToll : ControlDesigner
{

//private PowerTalkBox.UserNameTest unt = null;
//public override void Initialize(IComponent component)
//{
// unt = (PowerTalkBox.UserNameTest)component;
// base.Initialize(component);
//}

//public override string GetDesignTimeHtml()
//{
// //output.Write("");
// string contrlstr = "
" + unt.ErrMessage + "
";

// return contrlstr;
//}
}
}

PowerTalkBoxDesigner.cs

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Web.UI;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.Design;
using System.Resources;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Drawing;
using PowerTalkBox;
namespace PowerTalkBoxContrls.Design
{
public class PowerTalkBoxDesigner : ControlDesigner
{
///
/// 最外层的框框
///

Panel PTB = new Panel();
private PowerTalkBox.PowerTalkBox ptbc = null;
public override void Initialize(IComponent component)
{
ptbc = (PowerTalkBox.PowerTalkBox)component;
base.Initialize(component);
}
public string TableContentDesigner()
{


StringWriter sw = new StringWriter();

HtmlTextWriter htw = new HtmlTextWriter(sw);
HtmlTable t = new HtmlTable();
t.CellPadding = 3;
t.CellSpacing = 0;
t.BorderColor = "#6699cc";
t.BgColor = "#6699cc";
t.Width = ptbc.Width.ToString();
t.Height = ptbc.Height.ToString();
HtmlTableRow tr = new HtmlTableRow();
HtmlTableCell td = new HtmlTableCell();
td.VAlign = "top";
td.Align = "center";

// inner table for iframe
HtmlTable iframe = new HtmlTable();
iframe.BgColor = "#FFFFFF";
iframe.Width = "600px";
iframe.Height = "500px";
iframe.CellPadding = 0;
iframe.CellSpacing = 0;
iframe.Style.Add("border", "1 solid " + "#6699cc");
HtmlTableRow tr2 = new HtmlTableRow();
HtmlTableCell td2 = new HtmlTableCell();
td2.VAlign = "middle";
td2.Align = "center";
td2.Controls.Add(new LiteralControl("PowerTalkBox: " + ptbc.ID+ ""));
tr2.Cells.Add(td2);
iframe.Rows.Add(tr2);

td.Controls.Add(iframe);
td.Controls.Add(new LiteralControl("


"));
tr.Cells.Add(td);
t.Rows.Add(tr);
t.RenderControl(htw);
return sw.ToString();
}
public override string GetDesignTimeHtml()
{

return TableContentDesigner();
}
}
}

Html.cs

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using System.Drawing;
using PowerTalkBoxContrls.Design;
using PowerTalkBoxEnum.Enum;

namespace PowerTalkBoxContrls.Design
{
public class Html
{

public static string WebClientGetSource(string url)
{
try
{
WebClient wc = new WebClient();
Stream db = wc.OpenRead(url);
StreamReader sr = new StreamReader(db, System.Text.Encoding.Default);
string sc = sr.ReadToEnd();
sr.Close();
db.Close();
wc.Dispose();
return sc;
}
catch
{
return"";
}
}

public static string jsContent(int Interval)
{
string jsStr = "";

jsStr+=" ";


return TableStr;
}
public static string DivsContent()
{
string Dives = "";

Dives += "
Dives += " position: absolute; top: 245px; height: 20px; background-color: #ecf5ff; layer-background-color: #ECF5FF\">";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += "
";
Dives += "
Dives += " position: absolute; top: 180px; height: 38px; background-color: #ecf5ff\">";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += "
";
Dives += " Dives += " title=\"大笑\" value=\"face/img1.gif\" / />
";
Dives += " Dives += " title=\"色\" value=\"face/img2.gif\" / />
";
Dives += " Dives += " title=\"生气\" value=\"face/img3.gif\" / />
";
Dives += " Dives += " title=\"脸红\" value=\"face/img4.gif\" / />
";
Dives += " Dives += " title=\"酷\" value=\"face/img5.gif\" / />
";
Dives += " Dives += " title=\"晕\" value=\"face/img6.gif\" / />
";
Dives += " Dives += " title=\"OhYes\" value=\"face/img7.gif\" / />
";
Dives += " Dives += " title=\"嘘\" value=\"face/img8.gif\" / />
";
Dives += " Dives += " title=\"哦?\" value=\"face/img9.gif\" / />
";
Dives += " Dives += " title=\"干杯\" value=\"face/img10.gif\" / />
";
Dives += " Dives += " title=\"酸\" value=\"face/img11.gif\" / />
";
Dives += " Dives += " title=\"不要\" value=\"face/img12.gif\" / />
";
Dives += " Dives += " title=\"骂\" value=\"face/img13.gif\" / />
";
Dives += " Dives += " title=\"恶心\" value=\"face/img14.gif\" / />
";
Dives += " Dives += " title=\"闭嘴\" value=\"face/img15.gif\" / />
";
Dives += " Dives += " title=\"怒\" value=\"face/img16.gif\" / />
";
Dives += " Dives += " title=\"高手\" value=\"face/img17.gif\" / />
";
Dives += " Dives += " title=\"鄙视\" value=\"face/img18.gif\" / />
";
Dives += " Dives += " title=\"心碎\" value=\"face/img19.gif\" / />
";
Dives += " Dives += " title=\"爱\" value=\"face/img20.gif\" / />
";
Dives += " Dives += " title=\"吻\" value=\"face/img21.gif\" / />
";
Dives += " Dives += " title=\"枯萎\" value=\"face/img22.gif\" / />
";
Dives += " Dives += " title=\"鲜花\" value=\"face/img23.gif\" / />
";
Dives += " Dives += " title=\"礼物\" value=\"face/img24.gif\" / />
";
Dives += " Dives += " title=\"苹果\" value=\"face/img25.gif\" / />
";
Dives += " Dives += " title=\"西瓜\" value=\"face/img26.gif\" / />
";
Dives += " Dives += " title=\"茶\" value=\"face/img27.gif\" / />
";
Dives += " Dives += " title=\"电话\" value=\"face/img28.gif\" / />
";
Dives += " Dives += " title=\"星星\" value=\"face/img29.gif\" / />
";
Dives += " Dives += " title=\"不乐意\" value=\"face/img30.gif\" / />
";
Dives += " Dives += " title=\"开心\" value=\"face/img31.gif\" / />
";
Dives += " Dives += " title=\"羞愧\" value=\"face/img32.gif\" / />
";
Dives += " Dives += " title=\"财迷\" value=\"face/img33.gif\" / />
";
Dives += " Dives += " title=\"可爱\" value=\"face/img34.gif\" / />
";
Dives += " Dives += " title=\"猪\" value=\"face/img35.gif\" / />
";
Dives += " Dives += " title=\"大便\" value=\"face/img36.gif\" / />
";
Dives += " Dives += " title=\"月亮\" value=\"face/img37.gif\" / />
";
Dives += " Dives += " title=\"音乐\" value=\"face/img38.gif\" / />
";
Dives += " Dives += " title=\"下雨\" value=\"face/img39.gif\" / />
";
Dives += " Dives += " title=\"老鼠\" value=\"face/img40.gif\" / />
";
Dives += " Dives += " title=\"小狗\" value=\"face/img41.gif\" / />
";
Dives += " Dives += " title=\"骷髅\" value=\"face/img42.gif\" / />
";
Dives += " Dives += " title=\"监视\" value=\"face/img43.gif\" / />
";
Dives += " Dives += " title=\"太阳\" value=\"face/img44.gif\" / />
";
Dives += " Dives += " title=\"信件\" value=\"face/img45.gif\" / />
";
Dives += " Dives += " title=\"飞眼\" value=\"face/img46.gif\" / />
";
Dives += " Dives += " title=\"电视\" value=\"face/img47.gif\" / />
";
Dives += " Dives += " title=\"钟表\" value=\"face/img48.gif\" / />
";
Dives += " Dives += " title=\"灯泡\" value=\"face/img49.gif\" / />
";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += " Dives += " left: 14px; visibility: hidden; overflow: hidden; border-left: #000000 1px; width: 314px;";
Dives += " border-bottom: #000000 1px; position: absolute; top: 196px; height: 69px; background-color: #f7fbff;";
Dives += " layer-background-color: #F7FBFF\">";
Dives += "
";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += " ";
Dives += "
";
Dives += "
";
Dives += " 限doc、rar、jpg、gif、png、bmp、swf、zip类型。
";
Dives += "
";
Dives += " ";
Dives += " ";
Dives += "
";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += " ";
Dives += "
";
Dives += "
";
Dives += "
";

return Dives;
}




}
}