private static string GetIfLogicEndBrickReferenceString(XmlIfLogicEndBrickReference ifLogicEndBrickReference)
        {
            var ifLogicEndBrick = ifLogicEndBrickReference.IfLogicEndBrick;

            var sprite = XmlParserTempProjectHelper.Sprite;

            foreach (var script in sprite.Scripts.Scripts)
            {
                var count = 0;
                foreach (var brick in script.Bricks.Bricks)
                {
                    if (brick is XmlIfLogicEndBrick)
                    {
                        count++;
                        if ((brick == ifLogicEndBrick) && (count == 1))
                        {
                            return("../../ifLogicEndBrick");
                        }
                        else if (brick == ifLogicEndBrick)
                        {
                            return("../../ifLogicEndBrick[" + count + "]");
                        }
                    }
                }
            }
            return("");
        }
        private static XmlObjectNode GetIfLogicEndBrickObject(XmlIfLogicEndBrickReference ifLogicEndBrickReference, string reference)
        {
            bool found            = false;
            var  ifLogicEndBricks = new List <XmlBrick>();

            var sprite = XmlParserTempProjectHelper.Sprite;

            var script = XmlParserTempProjectHelper.Script;

            foreach (var brick in script.Bricks.Bricks)
            {
                if (brick is XmlIfLogicBeginBrick)
                {
                    var ifLogicBeginBrick = brick as XmlIfLogicBeginBrick;
                    if (ifLogicBeginBrick.IfLogicEndBrickReference == ifLogicEndBrickReference)
                    {
                        found = true;
                    }
                }
                if (brick is XmlIfLogicElseBrick)
                {
                    var ifLogicElseBrick = brick as XmlIfLogicElseBrick;
                    if (ifLogicElseBrick.IfLogicEndBrickReference == ifLogicEndBrickReference)
                    {
                        found = true;
                    }
                }
                if (brick is XmlIfLogicEndBrick)
                {
                    ifLogicEndBricks.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(ifLogicEndBricks[count]);
            }

            return(null);
        }