|
C-Sharp Source Code Formatting Show |
|
| |
|
|
SourceFormatX code formatter bases on powerful syntax parse engines so it can beautify and format source code files with omnifarious styles, even these messy source code examples below:
|
C-Sharp Source Code Formatting Examples:
Example 1
|
Example 2
|
Example 3
|
Example 4
The purpose of this C-Sharp code formatting demonstration is to show the power of C# language syntax parse engine which powered by SourceFormatX C# Code Formatter.
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
};
Example 1
|
Example 2
|
Example 3
|
Example 4
Don't waste time on formatting C-Sharp source code yourself! Try SourceFormatX C# Code Formatter and let it works for your team.
|