private void currentEditorTabChanged(object sender, EditorTabChangedEventArgs e) { try { ContextContacts.Clear(); WorkspaceRecordType?workspaceType = null; if (RightNowGlobalContext.AutomationContext.CurrentWorkspace != null) { workspaceType = RightNowGlobalContext.AutomationContext.CurrentWorkspace.WorkspaceType; } if (CurrentInteraction != null && workspaceType != null) { CanAssociateToRecord = workspaceType.Value == WorkspaceRecordType.Contact || workspaceType.Value == WorkspaceRecordType.Incident; } else { CanAssociateToRecord = false; } if (workspaceType != null && workspaceType.Value == WorkspaceRecordType.Contact) { var contact = RightNowGlobalContext.AutomationContext.CurrentWorkspace.GetWorkspaceRecord(WorkspaceRecordType.Contact) as IContact; if (contact == null) { RightNowGlobalContext.AutomationContext.CurrentWorkspace.DataLoaded += currentWorkspaceDataLoaded; contact = RightNowGlobalContext.AutomationContext.CurrentWorkspace.GetWorkspaceRecord(WorkspaceRecordType.Contact) as IContact; if (contact != null) { RightNowGlobalContext.AutomationContext.CurrentWorkspace.DataLoaded -= currentWorkspaceDataLoaded; loadContextNumbers(contact); } } else { loadContextNumbers(contact); } } } catch (Exception ex) { Logger.Logger.Log.Error("Error on currentEditorTabChanged :", ex); } }
void AutomationContext_CurrentEditorTabChanged(object sender, EditorTabChangedEventArgs e) { _Model.Render(false); }