Exemplo n.º 1
0
        public void AddRecent(CompareDefinition cd)
        {
            if (Recent != null)
            {
                for (int i = 0; i < Recent.Length; i++)
                {
                    if (Recent[i].GetKey() == cd.GetKey())
                    {
                        MoveToTop(Recent[i]);
                        return;
                    }
                }
            }

            if (Recent == null || Recent.Length < 15)
            {
                CompareDefinition [] copy = new CompareDefinition [Recent == null ? 1 : Recent.Length + 1];
                copy [0] = cd;
                if (Recent != null)
                {
                    Recent.CopyTo(copy, 1);
                }
                Recent = copy;
            }
            else
            {
                Array.Copy(Recent, 0, Recent, 1, Recent.Length - 1);
                Recent[0] = cd;
            }
        }
Exemplo n.º 2
0
        public void AddRecent(CompareDefinition cd)
        {
            if (Recent != null) {
                for (int i = 0; i < Recent.Length; i ++) {
                    if (Recent[i].GetKey() == cd.GetKey()) {
                        MoveToTop (Recent[i]);
                        return;
                    }
                }
            }

            if (Recent == null || Recent.Length < 15){
                CompareDefinition [] copy = new CompareDefinition [Recent == null ? 1 : Recent.Length+1];
                copy [0] = cd;
                if (Recent != null)
                    Recent.CopyTo (copy, 1);
                Recent = copy;
            } else {
                Array.Copy (Recent, 0, Recent, 1, Recent.Length - 1);
                Recent[0] = cd;
            }
        }