/// <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); }
/// <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); }
/// <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(); }
/// <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); }
/// <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); }
/// <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(); }