private static XmlObjectNode GetIfLogicBeginBrickObject(XmlIfLogicBeginBrickReference ifLogicBeginBrickReference, string reference)
        {
            bool found = false;
            var ifLogicBeginBricks = new List<XmlBrick>();

            var sprite = XmlParserTempProjectHelper.Sprite;

                var script = XmlParserTempProjectHelper.Script;
                    foreach (var brick in script.Bricks.Bricks)
                    {
                        if (brick is XmlIfLogicElseBrick)
                        {
                            var ifLogicElseBrick = brick as XmlIfLogicElseBrick;
                            if (ifLogicElseBrick.IfLogicBeginBrickReference == ifLogicBeginBrickReference)
                                found = true;
                        }
                        if (brick is XmlIfLogicEndBrick)
                        {
                            var ifLogicEndBrick = brick as XmlIfLogicEndBrick;
                            if (ifLogicEndBrick.IfLogicBeginBrickReference == ifLogicBeginBrickReference)
                                found = true;
                        }
                        if (brick is XmlIfLogicBeginBrick)
                            ifLogicBeginBricks.Add(brick);
                    }
                    if (found)
                    {
                        var count = 0;
                        if (reference.EndsWith("]"))
                        {
                            var splittetReference = reference.Split('[');
                            reference = reference.Split('[')[splittetReference.Count() - 1];
                            reference = reference.Split(']')[0];
                            count = Int32.Parse(reference) - 1;
                        }
                        return ifLogicBeginBricks[count];
                    }
                
            return null;
        }
        private static string GetIfLogicBeginBrickReferenceString(XmlIfLogicBeginBrickReference ifLogicBeginBrickReference)
        {
            var ifLogicBeginBrick = ifLogicBeginBrickReference.IfLogicBeginBrick;

            var sprite = XmlParserTempProjectHelper.Sprite;

            var script = XmlParserTempProjectHelper.Script;

                var count = 0;
                foreach (var brick in script.Bricks.Bricks)
                    if (brick is XmlIfLogicBeginBrick)
                    {
                        count++;
                        if ((brick == ifLogicBeginBrick) && (count == 1))
                            return "../../ifLogicBeginBrick";
                        else if (brick == ifLogicBeginBrick)
                            return "../../ifLogicBeginBrick[" + count + "]";
                    }
            
            return "";
        }