Created
December 6, 2013 15:48
-
-
Save masoo/7826925 to your computer and use it in GitHub Desktop.
masoojer で編集中の文章の秘密を保護する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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