예제 #1
0
        private void assignMetaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode selectedContainerNode = treeView1.SelectedNode;
            TreeNode selectedTreeNode      = treeViewStorageObjects.SelectedNode;

            if (selectedContainerNode != null && selectedTreeNode != null)
            {
                MetaInformationDialog metaInformationDialog = new MetaInformationDialog();
                if (metaInformationDialog.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        Connection.SetStorageItemMetaInformation(selectedContainerNode.Text,
                                                                 selectedTreeNode.Text,
                                                                 metaInformationDialog.MetaKeyCollection);
                        RetrieveStorageObjectInfo();
                        SetSuccessfulMessageInStatusBar();
                    }
                    catch (ContainerNotFoundException cnfe)
                    {
                        MessageBox.Show(cnfe.ToString());
                    }
                    catch (StorageItemNotFoundException sinfe)
                    {
                        MessageBox.Show(sinfe.ToString());
                    }
                }
            }
        }
예제 #2
0
        private void assignMetaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode selectedContainerNode = treeView1.SelectedNode;
            TreeNode selectedTreeNode = treeViewStorageObjects.SelectedNode;

            if (selectedContainerNode != null && selectedTreeNode != null)
            {
                MetaInformationDialog metaInformationDialog = new MetaInformationDialog();
                if (metaInformationDialog.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        Connection.SetStorageItemMetaInformation(selectedContainerNode.Text,
                                                                 selectedTreeNode.Text,
                                                                 metaInformationDialog.MetaKeyCollection);
                        RetrieveStorageObjectInfo();
                        SetSuccessfulMessageInStatusBar();
                    }
                    catch (ContainerNotFoundException cnfe)
                    {
                        MessageBox.Show(cnfe.ToString());
                    }
                    catch (StorageItemNotFoundException sinfe)
                    {
                        MessageBox.Show(sinfe.ToString());
                    }
                }
            }
        }