예제 #1
0
        void packageVM_IsCheckedChanged(object sender, System.EventArgs e)
        {
            var packageVM        = (PackageViewModel)sender;
            var packageReference = new TraceLab.Core.PackageSystem.PackageReference(packageVM.Package);

            if (!packageVM.IsChecked)
            {
                PackagesViewModelHelper.RemoveReference(m_experiment, packageReference);
            }
            else if (packageVM.IsChecked && !m_experiment.References.Contains(packageReference))
            {
                PackagesViewModelHelper.AddReference(m_experiment, packageReference);
            }
        }
예제 #2
0
        private void HandleToggled(object o, ToggledArgs args)
        {
            TreeIter iter;

            if (m_treeStore.GetIter(out iter, new TreePath(args.Path)))
            {
                PackageReferenceNode node = (PackageReferenceNode)m_treeStore.GetValue(iter, 0);
                node.State = !node.State;

                var packageReference = new TraceLab.Core.PackageSystem.PackageReference(node.Package);

                if (node.State == false)
                {
                    PackagesViewModelHelper.RemoveReference(m_experiment, packageReference);
                }
                else if (node.State && !m_experiment.References.Contains(packageReference))
                {
                    PackagesViewModelHelper.AddReference(m_experiment, packageReference);
                }
            }
        }