コード例 #1
0
        private void CopyInstanceExecute(object obj)
        {
            var cls = ClassesCollectionView.CurrentItem as NdfClassViewModel;

            if (cls == null)
            {
                return;
            }

            var inst = cls.InstancesCollectionView.CurrentItem as NdfObjectViewModel;

            if (inst == null)
            {
                return;
            }

            if (!inst.Object.IsTopObject)
            {
                MessageBox.Show("You can only create a copy of an top object.", "Information", MessageBoxButton.OK);
                return;
            }

            _copyInstanceResults = new List <NdfObject>();

            CopyInstance(inst.Object);

            var resultViewModel = new ObjectCopyResultViewModel(_copyInstanceResults, this);

            DialogProvider.ProvideView(resultViewModel, this);
        }
コード例 #2
0
        private void CopyInstanceExecute(object obj)
        {
            var cls = ClassesCollectionView.CurrentItem as NdfClassViewModel;

            if (cls == null)
                return;

            var inst = cls.InstancesCollectionView.CurrentItem as NdfObjectViewModel;

            if (inst == null)
                return;

            if (!inst.Object.IsTopObject)
            {
                MessageBox.Show("You can only create a copy of an top object.", "Information", MessageBoxButton.OK);
                return;
            }

            _copyInstanceResults = new List<NdfObject>();

            CopyInstance(inst.Object);

            var resultViewModel = new ObjectCopyResultViewModel(_copyInstanceResults, this);
            DialogProvider.ProvideView(resultViewModel, this);
        }