Example #1
0
 public override void OnItemSelected(int itemIndex)
 {
     FieldDropdownMenu[] menu = GetOptions();
     string id = menu[itemIndex].Value;
     if (id.Equals(MsgDefine.RENAME_VARIABLE))
     {
         // wait for UI
         return;
     }
     if (id.Equals(MsgDefine.DELETE_VARIABLE))
     {
         // wait for UI
         return;
     }
     
     if (SourceBlock != null && SourceBlock.Workspace != null)
     {
         Workspace workspace = SourceBlock.Workspace;
         var variable = workspace.GetVariableById(id);
         if (variable != null)
         {
             string text = this.CallValidator(variable.Name);
             if (!string.IsNullOrEmpty(text) && !text.Equals(mText))
                 SetValue(text);
         }
     }
 }