Exemplo n.º 1
0
        internal ProjectAdapter(Project target, bool isNewProject)
        {
            Target             = target;
            OutputInformation  = new MonitoredCollection <ProjectOutputAdapter>();
            ActualDependants   = new MonitoredCollection <ProjectAdapter>();
            ActualDependencies = new MonitoredCollection <ProjectAdapter>();

            if (isNewProject && Target.Outputs.Count == 0)
            {
                Target.Outputs.Add(new Output());
            }

            foreach (var pOut in Target.Outputs)
            {
                OutputInformation.Add(new ProjectOutputAdapter(pOut));
            }

            IsDirty = false;

            OutputInformation.ListChanged       += OutputInformation_ListChanged;
            ActualDependants.BeforeRemoveItem   += ActualDependants_BeforeRemoveItem;
            ActualDependants.ListChanged        += ActualDependants_CollectionChanged;
            ActualDependencies.BeforeRemoveItem += ActualDependencies_BeforeRemoveItem;
            ActualDependencies.ListChanged      += ActualDependencies_CollectionChanged;
        }
Exemplo n.º 2
0
        public MonitoredCollection <ProjectAdapter> FilterProjects(string text)
        {
            var lst = new MonitoredCollection <ProjectAdapter>();

            lock (this)
                foreach (var p in Projects)
                {
                    if (p.Name.ToLower().Contains(text.ToLower()))
                    {
                        lst.Add(p);
                    }
                }
            return(lst);
        }
Exemplo n.º 3
0
        public MonitoredCollection <ProjectAdapter> FilterDuplicateProjects()
        {
            var lst = new MonitoredCollection <ProjectAdapter>();

            lock (this)
                foreach (var keyVal in _hash)
                {
                    if (keyVal.Value.Count > 1)
                    {
                        foreach (var val in keyVal.Value)
                        {
                            lst.Add(val);
                        }
                    }
                }

            return(lst);
        }