Exemplo n.º 1
0
        public static void AddReference(IExperiment experiment, PackageReference packageReference)
        {
            if (!experiment.References.Contains(packageReference))
            {
                experiment.References.Add(packageReference);

                AddReferenceToScopes(experiment, packageReference);
            }
        }
Exemplo n.º 2
0
        public static void RemoveReference(IExperiment experiment, PackageReference packageReference)
        {
            if (experiment.References.Contains(packageReference))
            {
                experiment.References.Remove(packageReference);

                RemoveReferenceFromScopes(experiment, packageReference);
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
0
        public override bool Equals(object obj)
        {
            bool             equals = false;
            PackageReference other  = obj as PackageReference;

            if (other != null)
            {
                if (string.Equals(ID, other.ID, StringComparison.InvariantCultureIgnoreCase))
                {
                    equals = string.Equals(Name, other.Name, StringComparison.InvariantCultureIgnoreCase);
                }
            }

            return(equals);
        }
Exemplo n.º 6
0
 private static void AddReferenceToScopes(IExperiment experiment, PackageReference packageReference)
 {
     foreach (ExperimentNode node in experiment.Vertices)
     {
         ScopeNodeBase scopeNode = node as ScopeNodeBase;
         if (scopeNode != null)
         {
             var subgraph = scopeNode.CompositeComponentMetadata.ComponentGraph;
             if (!subgraph.References.Contains(packageReference))
             {
                 subgraph.References.Add(packageReference);
             }
         }
     }
 }
Exemplo n.º 7
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);
                }
            }
        }
Exemplo n.º 8
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);
                }
            }
        }