Esempio n. 1
0
        public void CloneTest()
        {
            var original = new EventType("T", _Behaviour, _Behaviour, _Event);
            var clone    = original.Clone();

            Assert.IsFalse(ReferenceEquals(original, clone));
            Assert.AreEqual(original, clone);
        }
Esempio n. 2
0
        protected override bool RenameResult(ref object data, string newName)
        {
            try
            {
                EventType eventType = data as EventType;
                if (eventType != null)
                {
                    // Create the new event group.

                    EventType newEventType = eventType.Clone(m_catalogue, newName);
                    m_catalogue.Replace(eventType, newEventType);
                    m_catalogue.Commit();
                    data = newEventType;
                    return(true);
                }

                return(false);
            }
            catch (System.Exception e)
            {
                new ExceptionDialog(e, "Cannot rename the element to '" + newName + "'.").ShowDialog();
                return(false);
            }
        }