private void var_NameChanged(object sender, string name, string oldName) { // this.Text = UI.GetVariableName(this.var, UnitSystemService.GetInstance().CurrentUnitSystem); string unitName; this.Clear(); this.SelectedText = this.var.VarTypeName; unitName = UI.GetUnitName(this.var, UnitSystemService.GetInstance().CurrentUnitSystem); if (unitName != null) { this.SelectionCharOffset = UI.SUB_CHAR_OFFSET; //superscript this.SelectedText = (" (" + unitName + ")"); } }
private void ProcessVarLabel_CurrentUnitSystemChanged(UnitSystem unitSystem) { // this.Text = UI.GetVariableName(this.var, unitSystem); string unitName; this.Clear(); this.SelectedText = var.VarTypeName; unitName = UI.GetUnitName(this.var, unitSystem); if (unitName != null) { this.SelectionCharOffset = UI.SUB_CHAR_OFFSET; //superscript this.SelectedText = (" (" + unitName + ")"); // this.AppendText(unitName); } }
public void InitializeVariable(ProcessVar var) { string unitName; this.var = var; this.Clear(); this.SelectedText = var.VarTypeName; unitName = UI.GetUnitName(this.var, UnitSystemService.GetInstance().CurrentUnitSystem); if (unitName != null) { this.SelectionCharOffset = UI.SUB_CHAR_OFFSET; //superscript this.SelectedText = (" (" + unitName + ")"); //this.AppendText(" (" + unitName + ")"); } // this.Text = UI.GetVariableName(this.var, UnitSystemService.GetInstance().CurrentUnitSystem); this.var.NameChanged += new NameChangedEventHandler(var_NameChanged); UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(ProcessVarLabel_CurrentUnitSystemChanged); }