Пример #1
0
        // PUBLIC METHODS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        // public PickElements method ----------------------------

        public void PickElements()
        {
            //checking if list is not empty
            if (ElementList.Count > 0)
            {
                //then clear method is called by both the lists
                ElementList.Clear();
                NumberList.Clear();
            }
            //m_build is called to rebuilt the NumberList
            m_build();

            m_random rn = new Random();

            //loop is created to generate random numbers
            for (int randomNumber = 1; randomNumber <= elementNumber; randomNumber++)
            {
                // it will select element from ElementList
                int number = rn.Next(1, ElementList.Count);
                //Remove the selected element from ElementList
                ElementList.Remove(number);
                //Add the element in NumberList
                NumberList.Add(number);
            }
        }
Пример #2
0
        public void Handle(UserRemovedEvent message)
        {
            var viewmodel = (from vm in ElementList where vm.Id == message.Id select vm).FirstOrDefault();

            if (viewmodel != null)
            {
                ElementList.Remove(viewmodel);
            }
        }
Пример #3
0
        internal void RemoveElement(Element element)
        {
            try
            {
                if (m_MouseDragElement == element)
                {
                    releaseMouseDragElement(null);
                }

                if (m_MouseEnteredElement == element)
                {
                    releaseMouseEnteredElement();
                }
            }
            finally
            {
                m_LastMouseDownElement = null;

                m_ElementList.Remove(element);

                Invalidate(element.Region);
            }
        }