예제 #1
0
        /// <summary>
        /// make a copy of catalog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btCopy_Click(object sender, RoutedEventArgs e)
        {
            //get the selected item
            if (lbCatalogs.SelectedItem == null)
            {
                return;
            }
            ICatalog copy = lbCatalogs.SelectedItem as ICatalog;

            //copy fields
            var cat = new Catalog.Catalog(ComputeNode);

            BermudaConfigUtil.CopyCatalog(copy, cat);

            //open the window
            CatalogConfig window = new CatalogConfig(cat, "");
            var           ret    = window.ShowDialog();

            if (!ret.HasValue || ret == false)
            {
                return;
            }

            //add to list
            Catalogs.Add(cat);
            ComputeNode.Catalogs.Add(cat.CatalogName, cat);
        }
예제 #2
0
        /// <summary>
        /// create a new catalog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btNew_Click(object sender, RoutedEventArgs e)
        {
            //new item
            var cat = new Catalog.Catalog(ComputeNode);

            cat.CatalogMetadata = new CatalogMetadata(cat);

            //open the window
            CatalogConfig window = new CatalogConfig(cat, "");
            var           ret    = window.ShowDialog();

            if (!ret.HasValue || ret == false)
            {
                return;
            }

            //add to list
            Catalogs.Add(cat);
            ComputeNode.Catalogs.Add(cat.CatalogName, cat);
        }
예제 #3
0
        /// <summary>
        /// handle the double click in the list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = sender as ListBoxItem;

            if (item == null || !item.IsSelected)
            {
                return;
            }
            ICatalog sel     = item.Content as ICatalog;
            ICatalog catalog = new Catalog.Catalog(ComputeNode);

            BermudaConfigUtil.CopyCatalog(sel, catalog);
            CatalogConfig window = new CatalogConfig(catalog, catalog.CatalogName);
            var           ret    = window.ShowDialog();

            if (!ret.HasValue || ret == false)
            {
                return;
            }
            BermudaConfigUtil.CopyCatalog(catalog, sel);
            lbCatalogs.Items.Refresh();
        }
예제 #4
0
        /// <summary>
        /// create a new catalog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btNew_Click(object sender, RoutedEventArgs e)
        {
            //new item
            var cat = new Catalog.Catalog(ComputeNode);
            cat.CatalogMetadata = new CatalogMetadata(cat);

            //open the window
            CatalogConfig window = new CatalogConfig(cat, "");
            var ret = window.ShowDialog();
            if (!ret.HasValue || ret == false)
                return;

            //add to list
            Catalogs.Add(cat);
            ComputeNode.Catalogs.Add(cat.CatalogName, cat);
        }
예제 #5
0
        /// <summary>
        /// make a copy of catalog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btCopy_Click(object sender, RoutedEventArgs e)
        {
            //get the selected item
            if (lbCatalogs.SelectedItem == null) return;
            ICatalog copy = lbCatalogs.SelectedItem as ICatalog;

            //copy fields
            var cat = new Catalog.Catalog(ComputeNode);
            BermudaConfigUtil.CopyCatalog(copy, cat);

            //open the window
            CatalogConfig window = new CatalogConfig(cat, "");
            var ret = window.ShowDialog();
            if (!ret.HasValue || ret == false)
                return;

            //add to list
            Catalogs.Add(cat);
            ComputeNode.Catalogs.Add(cat.CatalogName, cat);
        }
예제 #6
0
 /// <summary>
 /// handle the double click in the list
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var item = sender as ListBoxItem;
     if (item == null || !item.IsSelected) return;
     ICatalog sel = item.Content as ICatalog;
     ICatalog catalog = new Catalog.Catalog(ComputeNode);
     BermudaConfigUtil.CopyCatalog(sel, catalog);
     CatalogConfig window = new CatalogConfig(catalog, catalog.CatalogName);
     var ret = window.ShowDialog();
     if (!ret.HasValue || ret == false)
         return;
     BermudaConfigUtil.CopyCatalog(catalog, sel);
     lbCatalogs.Items.Refresh();
 }