CellsAutomate.Mutator.Mutations.DeleteCommandMutation.IsInitializeSetter C# (CSharp) Method

IsInitializeSetter() private method

private IsInitializeSetter ( ICommandSetter comToDel, int index ) : bool
comToDel ICommandSetter
index int
return bool
        private bool IsInitializeSetter(ICommandSetter comToDel, int index)
        {
            for (int i = index - 1; i >= 0; i--)
            {
                if (_marks[i]) continue;

                if (_commands[i] is ICommandSetter)
                {
                    if ((_commands[i] as ICommandSetter).TargetName == comToDel.TargetName)
                        return false;
                }
                if (_commands[i] is ICommandDeclaration)
                {
                    if ((_commands[i] as ICommandDeclaration).Name == comToDel.TargetName)
                        return true;
                }
            }
            return true;
        }