📄 icsharpcodepage.cs
字号:
int nLeftMenuElements = LeftMenu.Count;
foreach (MenuItem de in LeftMenu)
{
--nLeftMenuElements;
builder.Append("<tr>");
if (0 == String.Compare(de.Caption, m_strLeftMenuSelectedItem, true))
{
builder.Append("<td width=20><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1><img src=\""+ startPageLocation + "/Layout/Common/dot_listing.gif\" width=8 height=8><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=2 height=1></td>\r\n");
builder.Append("<td class=\"naviListDevelopActiv\">");
builder.Append(de.Caption);
builder.Append("</td></tr>\r\n");
}
else
{
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/allgemein/blind.gif\" width=20 height=1></td>\r\n");
builder.Append("<td class=\"naviListDevelop\"><a href=\"");
builder.Append(de.URL);
builder.Append("\">");
builder.Append(de.Caption);
builder.Append("</a></td></tr>\r\n");
}
if (0 != nLeftMenuElements)
{
builder.Append("<tr><td colspan=2><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=4></td></tr>\r\n");
}
}
builder.Append("</table></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
}
public virtual void RenderFirstPageBodySection(StringBuilder builder)
{
builder.Append("<div class=\"text\" style=\"position:absolute;left:0px;top:120px\"><table border=0 cellspacing=0 cellpadding=0>\r\n");
if (ShowContentBar)
{
nTotalColumns = 1;
builder.Append("<tr>");
if (ShowLeftMenu)
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=135 height=1></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
nTotalColumns += 2;
}
builder.Append("<td width=\"100%\" bgcolor=\"");
builder.Append(m_strMainColColor);
builder.Append("\" class=\"head\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1>");
builder.Append(ContentBarText); // TODO for virtual
builder.Append("</td>\r\n");
if (ShowRightBox)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
if (ShowMilestoneContentImage)
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/milestone_col_head.gif\" width=138 height=43></td>");
}
else
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=138 height=43></td>");
}
nTotalColumns += 2;
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>");
}
builder.Append("<tr>");
if (ShowLeftMenu)
{
RenderLeftMenu(builder);
}
builder.Append("<td bgcolor=\"#d6d7d8\" valign=\"top\" height=270><table border=0 cellspacing=0 cellpadding=0>\r\n");
builder.Append("<tr><td width=15><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=15></td>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td>");
builder.Append("<td width=15><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1></td>");
builder.Append("</tr><tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td>");
builder.Append("<td class=\"copy\">\r\n");
}
public virtual void RenderFinalPageBodySection(StringBuilder builder)
{
builder.Append("</td><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td></tr></table></td>\r\n");
if (ShowRightBox)
{
RenderRightBox(builder);
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr><tr>\r\n");
string strSubColor2Use = "#ffffff";
if (ShowLeftMenu)
{
builder.Append("<td height=20 bgcolor=\"");
builder.Append(strSubColor2Use);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=135 height=1></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>\r\n");
}
builder.Append( "<td width=\"100%\" bgcolor=\"");
builder.Append(m_strMainColColor);
builder.Append("\" class=\"copy\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1>");
builder.Append("<font size=\"-2\">");
builder.Append("Copyright ©2000-2004 <A HREF=\"mailto:webmaster@icsharpcode.net\" title=\"Contact Us\">IC#SharpCode</a>. Released under the terms of the GNU General Public License. </font></td>\r\n");
if (ShowRightBox)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
builder.Append("<td height=20 bgcolor=\"");
builder.Append(strSubColor2Use);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=138 height=20></td>\r\n");
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>\r\n");
builder.Append("</table></div>\r\n");
}
public virtual void RenderRightBox(StringBuilder builder)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>\r\n");
builder.Append("<td valign=\"top\"><table border=0 cellspacing=0 cellpadding=0><tr>");
builder.Append("<td valign=\"top\" background=\""+ startPageLocation + "/Layout/Common/klinker_milestone.gif\" width=138 height=113>");
builder.Append("<table border=0 cellspacing=0 cellpadding=0><tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=3></td></tr>");
builder.Append("<tr><td class=\"milestoneText\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1>");
builder.Append(VersionText);
builder.Append("</td></tr>");
builder.Append("<tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=52></td></tr>");
builder.Append("<tr><td class=\"milestoneText\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=75 height=1><font size=\"+2\">");
builder.Append(VersionStatus);
builder.Append("</font></td></tr>");
builder.Append("</table></td></tr>");
builder.Append("<tr><td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>");
builder.Append("<tr><td bgcolor=\"#d6d7d8\" valign=\"top\" height=49><table border=0 cellspacing=0 cellpadding=0>");
builder.Append("<tr><td width=10><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=5></td>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td></tr><tr>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1></td><td class=\"copyUnderlineBig\">");
RenderRightBoxHtml(builder);
builder.Append("</td>");
builder.Append("</tr></table></td></tr></table></td>");
}
public string[] projectFiles;
StringBuilder projectSection = null;
public void RenderSectionStartBody(StringBuilder builder)
{
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
if (projectSection == null) {
projectSection = new StringBuilder();
projectSection.Append("<DIV class='tablediv'><TABLE CLASS='dtTABLE' CELLSPACING='0'>\n");
projectSection.Append(String.Format("<TR><TH>{0}</TH><TH>{1}</TH><TH>{2}</TH></TR>\n",
stringParserService.Parse("${res:StartPage.StartMenu.NameTable}"),
stringParserService.Parse("${res:StartPage.StartMenu.ModifiedTable}"),
stringParserService.Parse("${res:StartPage.StartMenu.LocationTable}")
));
try {
// Get the recent projects
Core.Properties.DefaultProperties svc = (Core.Properties.DefaultProperties)Core.Services.ServiceManager.Services.GetService(typeof(Core.Services.PropertyService));
object recentOpenObj = svc.GetProperty("ICSharpCode.SharpDevelop.Gui.MainWindow.RecentOpen");
if (recentOpenObj is ICSharpCode.SharpDevelop.Services.RecentOpen) {
ICSharpCode.SharpDevelop.Services.RecentOpen recOpen = (ICSharpCode.SharpDevelop.Services.RecentOpen)recentOpenObj;
projectFiles = new string[recOpen.RecentProject.Count];
for (int i = 0; i < recOpen.RecentProject.Count; ++i) {
string fileName = recOpen.RecentProject[i].ToString();
// if the file does not exist, goto next one
if (!System.IO.File.Exists(fileName)) {
continue;
}
projectFiles[i] = fileName;
projectSection.Append("<TR><TD>");
projectSection.Append("<a href=\"project://" + i + "\">");
projectSection.Append(ParseCombineFile(fileName));
projectSection.Append("</A>");
projectSection.Append("</TD><TD>");
System.IO.FileInfo fInfo = new System.IO.FileInfo(fileName);
projectSection.Append(fInfo.LastWriteTime.ToShortDateString());
projectSection.Append("</TD><TD>");
projectSection.Append(fileName);
projectSection.Append("</TD></TR>\n");
}
}
} catch {}
projectSection.Append("</TABLE></DIV><BR/><BR/>");
projectSection.Append(String.Format("<input type=button value='{0}' onClick=\"location.href('/opencombine');\">\n",
stringParserService.Parse("${res:StartPage.StartMenu.OpenCombineButton}")
));
projectSection.Append(String.Format("<input type=button value='{0}' onClick=\"location.href('/newcombine');\">\n",
stringParserService.Parse("${res:StartPage.StartMenu.NewCombineButton}")
));
projectSection.Append("<BR/><BR/><BR/>");
}
builder.Append(projectSection.ToString());
}
public void RenderSectionAuthorBody(StringBuilder builder)
{
try {
builder.Append("<iframe src=\"http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.Contributors\" width=\"800\" height=\"1400\" />");
// FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
// PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
//
// string html = ConvertXml.ConvertToString(Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "doc" +
// Path.DirectorySeparatorChar + "AUTHORS.xml",
//
// propertyService.DataDirectory +
// Path.DirectorySeparatorChar + "ConversionStyleSheets" +
// Path.DirectorySeparatorChar + "ShowAuthors.xsl");
// builder.Append(html);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
public void RenderSectionChangeLogBody(StringBuilder builder)
{
try {
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
string html = ConvertXml.ConvertToString(Application.StartupPath +
Path.DirectorySeparatorChar + ".." +
Path.DirectorySeparatorChar + "doc" +
Path.DirectorySeparatorChar + "ChangeLog.xml",
Application.StartupPath +
Path.DirectorySeparatorChar + ".." +
Path.DirectorySeparatorChar + "data" +
Path.DirectorySeparatorChar + "ConversionStyleSheets" +
Path.DirectorySeparatorChar + "ShowChangeLog.xsl");
builder.Append(html);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
public void RenderSectionHelpWantedBody(StringBuilder builder)
{
try {
builder.Append("<iframe src=\"http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.FeaturesYouCouldHelpUsWith\" width=\"800\" height=\"1000\" />");
// FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
// string html = ConvertXml.ConvertToString(Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "doc" +
// Path.DirectorySeparatorChar + "HowYouCanHelp.xml",
//
// Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "data" +
// Path.DirectorySeparatorChar + "ConversionStyleSheets" +
// Path.DirectorySeparatorChar + "ShowHowYouCanHelp.xsl");
// builder.Append(html);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
/// <summary>
/// Extracts a combine name from the specified file; return fileName on error
/// </summary>
string ParseCombineFile(string fileName)
{
XmlTextReader reader = new XmlTextReader(fileName);
reader.MoveToContent();
if (reader.MoveToAttribute("name")) {
return reader.Value;
}
return fileName;
}
public string Render(string section)
{
startPageLocation = Application.StartupPath + Path.DirectorySeparatorChar +
".." + Path.DirectorySeparatorChar +
"data" + Path.DirectorySeparatorChar +
"resources" + Path.DirectorySeparatorChar +
"startpage";
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
switch (section) {
case "Start":
ContentBarText = stringParserService.Parse("${res:StartPage.StartMenu.BarNameName}");
break;
case "ChangeLog":
ContentBarText = stringParserService.Parse("${res:StartPage.ChangeLogMenu.BarNameName}");
break;
case "Authors":
ContentBarText = stringParserService.Parse("${res:StartPage.AuthorsMenu.BarNameName}");
break;
case "HelpWanted":
ContentBarText = stringParserService.Parse("${res:StartPage.HelpWantedMenu.BarNameName}");
break;
}
StringBuilder builder = new StringBuilder(2048);
RenderHeaderSection(builder);
RenderPageTopSection(builder);
RenderFirstPageBodySection(builder);
switch (section) {
case "Start":
RenderSectionStartBody(builder);
break;
case "ChangeLog":
RenderSectionChangeLogBody(builder);
break;
case "Authors":
RenderSectionAuthorBody(builder);
break;
case "HelpWanted":
RenderSectionHelpWantedBody(builder);
break;
}
RenderFinalPageBodySection(builder);
RenderPageEndSection(builder);
return builder.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -