Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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