SourceFormatX

軟體簡介

主要功能

為什麼要使用

源碼美化演示

整合和插件

界面預覽

常見問題

升級歷史

所獲獎項

用戶評價

許可協議

CodeToHtml

C#源碼美化效果演示

現在購買
下載試用

美化工具功能

SourceFormatX 使用強大的C#詞法解析引擎全面地分析您的源碼並根據用戶自定義的C#語言源碼風格重構和美化C#源碼檔案,因此它能精細地根據不同的源碼風格美化多種源碼,甚至是下面這些極度混亂的源碼:

C/C++ Java C# Delphi (Pascal)
PHP JSP ASP JavaScript
Visual Basic VB.NET VBScript HTML Components
80x86 ASM 8051 ASM CORBA IDL


  C#源碼美化範例:     範例1   |   範例2   |   範例3   |   範例4

此 C# 源碼美化的範例是為了展示 SourceFormatX C# 源碼美化工具 詞法解析引擎的威力。

  /* 源碼美化之前的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
  };

  /* 源碼美化之後的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

  };

範例1   |   範例2   |   範例3   |   範例4