Skip to content

Instantly share code, notes, and snippets.

@masoo
Created December 6, 2013 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masoo/7826925 to your computer and use it in GitHub Desktop.
Save masoo/7826925 to your computer and use it in GitHub Desktop.
masoojer で編集中の文章の秘密を保護する。
# -*- coding: utf-8 -*-
module Masoojer
def self.secret_protection(begin_position, end_position)
replace_string = "■" * (end_position - begin_position)
$azukiControl.Document.Replace(replace_string, begin_position, end_position)
end
end
menu_sp = System::Windows::Controls::MenuItem.new()
menu_sp.Name = System::String.new("MenuItemSecretprotection")
menu_sp.Header = System::String.new("秘密保護(_S)")
$menu.FindName("MenuItemTools").Items.Add(menu_sp)
$menu.RegisterName("MenuItemSecretprotection", menu_sp)
$menu.FindName("MenuItemSecretprotection").Click do |s, e|
(begin_position, end_position) = $azukiControl.Document.GetSelection
Masoojer::secret_protection(begin_position, end_position)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment