Insert Code for Windows Live Writer 1.0.5 Beta - 加入捲軸功能 (20080427 修正)

  • 8337
  • 0
  • C#
  • 2008-05-02

點部落 離線編輯功能說明 中,有推薦一個【Insert Code for Windows Live Writer】覺得還不錯用。最近,貼比較長一點的程式碼,就覺得會破壞整個版面的美觀,所以就加入可以設定程式碼範圍的設定。只要勾選啟用 Scrollbar,然後設定寬度 Width 或是高度 Height,如果程式碼超出設定大小捲軸就會自動出現,將程式碼縮小在範圍內。如果貼出來的程式碼,不支援摺疊功能的話,這樣的修改應該還不錯吧。

點部落 離線編輯功能說明 中,有推薦一個【Insert Code for Windows Live Writer】覺得還不錯用。最近,貼比較長一點的程式碼,就覺得會破壞整個版面的美觀,所以就加入可以設定程式碼範圍的設定。只要勾選啟用 Scrollbar,然後設定寬度 Width 或是高度 Height,如果程式碼超出設定大小捲軸就會自動出現,將程式碼縮小在範圍內。如果貼出來的程式碼,不支援摺疊功能的話,這樣的修改應該還不錯吧。

原始程式碼效果:

   1:  private void ExecuteFormatting(bool isPreview)
   2:  {
   3:      switch (this.comboBoxLanguage.SelectedIndex)
   4:      {
   5:          case (0): // C#
   6:              this.FormatCode(new CSharpFormat.CSharpFormat(), isPreview);
   7:              break;
   8:          case (1): // JavaScript
   9:              this.FormatCode(new JavaScriptFormat(), isPreview);
  10:              break;
  11:          case (2): // HTML
  12:              this.FormatCode(new HtmlFormat(), isPreview);
  13:              break;
  14:          case (3): // TSQL
  15:              this.FormatCode(new TsqlFormat(), isPreview);
  16:              break;
  17:          case (4): // MSH
  18:              this.FormatCode(new MshFormat(), isPreview);
  19:              break;
  20:          case (5): // Visual Basic
  21:              this.FormatCode(new VisualBasicFormat(), isPreview);
  22:              break;
  23:          default:
  24:              break;
  25:      }
  26:  }

 

 

 

 

 

 

 

 

 

增加程式碼設定範圍 Width、Heigh 與啟用 Scrollbar 功能 (三者需要一起設定,並勾選 line numbers 或 alternative line background 才會有效果):

 

InsertCode-0000 

設定 ScrollBar 的寬度 Width 與高度 Height,程式碼超過範圍值自動出現捲軸,如下:

   1:  private void ExecuteFormatting(bool isPreview)
   2:  {
   3:      switch (this.comboBoxLanguage.SelectedIndex)
   4:      {
   5:          case (0): // C#
   6:              this.FormatCode(new CSharpFormat.CSharpFormat(), isPreview);
   7:              break;
   8:          case (1): // JavaScript
   9:              this.FormatCode(new JavaScriptFormat(), isPreview);
  10:              break;
  11:          case (2): // HTML
  12:              this.FormatCode(new HtmlFormat(), isPreview);
  13:              break;
  14:          case (3): // TSQL
  15:              this.FormatCode(new TsqlFormat(), isPreview);
  16:              break;
  17:          case (4): // MSH
  18:              this.FormatCode(new MshFormat(), isPreview);
  19:              break;
  20:          case (5): // Visual Basic
  21:              this.FormatCode(new VisualBasicFormat(), isPreview);
  22:              break;
  23:          default:
  24:              break;
  25:      }
  26:  }

有興趣的人,請自行下載【Insert Code for Windows Live Writer 1.0.5 Beta With scrollbar

(MD5: 35853f309dd41171f3b7be97a5790998  InsertCodePlugin.WindowsLiveWriter.zip)

下載【20080427 修正版】 (MD5: 0f25ee47f0626cd75c419be696dbe553  InsertCodePlugin.20080427.zip)

野人獻曝