²âÊÔÓï·¨¸ßÁÁµÄ C# ´úÂëµÄ html fragment Éú³É
²âÊÔÓï·¨¸ßÁÁµÄ C# ´úÂëµÄ html fragment Éú³É:
ÓÃcsdn blog API ·¢²¼.
ÏÂÃæÊÇ:
public class HtmlWriter
{
static Dictionary _colors;
static int _colorNum;
static StringBuilder _colorString;
///
///
///
///
///
public static string GenerateRtf(TextArea textArea)
{
_colors = new Dictionary();
_colorNum = 0;
_colorString = new StringBuilder();
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.AppendLine("");
string fileContent = BuildFileContent(textArea);
//htmlBuilder.Append(@"\viewkind4\uc1\pard");
htmlBuilder.Append(fileContent);
htmlBuilder.AppendLine("");
return htmlBuilder.ToString();
}
static string BuildFileContent(TextArea textArea)
{
StringBuilder htmlBuilder = new StringBuilder();
foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) {
int selectionOffset = textArea.Document.PositionToOffset(selection.StartPosition);
int selectionEndOffset = textArea.Document.PositionToOffset(selection.EndPosition);
Ïà¹ØÎĵµ£º
½üÀ´ORM±äµÃÔ½À´Ô½ÆÕ±é£¬Õâ¶¼¹éÓÚÒ»Öֺܾß˵·þÁ¦µÄÔÒò£»Ëü¿ÉÒÔʹ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÓ¦ÓóÌÐò±äµÃ¸ü¿ì¡¢¸üÊ¡Á¦¡£µ«ÊÇORM¿ò¼Ü¶¼Óе㓹ÌÖ´¼º¼û”£¬ËûÃÇÆÚÍû¿ª·¢Õß×ñ´ÓÌØ¶¨µÄ¹æÔò£¬µ±¹æÔò±»´òÆÆµÄʱºò¾Í·Ç³£ÄÑÒÔʹÓá£×îͨ³£µÄ¹æÔòÖ®Ò»¾ÍÊÇ£¬´æ´¢¹ý³Ì±ØÐë×ÜÊÇ·µ»Øµ¥¶ÀµÄ½á¹û¼¯£¬ÆäÖд ......
Ê×ÏÈÔÚlayoutÎļþ¼ÐϵÄxmlÖÐ ¼ÓÈëWebView¿Ø¼þ
<WebView
android:id="@+id/wv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
ÔÙÔÚÖ÷ÎļþÖÐÊäÈëÈçÏ´úÂë
public class TestDemo extends Activity {
/** Called when the activity is first created. */ ......
=======<html:messages>============
Action ÖÐ :
ActionMessages message = new ActionMessages();
message.add(" ÏûÏ¢¾ä±ú ",new ActionMessage(" ×ÊÔ´ÎļþÖÐ Key Öµ ",String ÀàÐÍÃèÊöÐÅÏ¢ ));
this.addMessages(request,message);
......
http://localhost:8080/tj16/
"/"´ú±í¸ùĿ¼£¬"./" ´ú±íµ±Ç°Ä¿Â¼£¬"../"´ú±íÉϼ¶Ä¿Â¼¡£
·þÎñÆ÷¶ËµÄÏà¶ÔµØÖ·Ö¸µÄÊÇÏà¶ÔÓÚÄãµÄwebÓ¦ÓõĵØÖ·£¬ÊÇÔÚ·þÎñÆ÷¶Ë½âÎöµÄ¡£(http://localhost:8080/tj16/)
htmlÒ³ÃæÖеÄÏà¶ÔµØÖ·¶¼ÊÇÏà¶ÔÓÚ·þÎñÆ÷¸ùĿ¼£¬Êǿͻ§¶Ëä¯ÀÀÆ÷½âÎöµÄ¡£(http://localhost:8080/)
webapp tj16
i:/test/t ......
Ò»°ãʼþ:
onClick HTML: Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick HTML: Êó±êË«»÷ʼþ
onMouseDown HTML: Êó±êÉϵİ´Å¥±»°´ÏÂÁË
onMouseUp HTML: Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄʼþ
onMouseOver HTML: µ±Êó±êÒÆ¶¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢µÄʼþ
onMouseMove HTML: Êó±êÒÆ¶¯Ê±´¥·¢µÄʼþ
onMous ......