public string showGui(string userDataDirectory)
        {
            var panel = O2Gui.open <Panel>("Secret Data Files", 750, 200);

            var controls = panel.add_1x1("Folder with secret data files", "SecretData", true, 230);

            directory = controls[0].add_Directory(userDataDirectory);
            if (userDataDirectory.files().size() == 0)
            {
                new SecretData().serialize(userDataDirectory.pathCombine("SecretData.xml"));
            }

            directory.parent().insert_Below <Panel>(30)
            .add_Link("Create new Secret's file", 5, 0, createNewSecretsFile)
            .append_Link("Save Loaded File", saveLoadedSecretsFile);

            dataGridView = controls[1].add_DataGridView();
            dataGridView.AllowUserToAddRows    = true;
            dataGridView.AllowUserToDeleteRows = true;
            dataGridView.add_Columns(typeof(Credential));
            var contextMenu = dataGridView.add_ContextMenu();

            contextMenu.add_MenuItem("Save", saveLoadedSecretsFile);
            contextMenu.add_MenuItem("Create new File", createNewSecretsFile);

            directory.afterFileSelect(loadFile);
            statusLabel = panel.parentForm().add_StatusStrip();

            statusMessage("Select Secrets file to load from TreeView on the left");
            return("done");
        }
Beispiel #2
0
        public string showGui(string userDataDirectory)
        {
            var panel = O2Gui.open<Panel>("Secret Data Files", 750, 200);

            var controls = panel.add_1x1("Folder with secret data files", "SecretData", true, 230);
            directory = controls[0].add_Directory(userDataDirectory);
            if (userDataDirectory.files().size() == 0)
                new SecretData().serialize(userDataDirectory.pathCombine("SecretData.xml"));

            directory.parent().insert_Below<Panel>(30)
                     .add_Link("Create new Secret's file", 5, 0, createNewSecretsFile)
                     .append_Link("Save Loaded File", saveLoadedSecretsFile);

            dataGridView = controls[1].add_DataGridView();
            dataGridView.AllowUserToAddRows = true;
            dataGridView.AllowUserToDeleteRows = true;
            dataGridView.add_Columns(typeof(Credential));
            var contextMenu = dataGridView.add_ContextMenu();
            contextMenu.add_MenuItem("Save", saveLoadedSecretsFile);
            contextMenu.add_MenuItem("Create new File", createNewSecretsFile);

            directory.afterFileSelect(loadFile);
            statusLabel = panel.parentForm().add_StatusStrip();

            statusMessage("Select Secrets file to load from TreeView on the left");
            return "done";
        }