예제 #1
0
        private void buttonRegister_Click(object sender, EventArgs e)
        {
            try
            {
                if (FileShellExtension.IsRegistered())
                {
                    FileShellExtension.UnRegister();
                }
                else
                {
                    FileShellExtension.Register();
                }
            }
            catch (UnauthorizedAccessException)
            {
                MessageBox.Show("Please run Application as local Admin");
            }

            buttonRegister.Text = FileShellExtension.IsRegistered() ? "Unregister ShellExtensions" : "Register ShellExtensions";
        }
예제 #2
0
 public OptionsControl()
 {
     InitializeComponent();
     buttonRegister.Text = FileShellExtension.IsRegistered() ? "Unregister ShellExtensions" : "Register ShellExtensions";
 }