private void UpdateEntriesList(SasCatalog cat) { IList <SasCatalogEntry> le = cat.GetSasCatalogEntries(); listEntries.DataContext = new EntryViewModel(le.ToArray()); statusText.Text = string.Format("{0} catalog entries in {1}.{2}", le.Count, cat.Libref, cat.Member); }
private void DeleteCatalogEntries(System.Collections.IList iList) { if (iList.Count == 0) { return; } _logger.Info("Deleting selected catalog entries"); SasCatalogEntry e = ((SasCatalogEntry)iList[0]); // remember which catalog this is so that we can update the list when complete SasCatalog cat = new SasCatalog(consumer3.AssignedServer, e.Libref, e.Member); // build PROC CATALOG statements for each catalog entry to delete. string code = string.Format("proc catalog catalog={0}.{1}; \n", e.Libref, e.Member); foreach (SasCatalogEntry entry in iList) { code += string.Format(" delete {0}.{1}; \n", entry.Entry, entry.ObjectType); } code += "run;\n"; _logger.InfoFormat("SAS job to delete entries: \n{0}", code); // submit the PROC CATALOG job and wait for it to complete consumer3.Submit.SubmitCode(code, consumer3.AssignedServer, false); // update the list view with remaining entries UpdateEntriesList(cat); }
// read list of catalog entries for the given catalog private void PopulateMembers(string lib, string cat) { Cursor c = Cursor.Current; Cursor.Current = Cursors.WaitCursor; lvMembers.BeginUpdate(); lvMembers.Items.Clear(); SasCatalog catalog = new SasCatalog(currentServer, lib, cat); foreach (SasCatalogEntry entry in catalog.GetSasCatalogEntries()) { ListViewItem lvi = new ListViewItem(); lvi.Text = entry.Name; lvi.SubItems.Add(entry.ObjectType); lvi.SubItems.Add(entry.Description); (lvi.SubItems.Add(entry.Created.ToString())).Tag = entry.Created; (lvi.SubItems.Add(entry.LastModified.ToString())).Tag = entry.LastModified; lvi.ImageIndex = GetImageIndexForEntry(entry.ObjectType.ToString()); lvi.Tag = string.Format("{0}.{1}.{2}.{3}", lib, cat, lvi.Text, entry.ObjectType); lvMembers.Items.Add(lvi); } lvMembers.EndUpdate(); Cursor.Current = c; UpdateToolbar(); }
public CatalogViewModel(SasCatalog catalog, LibraryViewModel parentLibrary) : base(parentLibrary, false) { _catalog = catalog; }
private void DeleteCatalogEntries(System.Collections.IList iList) { if (iList.Count == 0) return; _logger.Info("Deleting selected catalog entries"); SasCatalogEntry e = ((SasCatalogEntry)iList[0]); // remember which catalog this is so that we can update the list when complete SasCatalog cat = new SasCatalog( consumer3.AssignedServer, e.Libref, e.Member ); // build PROC CATALOG statements for each catalog entry to delete. string code = string.Format("proc catalog catalog={0}.{1}; \n",e.Libref,e.Member); foreach (SasCatalogEntry entry in iList) { code += string.Format(" delete {0}.{1}; \n", entry.Entry, entry.ObjectType); } code += "run;\n"; _logger.InfoFormat("SAS job to delete entries: \n{0}", code); // submit the PROC CATALOG job and wait for it to complete consumer3.Submit.SubmitCode(code, consumer3.AssignedServer, false); // update the list view with remaining entries UpdateEntriesList(cat); }
private void UpdateEntriesList(SasCatalog cat) { IList<SasCatalogEntry> le = cat.GetSasCatalogEntries(); listEntries.DataContext = new EntryViewModel(le.ToArray()); statusText.Text = string.Format("{0} catalog entries in {1}.{2}", le.Count, cat.Libref, cat.Member); }