Beispiel #1
0
        public override bool OnApplyChanges()
        {
            DepsInfoRTB.Clear();
            Lib.Dependencies.Clear();
            foreach (ListViewItem item in DepsListView.Items)
            {
                if (item.Text == ComponentTypeWrapper.Library.ToString())
                {
                    LibraryWrapper l = PK.Wrapper.FindLibraryByName(item.SubItems[1].Text);
                    if (l != null)
                    {
                        Lib.Dependencies.Add(ComponentWrapper.GetComponentWrapper(l));
                    }
                }

                if (item.Text == ComponentTypeWrapper.LibraryCategory.ToString())
                {
                    LibraryCategoryWrapper lc = PK.Wrapper.FindLibraryCategoryByName(item.SubItems[1].Text);
                    if (lc != null)
                    {
                        Lib.Dependencies.Add(ComponentWrapper.GetComponentWrapper(lc));
                    }
                }
            }

            return(true);
        }
Beispiel #2
0
        private void DepsListView_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (DepsListView.SelectedItems.Count != 0)
            {
                if (DepsListView.SelectedItems[0] != null)
                {
                    if (DepsListView.Items[DepsListView.SelectedIndices[0]].SubItems[0].Text == ComponentTypeWrapper.Library.ToString())
                    {
                        LibraryWrapper l = PK.Wrapper.FindLibraryByName(DepsListView.Items[DepsListView.SelectedIndices[0]].SubItems[1].Text);
                        if (l != null)
                        {
                            this.ShowDependencyDescription(ComponentWrapper.GetComponentWrapper(l));
                        }
                    }

                    if (DepsListView.Items[DepsListView.SelectedIndices[0]].SubItems[0].Text == ComponentTypeWrapper.LibraryCategory.ToString())
                    {
                        LibraryCategoryWrapper lc = PK.Wrapper.FindLibraryCategoryByName(DepsListView.Items[DepsListView.SelectedIndices[0]].SubItems[1].Text);
                        if (lc != null)
                        {
                            this.ShowDependencyDescription(ComponentWrapper.GetComponentWrapper(lc));
                        }
                    }
                }
                else
                {
                    DepsInfoRTB.Clear();
                }
            }
            else
            {
                DepsInfoRTB.Clear();
            }
        }
Beispiel #3
0
        public static InventoryBrowserModel GetComponentNodeModel <T>(Array components) where T : BaseWrapper
        {
            InventoryBrowserModel model = new InventoryBrowserModel();

            foreach (T component in components)
            {
                model.Roots.Add(new ComponentNode(ComponentWrapper.GetComponentWrapper(component), null));
            }
            return(model);
        }
Beispiel #4
0
        /// <summary>
        /// Ru: Сохраняет список открытых для редактирования форм
        /// En: Saves edit forms list to file
        /// </summary>
        public void SaveEditorsFormsState()
        {
            PKStudio.Helpers.OpenedDocumentsList modlist = new Helpers.OpenedDocumentsList();

            foreach (DockContent item in DockPanel.Contents)
            {
                if (item.GetType() == typeof(PKStudio.Forms.Editors.SourceFileEditor))
                {
                    PKStudio.Forms.Editors.SourceFileEditor file = (PKStudio.Forms.Editors.SourceFileEditor)item;
                    modlist.Files.Add(file.EditingFilePath);
                }
                else if (item.GetType() == typeof(PKStudio.Forms.Editors.LibraryCategoryEditor))
                {
                    PKStudio.Forms.Editors.LibraryCategoryEditor editor = (PKStudio.Forms.Editors.LibraryCategoryEditor)item;
                    modlist.Components.Add(ComponentWrapper.GetComponentWrapper(editor.LibraryCategory));
                }
                else if (item.GetType() == typeof(PKStudio.Forms.Editors.LibraryEditor))
                {
                    PKStudio.Forms.Editors.LibraryEditor editor = (PKStudio.Forms.Editors.LibraryEditor)item;
                    modlist.Components.Add(ComponentWrapper.GetComponentWrapper(editor.Library));
                }
                else if (item.GetType() == typeof(PKStudio.Forms.Editors.FeatureEditor))
                {
                    PKStudio.Forms.Editors.FeatureEditor editor = (PKStudio.Forms.Editors.FeatureEditor)item;
                    modlist.Components.Add(ComponentWrapper.GetComponentWrapper(editor.Feature));
                }
            }

            string Path = Application.StartupPath + "\\edlist.dat";

            if (File.Exists(Path))
            {
                FileInfo FI = new FileInfo(Path);

                if ((FI.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                {
                    FI.Attributes -= FileAttributes.ReadOnly;

                    modlist.Serialize(modlist, Path);
                }
                else
                {
                    modlist.Serialize(modlist, Path);
                }
            }
            else
            {
                modlist.Serialize(modlist, Path);
            }
        }
Beispiel #5
0
        protected BaseWrapper[] GetLibraries()
        {
            List <BaseWrapper> libs = new List <BaseWrapper>();

            foreach (ComponentWrapper comp in this.TypedContent.Libraries)
            {
                LibraryWrapper library = PK.Wrapper.FindLibrary(comp.Guid);
                if (library != null)
                {
                    libs.Add(ComponentWrapper.GetComponentWrapper(library));
                }
            }
            return(libs.ToArray());
        }
Beispiel #6
0
        protected BaseWrapper[] GetFeatures()
        {
            List <BaseWrapper> feats = new List <BaseWrapper>();

            foreach (ComponentWrapper comp in this.TypedContent.Features)
            {
                FeatureWrapper feat = PK.Wrapper.FindFeature(comp.Guid);
                if (feat != null)
                {
                    feats.Add(ComponentWrapper.GetComponentWrapper(feat));
                }
            }
            return(feats.ToArray());
        }
        public SolutionProjectsPage(WizardParams Params)
            : base(Params)
        {
            InitializeComponent();

            if (PK.Wrapper.GetProjectTemplates().Count == 0)
            {
                PK.Wrapper.LoadTemplateProjects();
            }

            _treeView.NodeControls.Clear();
            NodeCheckBox checkBox = _treeView.AddCheckBoxControl("Checked");

            checkBox.IsVisibleValueNeeded     += new EventHandler <NodeControlValueEventArgs>(checkBox_IsVisibleValueNeeded);
            checkBox.IsEditEnabledValueNeeded += new EventHandler <NodeControlValueEventArgs>(checkBox_IsVisibleValueNeeded);
            _treeView.AddIconControl("Icon");
            _treeView.AddTextBoxControl("Name");

            List <ComponentWrapper> nativeProjects = new List <ComponentWrapper>();
            List <ComponentWrapper> clrProjects    = new List <ComponentWrapper>();

            foreach (ProjectWrapper project in PK.Wrapper.GetProjectTemplates())
            {
                ComponentWrapper component = ComponentWrapper.GetComponentWrapper(project);
                if (project.IsClrProject)
                {
                    clrProjects.Add(component);
                }
                else
                {
                    nativeProjects.Add(component);
                }
            }

            Collection <RootNode> roots = new Collection <RootNode>();

            roots.Add(new RootNode(null, "Native Projects", nativeProjects.ToArray()));
            roots.Add(new RootNode(null, "CLR Projects", clrProjects.ToArray()));
            _treeView.SetModel(InventoryBrowserModel.GetModel(roots), true);
        }
Beispiel #8
0
        public void SetObject(object obj)
        {
            //this.obj = obj;

            if (obj != null)
            {
                ClearAllElements();

                if (obj is ComponentWrapper)
                {
                    collection.AnalyseComponent(obj as ComponentWrapper);
                }
                //else if (obj is ProcessorWrapper)
                //{
                //    //text = "Processor: " + ((Processor)obj).Name;
                //}
                //else if (obj is ProjectWrapper)
                //{
                //    //text = "MFProject: " + ((MFProject)obj).Name;
                //}
                //else if (obj is SolutionWrapper)
                //{
                //    //text = "MFSolution: " + ((MFSolution)obj).Name;
                //}
                else if (obj is LibraryCategoryWrapper)
                {
                    collection.AnalyseComponent(ComponentWrapper.GetComponentWrapper(obj as LibraryCategoryWrapper));
                }
                else if (obj is FeatureWrapper)
                {
                    collection.AnalyseComponent(ComponentWrapper.GetComponentWrapper(obj as FeatureWrapper));
                }
                else if (obj is LibraryWrapper)
                {
                    collection.AnalyseComponent(ComponentWrapper.GetComponentWrapper(obj as LibraryWrapper));
                }

                Visualize(collection);
            }
        }
        private void VerifyGUID()
        {
            this.OnMessage("Running GUIDs Verification...\r\n");
            List <ComponentWrapper> CheckList = new List <ComponentWrapper>();

            LibraryWrapper[] LWS = PK.Wrapper.GetLibraries();
            foreach (LibraryWrapper LW in LWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(LW));
            }

            FeatureWrapper[] FWS = PK.Wrapper.GetFeatures();
            foreach (FeatureWrapper FW in FWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(FW));
            }

            AssemblyWrapper[] AWS = PK.Wrapper.GetAssembies();
            foreach (AssemblyWrapper AW in AWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(AW));
            }

            ProcessorWrapper[] PWS = PK.Wrapper.GetProcessors();
            foreach (ProcessorWrapper PW in PWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(PW));
            }

            BuildToolWrapper_[] BTWS = PK.Wrapper.GetBuildTools();
            foreach (BuildToolWrapper_ BTW in BTWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(BTW));
            }

            ISAWrapper[] IWS = PK.Wrapper.GetISAs();
            foreach (ISAWrapper IW in IWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(IW));
            }

            //   case ComponentTypeWrapper.BuildParameter:

            LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories();
            foreach (LibraryCategoryWrapper LCW in LCWS)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(LCW));
            }

            if (PK.Wrapper.Solution != null)
            {
                CheckList.Add(ComponentWrapper.GetComponentWrapper(PK.Wrapper.Solution));

                foreach (ProjectWrapper PW in PK.Wrapper.Solution.Projects)
                {
                    CheckList.Add(ComponentWrapper.GetComponentWrapper(PW));
                }
            }


            foreach (ComponentWrapper w1 in CheckList)
            {
                foreach (ComponentWrapper w2 in CheckList)
                {
                    if (w1 != w2)
                    {
                        if (string.Compare(w1.Guid, w2.Guid, true) == 0)
                        {
                            WEMessage message = new WEMessage();
                            message.Message = GetStringByComponentType(w1.ComponentType) + " \"" + w1.Name + "\" have same GUID as " + GetStringByComponentType(w2.ComponentType) + " \"" + w2.Name + "\"";
                            this.OnWarning(message);
                        }
                    }
                }
            }

            this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n");
        }
        private void VerifyStubs()
        {
            this.OnMessage("Running Stubs Verification...\r\n");

            List <LibraryWrapper> CheckList = new List <LibraryWrapper>();

            LibraryWrapper[] LWS = PK.Wrapper.GetLibraries();
            foreach (LibraryWrapper LW in LWS)
            {
                if (LW.IsStub)
                {
                    CheckList.Add(LW);
                }
            }

            foreach (LibraryWrapper LW in CheckList)
            {
                ComponentMessageObject CMO = new ComponentMessageObject();
                CMO.Component = ComponentWrapper.GetComponentWrapper(LW);

                if (LW.HasLibraryCategory == false)
                {
                    WEMessage message = new WEMessage();
                    message.Message       = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\" has not have library category";
                    message.MessageObject = CMO;
                    this.OnWarning(message);
                }
                else
                {
                    LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(LW.LibraryCategory.Guid);
                    if (string.Compare(LCW.StubLibrary.Guid, LW.Guid, true) != 0)
                    {
                        WEMessage message = new WEMessage();
                        message.Message       = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong GUID in it's StubLibrary field";
                        message.MessageObject = CMO;
                        this.OnWarning(message);
                    }

                    if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0)
                    {
                        WEMessage message = new WEMessage();
                        message.Message       = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong NAME in it's StubLibrary field";
                        message.MessageObject = CMO;
                        this.OnWarning(message);
                    }

                    if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0)
                    {
                        WEMessage message = new WEMessage();
                        message.Message       = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong ProjectPath in it's StubLibrary field";
                        message.MessageObject = CMO;
                        this.OnWarning(message);
                    }
                }
            }

            LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories();
            foreach (LibraryCategoryWrapper LCW in LCWS)
            {
                ComponentMessageObject CMO = new ComponentMessageObject();
                CMO.Component = ComponentWrapper.GetComponentWrapper(LCW);

                if (LCW.StubLibrary.Guid == null)
                {
                    WEMessage message = new WEMessage();
                    message.Message       = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has not have stub library";
                    message.MessageObject = CMO;
                    this.OnWarning(message);
                }
                else
                {
                    LibraryWrapper LW = PK.Wrapper.FindLibrary(LCW.StubLibrary.Guid);
                    if (LW == null)
                    {
                        WEMessage message = new WEMessage();
                        message.Message       = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Can't find library with GUID";
                        message.MessageObject = CMO;
                        this.OnWarning(message);
                    }
                    else
                    {
                        if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0)
                        {
                            WEMessage message = new WEMessage();
                            message.Message       = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Name mismatch. Stub component Name is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Name is \"" + LW.Name + "\"";
                            message.MessageObject = CMO;
                            this.OnWarning(message);
                        }

                        if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0)
                        {
                            WEMessage message = new WEMessage();
                            message.Message       = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Project Path mismatch. Stub component Project Path is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Project Path is \"" + LW.Name + "\"";
                            message.MessageObject = CMO;
                            this.OnWarning(message);
                        }
                    }
                }
            }

            this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n");
        }
        private void VerifyComponents()
        {
            this.OnMessage("Running Components Verification...\r\n");

            ComponentsChecked = 0;

            FeatureWrapper[] FWS = PK.Wrapper.GetFeatures();
            foreach (FeatureWrapper FW in FWS)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(FW);
                string           text           = "Feature \"" + FW.Name + "\" Assemblies: ";
                foreach (ComponentWrapper item in FW.Assemblies)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
                text = "Feature \"" + FW.Name + "\" Component Dependencies: ";
                foreach (ComponentWrapper item in FW.ComponentDependencies)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
                text = "Feature \"" + FW.Name + "\" Feature Dependencies: ";
                foreach (ComponentWrapper item in FW.FeatureDependencies)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
            }

            LibraryWrapper[] LWS = PK.Wrapper.GetLibraries();
            foreach (LibraryWrapper LW in LWS)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(LW);
                string           text           = "Library \"" + LW.Name + "\" Dependencies: ";
                foreach (ComponentWrapper item in LW.Dependencies)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
                if (LW.ISASpecific != null)
                {
                    text = "Library \"" + LW.Name + "\" ISASpecific: ";
                    CheckComponent(OwnerComponent, text, LW.ISASpecific);
                }

                if (LW.LibraryCategory != null)
                {
                    text = "Library \"" + LW.Name + "\" LibraryCategory: ";
                    CheckComponent(OwnerComponent, text, LW.LibraryCategory);
                }

                if (LW.ProcessorSpecific != null)
                {
                    text = "Library \"" + LW.Name + "\" ProcessorSpecific: ";
                    CheckComponent(OwnerComponent, text, LW.ProcessorSpecific);
                }
            }

            LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories();
            foreach (LibraryCategoryWrapper LCW in LCWS)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(LCW);
                string           text           = "Library Category \"" + LCW.Name + "\" FeatureAssociations: ";
                foreach (ComponentWrapper item in LCW.FeatureAssociations)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
                if (LCW.StubLibrary != null)
                {
                    text = "Library Category \"" + LCW.Name + "\" StubLibrary: ";
                    CheckComponent(OwnerComponent, text, LCW.StubLibrary);
                }
            }

            AssemblyWrapper[] AWS = PK.Wrapper.GetAssembies();
            foreach (AssemblyWrapper AW in AWS)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(AW);
                string           text           = "Assembly \"" + AW.Name + "\" References: ";
                foreach (ComponentWrapper item in AW.References)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
            }

            ProcessorWrapper[] PWS = PK.Wrapper.GetProcessors();
            foreach (ProcessorWrapper PW in PWS)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(PW);
                string           text           = "Processor \"" + PW.Name + "\" SupportedISAs: ";
                foreach (ComponentWrapper item in PW.SupportedISAs)
                {
                    CheckComponent(OwnerComponent, text, item);
                }
            }

            if (PK.Wrapper.Solution != null)
            {
                ComponentWrapper OwnerComponent = ComponentWrapper.GetComponentWrapper(PK.Wrapper.Solution);
                if (PK.Wrapper.Solution.DefaultISA != null)
                {
                    string text = "Solution \"" + PK.Wrapper.Solution.Name + "\" Default ISA: ";
                    CheckComponent(OwnerComponent, text, PK.Wrapper.Solution.DefaultISA);
                }

                if (PK.Wrapper.Solution.Processor != null)
                {
                    string text = "Solution \"" + PK.Wrapper.Solution.Name + "\" Processor: ";
                    CheckComponent(OwnerComponent, text, PK.Wrapper.Solution.Processor);
                }

                foreach (ProjectWrapper PW in PK.Wrapper.Solution.Projects)
                {
                    string text = "Project \"" + PW.Name + "\" Features: ";
                    foreach (ComponentWrapper item in PW.Features)
                    {
                        CheckComponent(OwnerComponent, text, item);
                    }

                    text = "Project \"" + PW.Name + "\" LibraryCategories: ";
                    foreach (ComponentWrapper item in PW.LibraryCategories)
                    {
                        CheckComponent(OwnerComponent, text, item);
                    }

                    text = "Project \"" + PW.Name + "\" Libraries: ";
                    foreach (ComponentWrapper item in PW.Libraries)
                    {
                        CheckComponent(OwnerComponent, text, item);
                    }
                }
            }

            this.OnMessage("Verified " + ComponentsChecked + " object(s).\r\n\r\n");
        }
Beispiel #12
0
            //Ru: Анализатор компонента, вносящий в список все связанные с ним компоненты
            //En: Analizes component and adds all its references
            public void AnalyseComponent(ComponentWrapper comp)
            {
                Link l;

                if (comp != null)
                {
                    switch (comp.ComponentType)
                    {
                        #region Library
                    case ComponentTypeWrapper.Library:
                        LibraryWrapper lib = PK.Wrapper.FindLibrary(comp);
                        if (lib != null)
                        {
                            //Ru: Заносим себя в список
                            //En: add itself to the list
                            if (!ContainsLibrary(comp))
                            {
                                Librares.Add(comp);
                            }

                            if (lib.HasLibraryCategory)    //En: if the library has a library category add it to the list. Ru: Если есть LibCat, то заносим и ее в список
                            {
                                if (!ContainsLibCat(lib.LibraryCategory))
                                {
                                    LibraryCategories.Add(lib.LibraryCategory);
                                }
                                //Связь Lib реализует LibCat
                                l = new Link(Link.LINK_TYPE.Realise, comp, lib.LibraryCategory);
                                if (!ContainsLink(l))
                                {
                                    Links.Add(l);
                                }
                            }
                            //Ru: Заносим в список все Dependency
                            //En: Add all dependencies to the list
                            foreach (ComponentWrapper dep in lib.Dependencies)
                            {
                                switch (dep.ComponentType)
                                {
                                case ComponentTypeWrapper.Library:
                                    if (!ContainsLibrary(dep))
                                    {
                                        Librares.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency lib
                                    //En: Add library dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;

                                case ComponentTypeWrapper.Feature:
                                    if (!ContainsFeature(dep))
                                    {
                                        Featuries.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency Feature
                                    //En: Add Feature dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;

                                case ComponentTypeWrapper.LibraryCategory:
                                    if (!ContainsLibCat(dep))
                                    {
                                        LibraryCategories.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency LibraryCategory
                                    //En: Add Library Category dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;
                                }
                            }

                            foreach (FeatureWrapper FW in PK.Wrapper.GetFeatures())
                            {
                                foreach (ComponentWrapper dep in FW.ComponentDependencies)
                                {
                                    if (string.Compare(dep.Guid, lib.Guid, true) == 0)
                                    {
                                        ComponentWrapper featdep = ComponentWrapper.GetComponentWrapper(FW);
                                        if (!ContainsFeature(featdep))
                                        {
                                            Featuries.Add(featdep);
                                        }
                                        //Связь
                                        l = new Link(Link.LINK_TYPE.Dependency, featdep, comp);
                                        if (!ContainsLink(l))
                                        {
                                            Links.Add(l);
                                        }
                                    }
                                }
                            }
                        }
                        break;

                        #endregion
                        #region Library Category
                    case ComponentTypeWrapper.LibraryCategory:
                        LibraryCategoryWrapper libcat = PK.Wrapper.FindLibraryCategory(comp.Guid);
                        if (libcat != null)
                        {
                            //Ru: Заносим себя в список
                            //En: add itself to the list
                            if (!ContainsLibCat(comp))
                            {
                                LibraryCategories.Add(comp);
                            }

                            foreach (ComponentWrapper asc in libcat.FeatureAssociations)
                            {
                                if (!ContainsFeature(asc))
                                {
                                    Featuries.Add(asc);
                                }
                                //Ru: Связь
                                //En: Link
                                l = new Link(Link.LINK_TYPE.Associate, comp, asc);
                                if (!ContainsLink(l))
                                {
                                    Links.Add(l);
                                }
                            }

                            if ((libcat.StubLibrary != null) && (!string.IsNullOrEmpty(libcat.StubLibrary.Guid)))
                            {
                                if (!ContainsLibrary(libcat.StubLibrary))
                                {
                                    Librares.Add(libcat.StubLibrary);
                                }

                                l = new Link(Link.LINK_TYPE.Stub, comp, libcat.StubLibrary);
                                if (!ContainsLink(l))
                                {
                                    Links.Add(l);
                                }
                            }
                            foreach (FeatureWrapper feature in PK.Wrapper.GetFeatures())
                            {
                                foreach (ComponentWrapper dependency in feature.ComponentDependencies)
                                {
                                    if (dependency.ComponentType == ComponentTypeWrapper.LibraryCategory)
                                    {
                                        if (comp.Equals(dependency))
                                        {
                                            ComponentWrapper featurecomp = ComponentWrapper.GetComponentWrapper(feature);
                                            if (Featuries.Contains(featurecomp) == false)
                                            {
                                                Featuries.Add(featurecomp);
                                            }
                                            l = new Link(Link.LINK_TYPE.Dependency, featurecomp, comp);
                                            if (!ContainsLink(l))
                                            {
                                                Links.Add(l);
                                            }
                                        }
                                    }
                                }
                            }

                            foreach (LibraryWrapper loclib in PK.Wrapper.GetLibraries())
                            {
                                if (loclib.HasLibraryCategory)
                                {
                                    if (loclib.LibraryCategory.Guid.ToLower() == comp.Guid.ToLower())
                                    {
                                        ComponentWrapper libcomp = ComponentWrapper.GetComponentWrapper(loclib);
                                        if (!ContainsLibrary(libcomp))
                                        {
                                            Librares.Add(libcomp);
                                        }
                                        l = new Link(Link.LINK_TYPE.Realise, libcomp, comp);
                                        if (!ContainsLink(l))
                                        {
                                            Links.Add(l);
                                        }
                                    }
                                }
                                foreach (ComponentWrapper dependency in loclib.Dependencies)
                                {
                                    if (dependency.Equals(comp))
                                    {
                                        ComponentWrapper libcomp = ComponentWrapper.GetComponentWrapper(loclib);
                                        switch (libcomp.ComponentType)
                                        {
                                        case ComponentTypeWrapper.Library:
                                            if (!ContainsLibrary(libcomp))
                                            {
                                                Librares.Add(libcomp);
                                            }
                                            break;

                                        case ComponentTypeWrapper.LibraryCategory:
                                            if (!ContainsLibCat(libcomp))
                                            {
                                                LibraryCategories.Add(libcomp);
                                            }
                                            break;

                                        default:
                                            break;
                                        }
                                        l = new Link(Link.LINK_TYPE.Dependency, libcomp, comp);
                                        if (!ContainsLink(l))
                                        {
                                            Links.Add(l);
                                        }
                                    }
                                }
                            }
                        }
                        break;

                        #endregion
                        #region Feature
                    case ComponentTypeWrapper.Feature:
                        FeatureWrapper feat = PK.Wrapper.FindFeature(comp.Guid);
                        if (feat != null)
                        {
                            //Ru: Заносим себя в список
                            //En: add itself to the list
                            if (!ContainsFeature(comp))
                            {
                                Featuries.Add(comp);
                            }

                            foreach (ComponentWrapper dep in feat.FeatureDependencies)
                            {
                                if (!ContainsFeature(dep))
                                {
                                    Featuries.Add(dep);
                                }
                                //Ru: Связь
                                //En: Link
                                l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                if (!ContainsLink(l))
                                {
                                    Links.Add(l);
                                }
                            }

                            //Ru: Заносим в список все Dependency
                            //En: Add all dependencies to the list
                            foreach (ComponentWrapper dep in feat.ComponentDependencies)
                            {
                                switch (dep.ComponentType)
                                {
                                case ComponentTypeWrapper.Library:
                                    if (!ContainsLibrary(dep))
                                    {
                                        Librares.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency lib
                                    //En: Add library dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;

                                case ComponentTypeWrapper.Feature:
                                    if (!ContainsFeature(dep))
                                    {
                                        Featuries.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency Feature
                                    //En: Add feature dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;

                                case ComponentTypeWrapper.LibraryCategory:
                                    if (!ContainsLibCat(dep))
                                    {
                                        LibraryCategories.Add(dep);
                                    }

                                    //Ru: Связь Lib требует Dependency LibraryCategory
                                    //En: Add library category dependency link
                                    l = new Link(Link.LINK_TYPE.Dependency, comp, dep);
                                    if (!ContainsLink(l))
                                    {
                                        Links.Add(l);
                                    }

                                    break;
                                }
                            }

                            foreach (LibraryCategoryWrapper loclibcat in PK.Wrapper.GetLibraryCategories())
                            {
                                foreach (ComponentWrapper fetasscomp in loclibcat.FeatureAssociations)
                                {
                                    if (fetasscomp.Guid.ToLower() == comp.Guid.ToLower())
                                    {
                                        ComponentWrapper libcatcomp = ComponentWrapper.GetComponentWrapper(loclibcat);

                                        //Ru: Заносим себя в список
                                        //En: Add itself to the list
                                        if (!ContainsLibCat(libcatcomp))
                                        {
                                            LibraryCategories.Add(libcatcomp);
                                        }

                                        //Ru: Связь
                                        //En: Link
                                        l = new Link(Link.LINK_TYPE.Associate, libcatcomp, comp);
                                        if (!ContainsLink(l))
                                        {
                                            Links.Add(l);
                                        }
                                    }
                                }
                            }
                        }
                        break;
                        #endregion
                    }
                }
            }