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;
             }
         }
     }
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public static bool IsVariableLocal(Program project, Variable variable)
 {
     return variable is LocalVariable;
 }
Ejemplo n.º 4
0
 protected bool TestEquals(Variable other)
 {
     return string.Equals(_name, other._name);
 }