|
C#源碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的C#詞法解析引擎全面地分析您的源碼並根據用戶自定義的C#語言源碼風格重構和美化C#源碼檔案,因此它能精細地根據不同的源碼風格美化多種源碼,甚至是下面這些極度混亂的源碼:
|
C#源碼美化範例:
範例1
|
範例2
|
範例3
|
範例4
此 C# 源碼美化的範例是為了展示 SourceFormatX C# 源碼美化工具 詞法解析引擎的威力。
namespace System.Security.Cryptography{
#if CONFIG_CRYPTO
using System;public abstract class RC2:SymmetricAlgorithm{protected int
EffectiveKeySizeValue;public RC2():base(){KeySizeValue=128;BlockSizeValue=64;
FeedbackSizeValue=64;LegalBlockSizesValue=new KeySizes[1];LegalBlockSizesValue[
0]=new KeySizes(64,64,64);LegalKeySizesValue=new KeySizes[1];LegalKeySizesValue
[0]=new KeySizes(128,128,128);}public new static RC2 Create(){return(RC2)(
CryptoConfig.CreateFromName(CryptoConfig.RC2Default,null));}public new static
RC2 Create(String algName){return(RC2)(CryptoConfig.CreateFromName(algName,null
));}public virtual int EffectiveKeySize{get{if(EffectiveKeySize!=0){return
EffectiveKeySize;}else{return KeySizeValue;}}set{if(value==0){
EffectiveKeySizeValue=0;}else if(value<40||value>KeySizeValue){throw new
CryptographicException(_("Crypto_InvalidKeySize"),value.ToString());}
EffectiveKeySizeValue=value;}}public override int KeySize{get{return
KeySizeValue;}set{if(value<EffectiveKeySizeValue){throw new
CryptographicException(_("Crypto_InvalidKeySize"),value.ToString());}
base.KeySize=value;}}};
#endif
};
namespace System.Security.Cryptography
{
#if CONFIG_CRYPTO
using System;
public abstract class RC2: SymmetricAlgorithm
{
protected int EffectiveKeySizeValue;
public RC2(): base()
{
KeySizeValue = 128;
BlockSizeValue = 64;
FeedbackSizeValue = 64;
LegalBlockSizesValue = new KeySizes[1];
LegalBlockSizesValue[0] = new KeySizes(64, 64, 64);
LegalKeySizesValue = new KeySizes[1];
LegalKeySizesValue[0] = new KeySizes(128, 128, 128);
}
public new static RC2 Create()
{
return (RC2)(CryptoConfig.CreateFromName(CryptoConfig.RC2Default, null));
}
public new static RC2 Create(String algName)
{
return (RC2)(CryptoConfig.CreateFromName(algName, null));
}
public virtual int EffectiveKeySize
{
get
{
if (EffectiveKeySize != 0)
{
return EffectiveKeySize;
}
else
{
return KeySizeValue;
}
}
set
{
if (value == 0)
{
EffectiveKeySizeValue = 0;
}
else if (value < 40 || value > KeySizeValue)
{
throw new CryptographicException(_("Crypto_InvalidKeySize"),
value.ToString());
}
EffectiveKeySizeValue = value;
}
}
public override int KeySize
{
get
{
return KeySizeValue;
}
set
{
if (value < EffectiveKeySizeValue)
{
throw new CryptographicException(_("Crypto_InvalidKeySize"),
value.ToString());
}
base.KeySize = value;
}
}
};
#endif
};
範例1
|
範例2
|
範例3
|
範例4
|