private void OnEnable() { _graph = UnityUtility.FindParent <Graph>(this); _label = GetComponent <GraphLabel>(); _colorAnimation.Init(new Color32(255, 255, 255, 255)); _colorAnimation.Finished += ApplyColor; }
/// <summary> /// Default constructor /// </summary> /// <param name="label">Object label</param> /// <param name="lab">Graph label</param> public FormExternalChart(IObjectLabel label, GraphLabel lab) : this() { this.label = label; this.lab = lab; UpdateFormUI(); consumer = label.Object as DataConsumer; }
/// <summary> /// Responsible for ensuring that the application is returned to the /// state that the user last left it. The PreferenceManager is /// responsible for loading the preferences that were previously /// saved. If no preference is found, a default is applied. /// </summary> private void ApplyPreferences() { IsToolbarHidden = ConfigurationManager.Instance.CurrentConfig.IsToolbarHidden; IsToolPanelHidden = ConfigurationManager.Instance.CurrentConfig.IsToolPanelHidden; if (!IsToolPanelHidden) { IsSidebarCollapsed = bool.Parse(PreferencesManager.Instance.GetPreference((typeof(MainViewModel)).ToString() + "_SideBarCollapsed", PREFERENCE_DEFAULT_SIDEBAR_COLLAPSED)); SideBarWidth = PreferencesManager.Instance.GetPreference((typeof(MainViewModel)).ToString() + "_SideBarWidth", PREFERENCE_DEFAULT_SIDEBAR_WIDTH).ToGridLength(); } // Perform a little configuration here as well GraphLabel graphLabel = ConfigurationManager.Instance.CurrentConfig.GraphLabel; // Check if settings were provided for the graph label if (graphLabel == null) { IsGraphLabelEnabled = false; } else { // Set Background if (!String.IsNullOrWhiteSpace(graphLabel.Background)) { GraphLabelBackground = Conversion.HexColorToBrush(graphLabel.Background); } else { GraphLabelBackground = new SolidColorBrush(Colors.Green); } // Set Foreground if (!String.IsNullOrWhiteSpace(graphLabel.Foreground)) { GraphLabelForeground = Conversion.HexColorToBrush(graphLabel.Foreground); } else { GraphLabelBackground = new SolidColorBrush(Colors.White); } // Set Text if (!String.IsNullOrWhiteSpace(graphLabel.Text)) { GraphLabelText = graphLabel.Text; } else { GraphLabelText = "UNCLASSIFIED"; } IsGraphLabelEnabled = true; } }