Exemplo n.º 1
0
        public TFlag AddFlag(TFlagShape AFlag, TBaseShape AShape, TRectLine ALine,
                             int APosition, ref bool AFlagExits)
        {
            TFlag     Member;
            TBaseLine MLine;
            int       APos;

            AFlagExits = true;
            for (int i = List.Count - 1; i >= 0; i--)
            {
                Member = (TFlag)(List.ElementAt(i));
                if (Member.Flag == AFlag)
                {
                    return(Member);
                }
            }
            Member          = new TFlag();
            Member.Position = APosition;
            Member.Shape    = AShape;
            Member.Line     = ALine;
            Member.Flag     = AFlag;
            List.Add(Member);
            AFlagExits = false;
            return(Member);
        }
Exemplo n.º 2
0
        void FlagDestroy(TRectLine ASender, TFlagShape AFlag, int APosFlag)
        {
            TFlag Flag = ListFlag.DeleteFlagByShape(AFlag);

            if (Flag != null && FOnWSFlagDestroy != null)
            {
                OnWSFlagDestroy(Flag, this);
            }
        }
Exemplo n.º 3
0
        TFlag GetItem(int AIndex)
        {
            TFlag res = null;

            if ((AIndex >= 0) && (AIndex <= List.Count - 1))
            {
                res = (TFlag)List.ElementAt(AIndex);
            }
            return(res);
        }
Exemplo n.º 4
0
        /*          void DoSetFlag();
         *        void DoSetFlagS();
         *        void DoSetFlagE();*/
        void FlagCreate(TRectLine ASender, TFlagShape AFlag, int APosFlag)
        {
            bool       res   = false;
            TBaseShape Shape = GetShapeByLine(ASender, APosFlag);
            TFlag      Flag  = ListFlag.AddFlag(AFlag, Shape, ASender, APosFlag, ref res);

            if (!res && FOnWSFlagCreate != null)
            {
                OnWSFlagCreate(Flag, this);
            }
        }
Exemplo n.º 5
0
        public TFlag DeleteFlagByShape(TFlagShape AFlag)
        {
            TFlag Member, Res = null;

            for (int i = List.Count - 1; i >= 0; i--)
            {
                Member = (TFlag)(List.ElementAt(i));
                if (Member.Flag == AFlag)
                {
                    List.RemoveAt(i);
                }
            }
            return(Res);
        }