/// ------------------------------------------------------------------------------------ /// <summary> /// Sets the current sidebar tab. /// Updates what sidebar buttons will be visible, and makes tab visually look selected. /// </summary> /// <param name="tabName"></param> /// <param name="generateEvents"><c>true</c> to cause events to be fired when setting /// the current sidebar tab (like when the user clicks on an item). Otherwise, /// <c>false</c>.</param> /// ------------------------------------------------------------------------------------ public void SetCurrentTab(string tabName, bool generateEvents) { Tab tab = m_sidePane.GetTabByName(tabName); m_sidePane.SelectTab(tab); m_currentlySelectedTabName = tabName; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Sets the current sidebar tab. /// Updates what sidebar buttons will be visible, and makes tab visually look selected. /// </summary> /// <param name="tabName"></param> /// <param name="generateEvents"><c>true</c> to cause events to be fired when setting /// the current sidebar tab (like when the user clicks on an item). Otherwise, /// <c>false</c>.</param> /// ------------------------------------------------------------------------------------ public void SetCurrentTab(string tabName, bool generateEvents) { m_supressAutoEvent = !generateEvents; Tab tab = m_sidePane.GetTabByName(tabName); m_sidePane.SelectTab(tab); m_supressAutoEvent = false; }
/// <summary> /// When something changes the property areaChoice (via something like a menubar), /// this ensures that the matching button is highlighted. /// This also handles getting the tool right when the area (or the tool) changes. /// </summary> public void OnPropertyChanged(string propertyName) { switch (propertyName) { case "areaChoice": string areaName = m_mediator.PropertyTable.GetStringProperty("areaChoice", null); foreach (ChoiceGroup group in m_choiceGroupCollectionCache) { foreach (ListPropertyChoice choice in group) // group must already be populated { if (choice.Value == areaName) { string listId = GetListIdFromListPropertyChoice(choice); var tab = m_sidepane.GetTabByName(listId); if (tab != null) { // We need to explicitly set the tool if we can, since the sidepane will // choose the first tool if one has never been chosen, and end up // overwriting the property table value. See FWR-2004. string propToolForArea = "ToolForAreaNamed_" + areaName; string toolForArea = m_mediator.PropertyTable.GetStringProperty(propToolForArea, null); m_sidepane.SelectTab(tab); // FWR-2895 Deleting a Custom list could result in needing to // update the PropertyTable. if (!String.IsNullOrEmpty(toolForArea) && !toolForArea.StartsWith("?")) { var fsuccess = m_sidepane.SelectItem(tab, toolForArea); if (!fsuccess) { m_mediator.PropertyTable.SetProperty(propToolForArea, null); } } } break; } } } break; default: // This helps fix FWR-2004. if (propertyName.StartsWith("ToolForAreaNamed_")) { string areaChoice = m_mediator.PropertyTable.GetStringProperty("areaChoice", null); string propToolForArea = "ToolForAreaNamed_" + areaChoice; if (propertyName == propToolForArea) { string toolForArea = m_mediator.PropertyTable.GetStringProperty(propertyName, null); SetToolForCurrentArea(toolForArea); } } break; } }