public void Update([NotNull] IWorkItem item) { TState state = Lookup(item); if (state == null) { // todo daro: revise // create new state if it doesn't exist state = CreateState(item); _states.Add(state); } GdbTableIdentity table = item.Proxy.Table; GdbWorkspaceIdentity workspace = table.Workspace; if (_workspaces.TryGetValue(workspace, out SimpleSet <GdbTableIdentity> tables)) { tables.TryAdd(table); } else { _workspaces.Add(workspace, new SimpleSet <GdbTableIdentity> { table }); } state.Visited = item.Visited; UpdateCore(state, item); }
private static void Populate( Dictionary <GdbWorkspaceIdentity, SimpleSet <GdbTableIdentity> > tablesByWorkspace, ICollection <XmlWorkListWorkspace> list) { foreach (KeyValuePair <GdbWorkspaceIdentity, SimpleSet <GdbTableIdentity> > pair in tablesByWorkspace) { GdbWorkspaceIdentity workspace = pair.Key; SimpleSet <GdbTableIdentity> tables = pair.Value; var xmlWorkspace = new XmlWorkListWorkspace(); xmlWorkspace.Path = workspace.Path; xmlWorkspace.Tables = tables .Select(table => new XmlTableReference(table.Id, table.Name)) .ToList(); list.Add(xmlWorkspace); } }
// todo daro: only pass in the connector as parameter to avoid "called // on wrong thread" exception? public WorkspaceContext(GdbWorkspaceIdentity workspace) : base(workspace) { }
protected WorkspaceContextBase(GdbWorkspaceIdentity workspace) { Workspace = workspace; }