private void Add(Desktop desktop) { Desktops.Add(desktop); if (DesktopsByName.ContainsKey(desktop.Id)) { Desktops.Remove(DesktopsByName[desktop.Id]); } DesktopsByName[desktop.Id] = desktop; }
public Task <IDesktop> GetById(string id) { IDesktop desktop = null; if (DesktopsByName.ContainsKey(id)) { desktop = DesktopsByName[id]; } return(Task.FromResult(desktop)); }