Inheritance: Catrobat.IDE.Core.Models.CatrobatModels.CatrobatModelBase, ISelectable
 public static void CleanUpVariableReferences(Variable deletedUserVariable, Sprite selectedSprite)
 {
     foreach (var script in selectedSprite.Scripts)
     {
         foreach (var brick in script.Bricks)
         {
             if (brick is VariableBrick)
             {
                 var setVariableBrick = brick as VariableBrick;
                 if (ReferenceEquals(setVariableBrick.Variable, deletedUserVariable))
                     setVariableBrick.Variable = null;
             }
         }
     }
 }
 public static bool VariableNameExistsCheckSelf(Program project, Sprite sprite, Variable self, string variableName)
 {
     return project.GlobalVariables.Concat<Variable>(sprite.LocalVariables)
         .Any(variable => !ReferenceEquals(variable, self) && variable.Name == variableName);
 }
 public static bool IsVariableLocal(Program project, Variable variable)
 {
     return variable is LocalVariable;
 }
示例#4
0
 protected bool TestEquals(Variable other)
 {
     return string.Equals(_name, other._name);
 }