Ejemplo n.º 1
0
        public void SetFolder(uint journals, uint inbox)
        {
            if (fInitialized) return;
            fParent.LogInfo(String.Format("Initializing KI Mail [NodeID: {0}]", journals));

            fInitialized = true;
            fBaseNode = journals;
            fParent.FetchChildren(journals, new Action<VaultNode>(IAddJournalFolder));

            //Create a "fake" folder for the inbox
            VaultFolderNode folder = new VaultFolderNode();
            folder.FolderName = "Inbox";
            folder.FolderType = EStandardNode.kInboxFolder;
            folder.ID = inbox;

            //Pass it off
            IAddJournalFolder(folder.BaseNode);
        }
Ejemplo n.º 2
0
        private void IJournalSelected(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            if (!e.IsSelected) {
                fDeleteFolderMenuItem.Visible = false;
                return;
            }
            fMailList.Items.Clear();

            VaultNode node = (VaultNode)e.Item.Tag;
            fParent.FetchChildren(node.ID, new Action<VaultNode>(IAddKiItem));

            // No context menus for the KI Inbox magic folder
            VaultFolderNode folder = new VaultFolderNode(node);
            fDeleteFolderMenuItem.Visible = (folder.FolderType != EStandardNode.kInboxFolder);
        }
Ejemplo n.º 3
0
        private void IAddJournalFolder(VaultNode node)
        {
            VaultFolderNode age = new VaultFolderNode(node);
            fParent.LogDebug(String.Format("Got journal [AGE: {0}] [NodeID: {1}]", age.FolderName, age.ID));

            ListViewItem folder = new ListViewItem(age.FolderName);
            folder.Tag = node;
            if (fParent.GetChildCount(node.ID) == 0 && !fShowEmptyFolders.Checked)
                fHiddenFolders.Add(folder);
            else
                fAgeList.Items.Add(folder);
        }
Ejemplo n.º 4
0
        private void IDeleteFolder(object sender, EventArgs e)
        {
            if (fAgeList.FocusedItem == null) return;
            VaultFolderNode folder = new VaultFolderNode((VaultNode)fAgeList.FocusedItem.Tag);

            // If this folder has children, we should prompt the user about the deletion...
            if (fParent.GetChildCount(folder.ID) > 0) {
                DialogResult dr = MessageBox.Show(String.Format("Are you sure you want to delete \"{0}\"?\r\nAny items left in this folder will be orphaned.",
                    folder.FolderName), "Delete Age Folder", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.No)
                    return;
            }

            // Callback from Auth will remove it from the list
            fParent.AuthCli.RemoveVaultNode(fBaseNode, folder.ID);
        }
Ejemplo n.º 5
0
        private void IAddFolderToPanes(VaultNode node)
        {
            if (node.NodeType == ENodeType.kNodePlayerInfoList) {
                VaultPlayerInfoListNode list = new VaultPlayerInfoListNode(node);

                //Basic stuff
                if (list.FolderType == EStandardNode.kBuddyListFolder) fBaseNodes.Add(EStandardNode.kBuddyListFolder, node.ID);
                if (list.FolderType == EStandardNode.kIgnoreListFolder) fBaseNodes.Add(EStandardNode.kIgnoreListFolder, node.ID);
                if (list.FolderType == EStandardNode.kPeopleIKnowAboutFolder) fBaseNodes.Add(EStandardNode.kPeopleIKnowAboutFolder, node.ID);

                //If it's an AgeOwners folder, we have the Neighborhood :)
                if (list.FolderType == EStandardNode.kAgeOwnersFolder) fBaseNodes.Add(EStandardNode.kHoodMembersFolder, node.ID);
            }

            //Search for Neighborhood in the AgesIOwn
            if (node.NodeType == ENodeType.kNodeAgeInfoList) {
                VaultAgeInfoListNode ages = new VaultAgeInfoListNode(node);
                if (ages.FolderType == EStandardNode.kAgesIOwnFolder) {
                    FetchChildren(node.ID, new Action<VaultNode>(IAddFolderToPanes));
                }
            }

            //Grab the AgeInfo...
            if (node.NodeType == ENodeType.kNodeAgeLink)
                FetchChildren(node.ID, new Action<VaultNode>(IAddFolderToPanes));

            //See if this is the Neighborhood or Relto
            if (node.NodeType == ENodeType.kNodeAgeInfo) {
                VaultAgeInfoNode ageinfo = new VaultAgeInfoNode(node);
                if (ageinfo.Filename == "Neighborhood") {
                    //Yep! Grab children :)
                    FetchChildren(node.ID, new Action<VaultNode>(IAddFolderToPanes));
                }

                //HACK!!! Change back to PERSONAL asap!
                if (ageinfo.Filename == "Neighborhood") {
                    //Stash this node! Oh, and YES this is a strange label, but whatev.
                    fBaseNodes.Add(EStandardNode.kAgeInfoNode, ageinfo.ID);
                }
            }

            //Are these KI Mail Folders?
            if (node.NodeType == ENodeType.kNodeFolder) {
                VaultFolderNode folder = new VaultFolderNode(node);
                if (folder.FolderType == EStandardNode.kAgeJournalsFolder) fBaseNodes.Add(EStandardNode.kAgeJournalsFolder, node.ID);
                if (folder.FolderType == EStandardNode.kInboxFolder) fBaseNodes.Add(EStandardNode.kInboxFolder, node.ID);

            }

            //Is this my PlayerInfo?
            if (node.NodeType == ENodeType.kNodePlayerInfo) {
                VaultPlayerInfoNode info = new VaultPlayerInfoNode(node);
                if (info.PlayerID == fActivePlayer) fBaseNodes.Add(EStandardNode.kPlayerInfoNode, info.ID);
            }

            //FIXME: This is a strange hack...
            //Aparently, it causes the selected tab to update. I would say this is spammy though.
            ITabSelected(null, new TabControlEventArgs(fTabControl.SelectedTab, fTabControl.SelectedIndex, TabControlAction.Selected));
        }