|
C#原始碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的C#詞法解析引擎全面地分析您的原始碼並根據用戶自定義的C#語言原始碼風格重構和美化C#原始碼檔案,因此它能精細地根據不同的原始碼風格美化多種原始碼,甚至是下面這些極度混亂的原始碼:
|
C#原始碼美化範例:
範例1
|
範例2
|
範例3
|
範例4
此 C# 原始碼美化的範例是為了展示 SourceFormatX C# 原始碼美化工具 詞法解析引擎的威力。這份混亂到無法閱讀的C#原始碼檔案在1秒種內即被 SourceFormatX 美化和縮排成整潔且可讀性強的美觀風格樣式。
using System;using System.IO;namespace ADOGuy{namespace WebImageLib{
/// <summary>
/// Summary description for GalleryPhoto.
/// </summary>
public class GalleryPhoto{protected void Init(){Debug.Assert(
userManager.CurrentUser==null,"Already logged on");FileInfo fiWeb=new FileInfo(
_file.Directory.ToString()+"\\+"+FileNameBase(_file)+".jpg");try{int
minThumbSize=(thumbSize.Height>thumbSize.Width?thumbSize.Width:thumbSize.Height
);if((full.Height<=minWebSize)||(full.Width!=minWebSize)){Bitmap web=new Bitmap
(full,size);web.Save(fiWeb.FullName,ImageFormat.Jpeg);}else{for(i=0;i<ihalf;i++
)a.Data[i]=o.Data[ihalf+i+1];}}catch{System.Diagnostics.Trace.WriteLine(
"Not a File: "+_file.FullName);return;}}private void SelectedIndexChanged(
object sender,System.EventArgs e){switch(cbEmail.SelectedIndex){case 0:
txtEmail.Text=Contact.Email1;break;case 1:txtEmail.Text=Contact.Email2;break;
case 2:txtEmail.Text=Contact.Email3;break;}}}}}
using System;
using System.IO;
namespace ADOGuy
{
namespace WebImageLib
{
/// <summary>
/// Summary description for GalleryPhoto.
/// </summary>
public class GalleryPhoto
{
protected void Init()
{
Debug.Assert(userManager.CurrentUser == null, "Already logged on");
FileInfo fiWeb = new FileInfo(_file.Directory.ToString() + "\\+" +
FileNameBase(_file) + ".jpg");
try
{
int minThumbSize = (thumbSize.Height > thumbSize.Width ?
thumbSize.Width: thumbSize.Height);
if ((full.Height <= minWebSize) || (full.Width != minWebSize))
{
Bitmap web = new Bitmap(full, size);
web.Save(fiWeb.FullName, ImageFormat.Jpeg);
}
else
{
for (i = 0; i < ihalf; i++)
a.Data[i] = o.Data[ihalf + i + 1];
}
}
catch
{
System.Diagnostics.Trace.WriteLine("Not a File: " + _file.FullName);
return ;
}
}
private void SelectedIndexChanged(object sender, System.EventArgs e)
{
switch (cbEmail.SelectedIndex)
{
case 0:
txtEmail.Text = Contact.Email1;
break;
case 1:
txtEmail.Text = Contact.Email2;
break;
case 2:
txtEmail.Text = Contact.Email3;
break;
}
}
}
}
}
範例1
|
範例2
|
範例3
|
範例4
|