public ICrud GetCrud(string guid) { ExternalStoreItem item = GetExternalStoreItem(guid); if (item != null) { return(item.ExternalStoreAddinConfig.GetCrudInterface()); } return(null); }
public static void MyDumpExternalStoreOptions(string prefix, ExternalStoreOptions options) { ExternalStoreItem item = options.GetCurrentOption(); if (item != null) { string s = string.Format("****** '{0}' \n\tExternalStoreJob '{1}'\n\tCleanJob '{2}'", prefix, (item.ExternalStoreJob != null), (item.CleanJob != null)); DicomUtilities.DebugString(DebugStringOptions.ShowCounter, s); } }
private static ExternalStoreItem Exists(List <ExternalStoreItem> tempItems, ExternalStoreItem item) { foreach (ExternalStoreItem esi in tempItems) { if (esi.Equals(item)) { return(esi); } } return(null); }
public void RunView(ExternalStoreConfigurationView view, AdvancedSettings settings) { _View = view; _Settings = settings; if (settings != null) { try { _Options = _Settings.GetAddInCustomData <ExternalStoreOptions>(_Name, "ExternalStoreOptions", _extraTypeList.ToArray()); if (_Options == null) { _Options = new ExternalStoreOptions(); foreach (ExternalStoreAddinConfigAbstract addinConfig in _externalStoreAddinConfigArray) { ExternalStoreItem item = new ExternalStoreItem(); item.ExternalStoreAddinConfig = addinConfig; // Here you can serialize this yourself } _Settings.SetAddInCustomData <ExternalStoreOptions>(_Name, "ExternalStoreOptions", _Options, _extraTypeList.ToArray()); _Settings.Save(); } } catch (Exception e) { Logger.Global.Exception("ExternalStore", e); if (_Options == null) { _Options = new ExternalStoreOptions(); } } ExternalStoreOptions tempOptions = Clone(_Options); _View.ExternalStoreAddins = _externalStoreAddinConfigArray; _View.Initialize(tempOptions, this.ServiceDirectory); _View.Enabled = false; } _View.ExternalStore += new EventHandler <ExternalStoreMessageEventArgs>(View_ExternalStore); _View.CancelExternalStore += new EventHandler <EventArgs>(_View_CancelExternalStore); _View.Clean += new EventHandler <CleanMessageEventArgs>(View_Clean); _View.Reset += new EventHandler <ResetEventArgs>(View_Reset); _View.Restore += new EventHandler <RestoreMessageEventArgs>(View_Restore); _View.CancelRestore += new EventHandler <EventArgs>(_View_CancelRestore); _View.SettingsChanged += new EventHandler(View_SettingsChanged); }
// If item already exists, do nothing // If item doesn't exist, add it // Remove all other existing items public void SynchronizeOptionsList(ExternalStoreItem [] items) { List <ExternalStoreItem> tempItems = _items; _items = new List <ExternalStoreItem>(); foreach (ExternalStoreItem item in items) { ExternalStoreItem existingItem = Exists(tempItems, item); if (existingItem == null) { // doesn't exist so add it to the new list _items.Add(item); } else { // already exists -- add already existing item to the new list _items.Add(existingItem); } } }
public void Add(ExternalStoreItem item) { _items.Add(item); }
public ExternalStoreItem Exists(ExternalStoreItem item) { return(Exists(_items, item)); }