Example #1
0
        private void addRemoveCollection(int from, int to)
        {
            DiskInfo tempdiskInfo = new DiskInfo();

            // tempdiskInfo = null;
            if (from.Equals(1))
            {
                tempdiskInfo = DiskFirstRow.LastOrDefault();
            }
            else if (from.Equals(2))
            {
                tempdiskInfo = DiskSecondRow.LastOrDefault();
            }
            else
            {
                tempdiskInfo = DiskThirdRow.LastOrDefault();
            }

            if (to.Equals(1))
            {
                DiskFirstRow.Add(tempdiskInfo);
            }
            else if (to.Equals(2))
            {
                DiskSecondRow.Add(tempdiskInfo);
            }
            else
            {
                DiskThirdRow.Add(tempdiskInfo);
            }

            if (from.Equals(1))
            {
                DiskFirstRow.Remove(tempdiskInfo);
            }
            else if (from.Equals(2))
            {
                DiskSecondRow.Remove(tempdiskInfo);
            }
            else
            {
                DiskThirdRow.Remove(tempdiskInfo);
            }
            this.textMovement.Text = (++diskMovment).ToString();
        }
Example #2
0
        private void addRemoveCollection(int from, int to)
        {
            DiskInfo tempdiskInfo = new DiskInfo();
               // tempdiskInfo = null;
            if (from.Equals(1))
            {
                tempdiskInfo = DiskFirstRow.LastOrDefault();
            }
            else if(from.Equals(2))
            {
                tempdiskInfo=DiskSecondRow.LastOrDefault();
            }
            else
            {
                tempdiskInfo = DiskThirdRow.LastOrDefault();
            }

            if (to.Equals(1))
            {
                 DiskFirstRow.Add(tempdiskInfo);
            }
            else if(to.Equals(2))
            {
                DiskSecondRow.Add(tempdiskInfo);
            }
            else
            {
                DiskThirdRow.Add(tempdiskInfo);
            }

            if (from.Equals(1))
            {
                DiskFirstRow.Remove(tempdiskInfo);
            }
            else if (from.Equals(2))
            {
               DiskSecondRow.Remove(tempdiskInfo);
            }
            else
            {
                DiskThirdRow.Remove(tempdiskInfo);
            }
            this.textMovement.Text = (++diskMovment).ToString();
        }