protected static void ResetItems(OpenResourceManager omgr, IEnumerable<RepositoryItem> rs, ServerConnectionManager connMgr) { foreach (var ri in rs) { var conn = connMgr.GetConnection(ri.ConnectionName); ResetItem(omgr, ri, conn); } }
public OpenResourceIdDialog(ServerConnectionManager connMgr) : this() { var items = new List<KeyValuePair<string, IServerConnection>>(); foreach (var name in connMgr.GetConnectionNames()) { items.Add(new KeyValuePair<string, IServerConnection>(name, connMgr.GetConnection(name))); } cmbConnection.DisplayMember = "Key"; //NOXLATE cmbConnection.DataSource = items; cmbConnection.SelectedIndex = 0; }
private static new void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr) { //Reset state of clipboarded items if (clip.HasContent()) { object o = clip.Get(); var r = o as RepositoryItem; var rs = o as RepositoryItem[]; if (r != null) { var conn = connMgr.GetConnection(r.ConnectionName); r.Reset(); if (omgr.IsOpen(r.ResourceId, conn)) { r.IsOpen = true; var ed = omgr.GetOpenEditor(r.ResourceId, conn); if (ed.IsDirty) r.IsDirty = true; } } else if (rs != null) { foreach (var ri in rs) { var conn = connMgr.GetConnection(ri.ConnectionName); ri.Reset(); if (omgr.IsOpen(ri.ResourceId, conn)) { ri.IsOpen = true; var ed = omgr.GetOpenEditor(ri.ResourceId, conn); if (ed.IsDirty) ri.IsDirty = true; } } } } }
protected static void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr) { //Reset state of clipboarded items if (clip.HasContent()) { object o = clip.Get(); var r = o as RepositoryItem; var rs = o as RepositoryItem[]; if (r != null) { var conn = connMgr.GetConnection(r.ConnectionName); ResetItem(omgr, r, conn); } else if (rs != null) { ResetItems(omgr, rs, connMgr); } } }
private Maestro.Editors.RepositoryHandle[] CollectDependentResources(RepositoryItem[] items, ServerConnectionManager connMgr) { var ids = new List<Maestro.Editors.RepositoryHandle>(); foreach (var it in items) { var conn = connMgr.GetConnection(it.ConnectionName); if (it.IsFolder) { ids.Add(new Editors.RepositoryHandle(new ResourceIdentifier(it.ResourceId), conn)); break; } try { var references = conn.ResourceService.EnumerateResourceReferences(it.ResourceId); ids.AddRange(references.ResourceId.Select(x => new Maestro.Editors.RepositoryHandle(new ResourceIdentifier(x), conn))); } catch //Back-referencing may not be supported { } } return ids.ToArray(); }