public DocumentationPage(LibraryCategoryWrapper LibCat)
            : base(LibCat)
        {
            InitializeComponent();

            HeaderLbl.Text = this.NodeName;
        }
Beispiel #2
0
        public DocumentationPage(LibraryCategoryWrapper LibCat)
            : base(LibCat)
        {
            InitializeComponent();

            HeaderLbl.Text = this.NodeName;
        }
 private void OtBtn_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (!PK.Wrapper.CheckLibraryCategoryName(NameTb.Text + LevelLbl.Text))
         {
             if (this.LibraryCategory != null)
             {
                 this.LibraryCategory = PK.Wrapper.CloneLibraryCategory(this.LibraryCategory, NameTb.Text + LevelLbl.Text, GroupsCb.Text, (LibraryLevelWrapper)LevelCb.SelectedItem);
             }
             else
             {
                 this.LibraryCategory = PK.Wrapper.CreateLibraryCategory(NameTb.Text + LevelLbl.Text, GroupsCb.Text, (LibraryLevelWrapper)LevelCb.SelectedItem);
             }
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }
         else
         {
             throw new ArgumentException(Strings.LibraryCategory + " \"" + NameTb.Text + LevelLbl.Text + "\"" + Strings.AlreadyExist + ".");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #4
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 #5
0
 public LibraryProjCachePage(LibraryCategoryWrapper LibCat)
     : base(LibCat)
 {
     InitializeComponent();
     this.NodeName  = Strings.Templates;
     HeaderLbl.Text = this.NodeName;
 }
Beispiel #6
0
        protected IEventComponent ShowLibraryCategoryEditorByGuid(string guid)
        {
            bool exist = false;

            foreach (DockContent item in DockPanel.Contents)
            {
                if (item.GetType() == typeof(PKStudio.Forms.Editors.LibraryCategoryEditor))
                {
                    LibraryCategoryEditor editor = (LibraryCategoryEditor)item;
                    if (editor.LibraryCategory.Guid == guid)
                    {
                        editor.Show();
                        exist = true;
                    }
                }
            }

            if (!exist)
            {
                LibraryCategoryWrapper libcat = PK.Wrapper.FindLibraryCategory(guid);
                if (libcat != null)
                {
                    LCE = new LibraryCategoryEditor();
                    LCE.OpenContainingFolderEvent += new EventHandler <Forms.BaseForms.PathEventArgs>(OpenContainingFolderEvent);
                    LCE.SetLibCat(libcat);
                    LCE.Show(DockPanel, DockState.Document);
                    return(LCE);
                }
            }
            return(null);
        }
Beispiel #7
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 #8
0
        public MainPage(LibraryCategoryWrapper LibCat)
            :base(LibCat)
        {
            InitializeComponent();

            GroupsCb.Items.Clear();
            GroupsCb.Items.Add("");

            foreach (LibraryCategoryWrapper libCat in PK.Wrapper.GetLibraryCategories())
            {
                if (!GroupsCb.Items.Contains(libCat.Groups))
                {
                    GroupsCb.Items.Add(libCat.Groups);
                }
            }

            LevelCb.Items.Clear();
            LevelCb.Items.Add(LibraryLevelWrapper.CLR);
            LevelCb.Items.Add(LibraryLevelWrapper.HAL);
            LevelCb.Items.Add(LibraryLevelWrapper.PAL);
            LevelCb.Items.Add(LibraryLevelWrapper.Support);
            LevelCb.SelectedItem = LibraryLevelWrapper.CLR;

            this.NodeName = Strings.Main;
            HeaderLbl.Text = this.NodeName;
        }
 public MFLibCatTreeNode(LibraryCategoryWrapper libcat)
     : base(libcat.Name, ImageKeysEnum.LibraryCategory)
 {
     this.LibCat = libcat;
     this.Tag = libcat;
 
 }
 public LibraryProjCachePage(LibraryCategoryWrapper LibCat)
     : base(LibCat)
 {
     InitializeComponent();
     this.NodeName = Strings.Templates;
     HeaderLbl.Text = this.NodeName;
 }
Beispiel #11
0
 public FlagsPage(LibraryCategoryWrapper LibCat)
     : base(LibCat)
 {
     InitializeComponent();
     this.NodeName = Strings.Flags;
     HeaderLbl.Text = this.NodeName;
 }
Beispiel #12
0
        public MainPage(LibraryCategoryWrapper LibCat)
            : base(LibCat)
        {
            InitializeComponent();

            GroupsCb.Items.Clear();
            GroupsCb.Items.Add("");

            foreach (LibraryCategoryWrapper libCat in PK.Wrapper.GetLibraryCategories())
            {
                if (!GroupsCb.Items.Contains(libCat.Groups))
                {
                    GroupsCb.Items.Add(libCat.Groups);
                }
            }

            LevelCb.Items.Clear();
            LevelCb.Items.Add(LibraryLevelWrapper.CLR);
            LevelCb.Items.Add(LibraryLevelWrapper.HAL);
            LevelCb.Items.Add(LibraryLevelWrapper.PAL);
            LevelCb.Items.Add(LibraryLevelWrapper.Support);
            LevelCb.SelectedItem = LibraryLevelWrapper.CLR;

            this.NodeName  = Strings.Main;
            HeaderLbl.Text = this.NodeName;
        }
Beispiel #13
0
 public FlagsPage(LibraryCategoryWrapper LibCat)
     : base(LibCat)
 {
     InitializeComponent();
     this.NodeName  = Strings.Flags;
     HeaderLbl.Text = this.NodeName;
 }
Beispiel #14
0
        /// <summary>
        /// Ru: Открывает редактор для объекта. Если такой уже открыт, то показывает его
        /// En: If object editor has been shown, opens it. I it has not been shown , creates it
        /// </summary>
        /// <param name="obj"></param>
        public void ShowEditor(object obj)
        {
            IEventComponent component = null;

            if (obj is LibraryWrapper)
            {
                LibraryWrapper library = (LibraryWrapper)obj;
                component = ShowLibraryEditorByGuid(library.Guid);
            }
            else if (obj is FeatureWrapper)
            {
                FeatureWrapper feature = (FeatureWrapper)obj;
                component = ShowFeatureEditorByGuid(feature.Guid);
            }
            else if (obj is LibraryCategoryWrapper)
            {
                LibraryCategoryWrapper libcat = (LibraryCategoryWrapper)obj;
                component = ShowLibraryCategoryEditorByGuid(libcat.Guid);
            }
            else if (obj is ComponentWrapper)
            {
                ComponentWrapper comp = (ComponentWrapper)obj;
                switch (comp.ComponentType)
                {
                case ComponentTypeWrapper.Library:
                    component = ShowLibraryEditorByGuid(comp.Guid);
                    break;

                case ComponentTypeWrapper.Feature:
                    component = ShowFeatureEditorByGuid(comp.Guid);
                    break;

                case ComponentTypeWrapper.LibraryCategory:
                    component = ShowLibraryCategoryEditorByGuid(comp.Guid);
                    break;

                default:
                    break;
                }
            }
            else if (obj is BuildFileWrapper)//En: Need to open file editor Ru: Нужно отрыть редактор файлов
            {
                BuildFileWrapper file = (BuildFileWrapper)obj;
                if (!string.IsNullOrEmpty(file.FullPath) && (File.Exists(file.FullPath)))
                {
                    OpenTextEditor(file.FullPath);
                }
            }
            else if (obj is EditFileDescriptor)
            {
                EditFileDescriptor file   = (EditFileDescriptor)obj;
                SourceFileEditor   editor = OpenTextEditor(file.Path);
                if (editor != null)
                {
                    editor.GotoLine(file.Line - 1);
                }
            }
            OnShowEditor(component);
        }
Beispiel #15
0
 private void ShowDescription(LibraryCategoryWrapper libcat)
 {
     DescriptionTB.AppendText("Name: " + libcat.Name + "\r\n\r\n");
     DescriptionTB.AppendText("Project Path:\r\n");
     DescriptionTB.AppendText(libcat.ProjectPath + "\r\n\r\n");
     DescriptionTB.AppendText("Required: " + libcat.Required + "\r\n\r\n");
     //DescriptionTB.AppendText("Sulution Visible: " + LCW.IsSolutionWizardVisible + "\r\n\r\n");
     DescriptionTB.AppendText("Description:\r\n");
     DescriptionTB.AppendText(libcat.Description + "\r\n\r\n");
 }
Beispiel #16
0
 private void ShowDescription(LibraryCategoryWrapper Transport)
 {
     DescriptionTB.Clear();
     DescriptionTB.AppendText("Name: " + Transport.Name + "\r\n\r\n");
     DescriptionTB.AppendText("Project Path:\r\n");
     DescriptionTB.AppendText(Transport.ProjectPath + "\r\n\r\n");
     DescriptionTB.AppendText("Is Transport:\r\n");
     DescriptionTB.AppendText(Transport.IsTransport + "\r\n\r\n");
     DescriptionTB.AppendText("Description:\r\n");
     DescriptionTB.AppendText(Transport.Description + "\r\n\r\n");
 }
 private void ShowDescription(LibraryCategoryWrapper Transport)
 {
     DescriptionTB.Clear();
     DescriptionTB.AppendText("Name: " + Transport.Name + "\r\n\r\n");
     DescriptionTB.AppendText("Project Path:\r\n");
     DescriptionTB.AppendText(Transport.ProjectPath + "\r\n\r\n");
     DescriptionTB.AppendText("Is Transport:\r\n");
     DescriptionTB.AppendText(Transport.IsTransport + "\r\n\r\n");
     DescriptionTB.AppendText("Description:\r\n");
     DescriptionTB.AppendText(Transport.Description + "\r\n\r\n");            
 }
Beispiel #18
0
        private void ShowDependencyDescription(ComponentWrapper dep)
        {
            DepsInfoRTB.Clear();

            switch (dep.ComponentType)
            {
            case ComponentTypeWrapper.Library:
                LibraryWrapper lib = PK.Wrapper.FindLibrary(dep);
                if (lib != null)
                {
                    DepsInfoRTB.AppendText("Library\r\n");
                    DepsInfoRTB.AppendText("Name              : " + lib.Name.ToString() + "\r\n");
                    DepsInfoRTB.AppendText("Description       : " + lib.Description.ToString() + "\r\n");
                    DepsInfoRTB.AppendText("Documentation     : " + lib.Documentation.ToString() + "\r\n");
                    DepsInfoRTB.AppendText("Groups            : " + lib.Groups.ToString() + "\r\n");
                    DepsInfoRTB.AppendText("Guid              : " + lib.Guid.ToString() + "\r\n");
                    DepsInfoRTB.AppendText("ProjectPath       : " + lib.ProjectPath.ToString() + "\r\n");
                }
                break;

            case ComponentTypeWrapper.LibraryCategory:
                LibraryCategoryWrapper LibCat = PK.Wrapper.FindLibraryCategory(dep.Guid);
                DepsInfoRTB.AppendText("Library Category \r\n");
                DepsInfoRTB.AppendText("Name              : " + LibCat.Name.ToString() + "\r\n");
                DepsInfoRTB.AppendText("Description       : " + LibCat.Description.ToString() + "\r\n");
                DepsInfoRTB.AppendText("Documentation     : " + LibCat.Documentation.ToString() + "\r\n");
                DepsInfoRTB.AppendText("Groups            : " + LibCat.Groups.ToString() + "\r\n");
                DepsInfoRTB.AppendText("Guid              : " + LibCat.Guid.ToString() + "\r\n");
                DepsInfoRTB.AppendText("ProjectPath       : " + LibCat.ProjectPath.ToString() + "\r\n");
                break;

            case ComponentTypeWrapper.Feature:
            case ComponentTypeWrapper.MFAssembly:
            case ComponentTypeWrapper.MFSolution:
            case ComponentTypeWrapper.Processor:
            case ComponentTypeWrapper.OperatingSystem:
            case ComponentTypeWrapper.BuildTool:
            case ComponentTypeWrapper.ISA:
            case ComponentTypeWrapper.BuildParameter:
            case ComponentTypeWrapper.Unknown:
            default:
                DepsInfoRTB.AppendText("ComponentType       : " + dep.ComponentType.ToString() + "\r\n");
                DepsInfoRTB.AppendText("Name                : " + dep.Name + "\r\n");
                DepsInfoRTB.AppendText("Conditional         : " + dep.Conditional + "\r\n");
                DepsInfoRTB.AppendText("ProjectPath         : " + dep.ProjectPath + "\r\n");
                DepsInfoRTB.AppendText("Guid                : " + dep.Guid.ToString() + "\r\n");
                DepsInfoRTB.AppendText("RefCount            : " + dep.RefCount.ToString() + "\r\n");
                DepsInfoRTB.AppendText("RefCountSpecified   : " + dep.RefCountSpecified.ToString() + "\r\n");
                DepsInfoRTB.AppendText("VersionDependency   : " + dep.VersionDependency.ToString() + "\r\n");
                break;
            }
        }
Beispiel #19
0
        private void _treeView_SelectionChangedEvent(object sender, Forms.BaseForms.ObjectEventArgs e)
        {
            if (e.Object != null)
            {
                ComponentWrapper CW = e.Object as ComponentWrapper;

                LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(CW.Guid);

                if (LCW != null)
                {
                    ShowDescription(LCW);
                    selectedTransport = LCW;
                    this.OnShowNextBtn(true);
                }
            }
        }
        public DialogResult ShowDialog(IWin32Window owner, string groups)
        {
            this.Text = Strings.NewLibraryCategory;
            this.LibraryCategory = null;
            FillFields();

            if (GroupsCb.Items.Contains(groups)) GroupsCb.SelectedItem = groups;
            else 
            {
                if (GroupsCb.Items.Count > 0) GroupsCb.SelectedIndex = 0;
            }

            NameTb.Text = PK.Wrapper.GenerateNewLibraryCategoryName("NewLibraryCategory" + LevelLbl.Text);

            return this.ShowDialog(owner);
        }
        public DialogResult ShowDialog(IWin32Window owner,LibraryCategoryWrapper LibCat)
        {
            this.Text = Strings.CloneLibraryCategory;
            this.LibraryCategory = LibCat;
            FillFields();

            if (GroupsCb.Items.Contains(LibCat.Groups)) GroupsCb.SelectedItem = LibCat.Groups;
            else
            {
                if (GroupsCb.Items.Count > 0) GroupsCb.SelectedIndex = 0;
            }

            NameTb.Text = PK.Wrapper.GenerateNewLibraryCategoryName(LibCat.Name);

            LevelCb.SelectedItem = LibCat.Level;

            return this.ShowDialog(owner);
        }
Beispiel #22
0
 public MFLibCatTreeNode(LibraryCategoryWrapper libcat, ref SortedDictionary <string, TreeNode> GroupsDict, ref SortedList <string, TreeNode> VoidGroupsList)
     : this(libcat)
 {
     if (!string.IsNullOrEmpty(LibCat.Groups))
     {
         if (!GroupsDict.ContainsKey(LibCat.Groups))
         {
             MFTreeNodeBase GroupNode = new MFDirectoryTreeNode(LibCat.Groups);//this.NewNode(cat.Groups, MFTreeNodeBase.TreeNodeType.Directory, MFTreeNodeBase.ImageKeysEnum.CollapsedDirectory);
             GroupNode.Nodes.Add(this);
             GroupsDict.Add(LibCat.Groups, GroupNode);
         }
         else
         {
             GroupsDict[LibCat.Groups].Nodes.Add(this);
         }
     }
     else
     {
         VoidGroupsList.Add(this.Text, this);
     }
 }
        private void UpdateForm(LibraryCategoryWrapper LibCat)
        {
            FormText = Strings.LibraryCategory+" : " + LibCat.Name;
            ModifiedFormText = FormText + "*";

            this.LibCat = LibCat;

            this.Pages.Clear();

            this.Pages.Add(new Editors.Pages.LibraryCategory.MainPage(LibCat));
            this.Pages.Add(new Editors.Pages.DescriptionPage(LibCat));
            this.Pages.Add(new Editors.Pages.DocumentationPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.FlagsPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.StubLibraryPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.FeatureAssocioationsPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.TemplatesPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.LibraryProjCachePage(LibCat));

            this.Initialize();

            SetModified(false);
        }
        public DialogResult ShowDialog(IWin32Window owner, string groups)
        {
            this.Text            = Strings.NewLibraryCategory;
            this.LibraryCategory = null;
            FillFields();

            if (GroupsCb.Items.Contains(groups))
            {
                GroupsCb.SelectedItem = groups;
            }
            else
            {
                if (GroupsCb.Items.Count > 0)
                {
                    GroupsCb.SelectedIndex = 0;
                }
            }

            NameTb.Text = PK.Wrapper.GenerateNewLibraryCategoryName("NewLibraryCategory" + LevelLbl.Text);

            return(this.ShowDialog(owner));
        }
        private void UpdateForm(LibraryCategoryWrapper LibCat)
        {
            FormText         = Strings.LibraryCategory + " : " + LibCat.Name;
            ModifiedFormText = FormText + "*";

            this.LibCat = LibCat;

            this.Pages.Clear();

            this.Pages.Add(new Editors.Pages.LibraryCategory.MainPage(LibCat));
            this.Pages.Add(new Editors.Pages.DescriptionPage(LibCat));
            this.Pages.Add(new Editors.Pages.DocumentationPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.FlagsPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.StubLibraryPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.FeatureAssocioationsPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.TemplatesPage(LibCat));
            this.Pages.Add(new Editors.Pages.LibraryCategory.LibraryProjCachePage(LibCat));

            this.Initialize();

            SetModified(false);
        }
        public MFLibCatTreeNode(LibraryCategoryWrapper libcat, ref SortedDictionary<string, TreeNode> GroupsDict, ref SortedList<string, TreeNode> VoidGroupsList)
            : this (libcat)
        {

            if (!string.IsNullOrEmpty(LibCat.Groups))
            {
                if (!GroupsDict.ContainsKey(LibCat.Groups))
                {
                    MFTreeNodeBase GroupNode = new MFDirectoryTreeNode(LibCat.Groups);//this.NewNode(cat.Groups, MFTreeNodeBase.TreeNodeType.Directory, MFTreeNodeBase.ImageKeysEnum.CollapsedDirectory);
                    GroupNode.Nodes.Add(this);
                    GroupsDict.Add(LibCat.Groups, GroupNode);
                }
                else
                {
                    GroupsDict[LibCat.Groups].Nodes.Add(this);
                }
            }
            else
            {
                VoidGroupsList.Add(this.Text, this);
            }

        }
        public DialogResult ShowDialog(IWin32Window owner, LibraryCategoryWrapper LibCat)
        {
            this.Text            = Strings.CloneLibraryCategory;
            this.LibraryCategory = LibCat;
            FillFields();

            if (GroupsCb.Items.Contains(LibCat.Groups))
            {
                GroupsCb.SelectedItem = LibCat.Groups;
            }
            else
            {
                if (GroupsCb.Items.Count > 0)
                {
                    GroupsCb.SelectedIndex = 0;
                }
            }

            NameTb.Text = PK.Wrapper.GenerateNewLibraryCategoryName(LibCat.Name);

            LevelCb.SelectedItem = LibCat.Level;

            return(this.ShowDialog(owner));
        }
 private void OtBtn_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (!PK.Wrapper.CheckLibraryCategoryName(NameTb.Text + LevelLbl.Text))
         {
             if (this.LibraryCategory != null)
             {
                 this.LibraryCategory = PK.Wrapper.CloneLibraryCategory(this.LibraryCategory, NameTb.Text + LevelLbl.Text, GroupsCb.Text, (LibraryLevelWrapper)LevelCb.SelectedItem);
             }
             else
             {
                 this.LibraryCategory = PK.Wrapper.CreateLibraryCategory(NameTb.Text + LevelLbl.Text, GroupsCb.Text, (LibraryLevelWrapper)LevelCb.SelectedItem);
             }
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }
         else throw new ArgumentException(Strings.LibraryCategory + " \"" + NameTb.Text + LevelLbl.Text+"\"" + Strings.AlreadyExist+".");
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void _treeView_SelectionChangedEvent(object sender, Forms.BaseForms.ObjectEventArgs e)
        {
            if (e.Object != null)
            {
                ComponentWrapper CW = e.Object as ComponentWrapper;

                LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(CW.Guid);

                if (LCW != null)
                {
                    ShowDescription(LCW);
                    selectedTransport = LCW;
                    this.OnShowNextBtn(true);
                }
            }
        }
 public FeatureAssocioationsPage(LibraryCategoryWrapper Wrapper)
     : base(Wrapper, Strings.FeatureAssociations)
 {
     InitializeComponent();
 }
 public void CopyTemplateFiles(LibraryCategoryWrapper libcat, SolutionWrapper solution, ComponentWrapper template)
 {
     this.m_bw.CopyTemplateFiles(libcat.InnerObject, solution.InnerObject, template.InnerObject);
 }
 public StubLibraryPage(LibraryCategoryWrapper Wrapper)
     : base(Wrapper, Strings.StubLibrary)
 {
 }
Beispiel #33
0
        private void Visualize(HierarchyCollection collection)
        {
            designer1.Document.SelectAllElements();
            designer1.Document.DeleteSelectedElements();
            designer1.Document.ClearSelection();

            ResetZoom();

            int FeatureLineY         = 50;
            int LibraryCategoryLineY = 150;
            int LibraryLineY         = 250;

            int ElementDistance = 150;

            int count = 1;

            foreach (ComponentWrapper comp in collection.Librares)
            {
                LibraryWrapper LW = PK.Wrapper.FindLibrary(comp.Guid);
                if ((LW != null) && (!string.IsNullOrEmpty(comp.Guid)))
                {
                    AddNodeElement(LW.Name, comp.ComponentType, new Point(count * ElementDistance, LibraryLineY), comp);
                }
                count++;
            }

            count = 1;
            foreach (ComponentWrapper comp in collection.LibraryCategories)
            {
                LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(comp.Guid);
                if ((LCW != null) && (!string.IsNullOrEmpty(comp.Guid)))
                {
                    AddNodeElement(LCW.Name, comp.ComponentType, new Point(count * ElementDistance, LibraryCategoryLineY), comp);
                }
                count++;
            }

            count = 1;
            foreach (ComponentWrapper comp in collection.Featuries)
            {
                FeatureWrapper FW = PK.Wrapper.FindFeature(comp.Guid);
                if ((FW != null) && (!string.IsNullOrEmpty(comp.Guid)))
                {
                    AddNodeElement(FW.Name, comp.ComponentType, new Point(count * ElementDistance, FeatureLineY), comp);
                }
                count++;
            }

            foreach (HierarchyCollection.Link link in collection.Links)
            {
                MFRectangleNode StartNode = null;
                MFRectangleNode EndNode   = null;
                foreach (BaseElement element in designer1.Document.Elements)
                {
                    if (element.GetType() == typeof(MFRectangleNode))
                    {
                        MFRectangleNode RectNode = (MFRectangleNode)element;
                        if (link.StartComponent.Guid.ToLower() == ((ComponentWrapper)RectNode.Tag).Guid.ToLower())
                        {
                            StartNode = RectNode;
                        }
                        if (link.EndComponent.Guid.ToLower() == ((ComponentWrapper)RectNode.Tag).Guid.ToLower())
                        {
                            EndNode = RectNode;
                        }
                    }
                }

                if ((StartNode != null) && (EndNode != null))
                {
                    switch (link.Type)
                    {
                    case HierarchyCollection.Link.LINK_TYPE.Dependency:
                        AddLinkElement("Depend", StartNode, 4, LineCap.RoundAnchor, EndNode, 4, LineCap.ArrowAnchor, Color.Red, -10, -10);
                        break;

                    case HierarchyCollection.Link.LINK_TYPE.Realise:
                        AddLinkElement("Realise", StartNode, 4, LineCap.RoundAnchor, EndNode, 4, LineCap.ArrowAnchor, Color.Blue, -10, -10);
                        break;

                    case HierarchyCollection.Link.LINK_TYPE.Stub:
                        AddLinkElement("Stub", StartNode, 5, LineCap.RoundAnchor, EndNode, 5, LineCap.ArrowAnchor, Color.Black, 10, 10);
                        break;

                    case HierarchyCollection.Link.LINK_TYPE.Associate:
                        AddLinkElement("Associate with", StartNode, 5, LineCap.RoundAnchor, EndNode, 5, LineCap.ArrowAnchor, Color.Green, 10, 10);
                        break;
                    }
                }
                else
                {
                }
            }
        }
 /// <summary>
 /// Sets LibrarayCategory for edition
 /// </summary>
 /// <param name="LibCat"></param>
 public void SetLibCat(LibraryCategoryWrapper LibCat)
 {
     UpdateForm(LibCat);
 }
Beispiel #35
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
                    }
                }
            }
 /// <summary>
 /// Sets LibrarayCategory for edition
 /// </summary>
 /// <param name="LibCat"></param>
 public void SetLibCat(LibraryCategoryWrapper LibCat)
 {
     UpdateForm(LibCat);
 }
        private void CheckLibraryCategory(SearchResultsHolder.SearchComponentDescriptor ProjectDesc, LibraryCategoryWrapper libcat, string what, bool MatchCase, bool MatchWholeWord)
        {
            SearchResultsHolder.SearchComponentDescriptor CompDesc = new SearchResultsHolder.SearchComponentDescriptor(ComponentWrapper.GetComponentWrapper(libcat));
            if (ProjectDesc != null)
                CompDesc.Parent = ProjectDesc;

            m_SearchResults.TotalComponentsSearched++;

            if (MatchWholeWord)
            {
                if (MatchCase)
                {
                    if (libcat.Name == what)
                    {
                        m_SearchResults.FindedComponents.Add(CompDesc);
                        OnElementFinded(CompDesc);
                    }
                }
                else
                {
                    if (libcat.Name.ToLower() == what.ToLower())
                    {
                        m_SearchResults.FindedComponents.Add(CompDesc);
                        OnElementFinded(CompDesc);
                    }
                }
            }
            else
            {
                if (MatchCase)
                {
                    if (libcat.Name.Contains(what))
                    {
                        m_SearchResults.FindedComponents.Add(CompDesc);
                        OnElementFinded(CompDesc);
                    }
                }
                else
                {
                    if (libcat.Name.ToLower().Contains(what.ToLower()))
                    {
                        m_SearchResults.FindedComponents.Add(CompDesc);
                        OnElementFinded(CompDesc);
                    }
                }
            }
        }
        public bool SaveLibraryCategoryProj(LibraryCategoryWrapper libCat)
        {
            bool result = m_bw.SaveLibraryCategoryProj(libCat.InnerObject);

            if (result)
            {
                this.m_helper.DefaultInventory.LibraryCategories.Clear();
                this.LoadDefaultLibraryCatigoriesAsync();
            }
            return result;
        }
        public LibraryCategoryPageBase(LibraryCategoryWrapper LibCat)
        {
            InitializeComponent();

            this.LibCat = LibCat;
        }
        public void DeleteLibraryCategoryProj(LibraryCategoryWrapper libcat)
        {
            string path = MsBuildWrapper.ExpandEnvVars(libcat.InnerObject.ProjectPath, "");
            File.Delete(path);

            this.m_helper.DefaultInventory.LibraryCategories.Clear();
            this.LoadDefaultLibraryCatigoriesAsync();
        }
Beispiel #41
0
 public StubLibraryPage(LibraryCategoryWrapper Wrapper)
     : base(Wrapper, Strings.StubLibrary)
 {
 }
 private void CheckLibraryCategory(LibraryCategoryWrapper libcat, string what, bool MatchCase, bool MatchWholeWord)
 {
     CheckLibraryCategory(null, libcat, what, MatchCase, MatchWholeWord);
 }
Beispiel #43
0
        private void showPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (designer1.Document.SelectedElements.Count == 1)
            {
                if (designer1.Document.SelectedElements[0].GetType() == typeof(MFRectangleNode))
                {
                    MFRectangleNode  RectNode = (MFRectangleNode)designer1.Document.SelectedElements[0];
                    ComponentWrapper comp     = (ComponentWrapper)RectNode.Tag;

                    switch (comp.ComponentType)
                    {
                    case ComponentTypeWrapper.Library:
                        LibraryWrapper lib = PK.Wrapper.FindLibrary(comp.Guid);
                        if (lib != null)
                        {
                            this.OnShowPropertiesEvent(lib);
                        }
                        break;

                    case ComponentTypeWrapper.Feature:
                        FeatureWrapper feat = PK.Wrapper.FindFeature(comp.Guid);
                        if (feat != null)
                        {
                            this.OnShowPropertiesEvent(feat);
                        }
                        break;

                    case ComponentTypeWrapper.MFAssembly:
                        break;

                    case ComponentTypeWrapper.MFSolution:
                        break;

                    case ComponentTypeWrapper.Processor:
                        break;

                    case ComponentTypeWrapper.OperatingSystem:
                        break;

                    case ComponentTypeWrapper.BuildTool:
                        break;

                    case ComponentTypeWrapper.ISA:
                        break;

                    case ComponentTypeWrapper.BuildParameter:
                        break;

                    case ComponentTypeWrapper.LibraryCategory:
                        LibraryCategoryWrapper libcat = PK.Wrapper.FindLibraryCategory(comp.Guid);
                        if (libcat != null)
                        {
                            this.OnShowPropertiesEvent(libcat);
                        }
                        break;

                    case ComponentTypeWrapper.Unknown:
                        break;

                    default:
                        break;
                    }
                }
            }
        }
        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");
        }
 public FeatureAssocioationsPage(LibraryCategoryWrapper Wrapper)
     : base(Wrapper, Strings.FeatureAssociations)
 {
     InitializeComponent();
 }
        private void CheckComponent(ComponentWrapper OwnerComponent, string text, ComponentWrapper component)
        {
            ComponentMessageObject CMO = new ComponentMessageObject();

            CMO.Component = OwnerComponent;

            ComponentsChecked++;
            switch (component.ComponentType)
            {
                #region Library
            case ComponentTypeWrapper.Library:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                LibraryWrapper LW = PK.Wrapper.FindLibrary(component.Guid);
                if (LW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }
                CompareComponentName(component, LW.Name, text, CMO);
                CompareComponentProjectPath(component, LW.ProjectPath, text, CMO);
                break;

                #endregion
                #region Feature
            case ComponentTypeWrapper.Feature:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                FeatureWrapper FW = PK.Wrapper.FindFeature(component.Guid);
                if (FW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }
                CompareComponentName(component, FW.Name, text, CMO);
                CompareComponentProjectPath(component, FW.ProjectPath, text, CMO);
                break;

                #endregion
                #region Assembly
            case ComponentTypeWrapper.MFAssembly:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                AssemblyWrapper AW = PK.Wrapper.FindAssembly(component.Guid);
                if (AW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }
                CompareComponentName(component, AW.Name, text, CMO);
                CompareComponentProjectPath(component, AW.ProjectPath, text, CMO);
                break;

                #endregion
            case ComponentTypeWrapper.MFSolution:
                break;

                #region Processors
            case ComponentTypeWrapper.Processor:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                ProcessorWrapper PW = PK.Wrapper.FindProcessor(component.Guid);
                if (PW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }
                CompareComponentName(component, PW.Name, text, CMO);
                CompareComponentProjectPath(component, PW.ProjectPath, text, CMO);
                break;

                #endregion
            case ComponentTypeWrapper.OperatingSystem:
                break;

            case ComponentTypeWrapper.BuildTool:
                break;

                #region ISA
            case ComponentTypeWrapper.ISA:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                ISAWrapper IW = PK.Wrapper.FindISA(component.Guid);
                if (IW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }
                CompareComponentName(component, IW.Name, text, CMO);
                break;

                #endregion
            case ComponentTypeWrapper.BuildParameter:
                break;

                #region LibraryCategory
            case ComponentTypeWrapper.LibraryCategory:
                if (!CheckComponentGUID(component, text, CMO))
                {
                    return;
                }

                LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(component.Guid);
                if (LCW == null)
                {
                    CanTFindComponentsReference(component, text, CMO);
                    return;
                }

                CompareComponentName(component, LCW.Name, text, CMO);

                CompareComponentProjectPath(component, LCW.ProjectPath, text, CMO);
                break;

                #endregion
                #region Unknown
            case ComponentTypeWrapper.Unknown:
                WEMessage UMessage = new WEMessage();
                UMessage.Message       = text + "Component with \"Type\": " + GetStringByComponentType(component.ComponentType);
                UMessage.MessageObject = CMO;
                this.OnWarning(UMessage);
                break;

                #endregion
            default:
                break;
            }
        }
Beispiel #47
0
        private void designer1_ElementSelection(object sender, ElementSelectionEventArgs e)
        {
            if (e.Elements.Count > 0)
            {
                if (e.Elements[0].GetType() == typeof(MFRectangleNode))
                {
                    MFRectangleNode  RectNode = (MFRectangleNode)e.Elements[0];
                    ComponentWrapper comp     = (ComponentWrapper)RectNode.Tag;

                    switch (comp.ComponentType)
                    {
                    case ComponentTypeWrapper.Library:
                        LibraryWrapper lib = PK.Wrapper.FindLibrary(comp.Guid);
                        if (lib != null)
                        {
                            this.OnSelectionChangeEvent(lib);
                        }
                        break;

                    case ComponentTypeWrapper.Feature:
                        FeatureWrapper feat = PK.Wrapper.FindFeature(comp.Guid);
                        if (feat != null)
                        {
                            this.OnSelectionChangeEvent(feat);
                        }
                        break;

                    case ComponentTypeWrapper.MFAssembly:
                        break;

                    case ComponentTypeWrapper.MFSolution:
                        break;

                    case ComponentTypeWrapper.Processor:
                        break;

                    case ComponentTypeWrapper.OperatingSystem:
                        break;

                    case ComponentTypeWrapper.BuildTool:
                        break;

                    case ComponentTypeWrapper.ISA:
                        break;

                    case ComponentTypeWrapper.BuildParameter:
                        break;

                    case ComponentTypeWrapper.LibraryCategory:
                        LibraryCategoryWrapper libcat = PK.Wrapper.FindLibraryCategory(comp.Guid);
                        if (libcat != null)
                        {
                            this.OnSelectionChangeEvent(libcat);
                        }
                        break;

                    case ComponentTypeWrapper.Unknown:
                        break;

                    default:
                        break;
                    }
                }
            }
        }
        public LibraryCategoryPageBase(LibraryCategoryWrapper LibCat)
        {
            InitializeComponent();

            this.LibCat = LibCat;
        }
Beispiel #49
0
 public MFLibCatTreeNode(LibraryCategoryWrapper libcat)
     : base(libcat.Name, ImageKeysEnum.LibraryCategory)
 {
     this.LibCat = libcat;
     this.Tag    = libcat;
 }
Beispiel #50
0
 private void ShowDescription(LibraryCategoryWrapper libcat)
 {
     DescriptionTB.AppendText("Name: " + libcat.Name + "\r\n\r\n");
     DescriptionTB.AppendText("Project Path:\r\n");
     DescriptionTB.AppendText(libcat.ProjectPath + "\r\n\r\n");
     DescriptionTB.AppendText("Required: " + libcat.Required + "\r\n\r\n");
     //DescriptionTB.AppendText("Sulution Visible: " + LCW.IsSolutionWizardVisible + "\r\n\r\n");
     DescriptionTB.AppendText("Description:\r\n");
     DescriptionTB.AppendText(libcat.Description + "\r\n\r\n");
 }