private void UpdateForm(LibraryWrapper Lib) { FormText = Strings.Library + " : " + Lib.Name; ModifiedFormText = FormText + "*"; this.Lib = Lib; this.Pages.Clear(); this.Pages.Add(new Editors.Pages.Library.MainPage(Lib)); this.Pages.Add(new Editors.Pages.DescriptionPage(Lib)); this.Pages.Add(new Editors.Pages.DocumentationPage(Lib)); this.Pages.Add(new Editors.Pages.Library.LibraryDependenciesPage(Lib)); this.Pages.Add(new Editors.Pages.Library.LibraryCategoryPage(Lib)); this.Pages.Add(new Editors.Pages.Library.ISASpecificPage(Lib)); this.Pages.Add(new Editors.Pages.Library.ProcessorSpecificPage(Lib)); //this.Pages.Add(new Editors.Pages.LibraryCategory.FlagsPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.FeatureAssociationsPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.TemplatesPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.LibraryProjCachePage(LibCat)); this.Initialize(); SetModified(false); }
public MainPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); GroupsCb.Items.Clear(); GroupsCb.Items.Add(""); foreach (LibraryWrapper lib in PK.Wrapper.GetLibraries()) { if (!GroupsCb.Items.Contains(lib.Groups)) { GroupsCb.Items.Add(lib.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 MFLibraryTreeNode(LibraryWrapper library, ref SortedDictionary<string, TreeNode> GroupsDict, ref SortedList<string, TreeNode> VoidGroupsList) : this(library) { List<BuildFileWrapper> source_list = new List<BuildFileWrapper>(this.Lib.FastCompileFiles); source_list.AddRange(this.Lib.HeaderFiles); source_list.AddRange(this.Lib.SourceFiles); //Dictionary<string, MFBuildFile> unic_source_list = new Dictionary<string, MFBuildFile>(); //foreach (MFBuildFile source_file in source_list) //{ // unic_source_list.Add(source_file.File, source_file); //} AddFileList(new CollectionWrapper<BuildFileWrapper, MFBuildFile>(source_list), this.Lib.ProjectPath); if (! string.IsNullOrEmpty(this.Lib.Groups)) { if (!GroupsDict.ContainsKey(this.Lib.Groups)) { MFTreeNodeBase GroupNode = new MFDirectoryTreeNode(Lib.Groups);//this.NewNode(lib.Groups, MFTreeNodeBase.TreeNodeType.Directory, MFTreeNodeBase.ImageKeysEnum.CollapsedDirectory); GroupNode.Nodes.Add(this); GroupsDict.Add(this.Lib.Groups, GroupNode); } else { GroupsDict[this.Lib.Groups].Nodes.Add(this); } } else { VoidGroupsList.Add(this.Text, this); } }
public MainPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); GroupsCb.Items.Clear(); GroupsCb.Items.Add(""); foreach (LibraryWrapper lib in PK.Wrapper.GetLibraries()) { if (!GroupsCb.Items.Contains(lib.Groups)) { GroupsCb.Items.Add(lib.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 MFLibraryTreeNode(LibraryWrapper library, ref SortedDictionary <string, TreeNode> GroupsDict, ref SortedList <string, TreeNode> VoidGroupsList) : this(library) { List <BuildFileWrapper> source_list = new List <BuildFileWrapper>(this.Lib.FastCompileFiles); source_list.AddRange(this.Lib.HeaderFiles); source_list.AddRange(this.Lib.SourceFiles); //Dictionary<string, MFBuildFile> unic_source_list = new Dictionary<string, MFBuildFile>(); //foreach (MFBuildFile source_file in source_list) //{ // unic_source_list.Add(source_file.File, source_file); //} AddFileList(new CollectionWrapper <BuildFileWrapper, MFBuildFile>(source_list), this.Lib.ProjectPath); if (!string.IsNullOrEmpty(this.Lib.Groups)) { if (!GroupsDict.ContainsKey(this.Lib.Groups)) { MFTreeNodeBase GroupNode = new MFDirectoryTreeNode(Lib.Groups);//this.NewNode(lib.Groups, MFTreeNodeBase.TreeNodeType.Directory, MFTreeNodeBase.ImageKeysEnum.CollapsedDirectory); GroupNode.Nodes.Add(this); GroupsDict.Add(this.Lib.Groups, GroupNode); } else { GroupsDict[this.Lib.Groups].Nodes.Add(this); } } else { VoidGroupsList.Add(this.Text, this); } }
public DialogResult ShowDialog(IWin32Window owner, LibraryWrapper Lib) { this.Text = Strings.CloneLibraryCategory; this.Library = Lib; FillFields(); if (GroupsCb.Items.Contains(Lib.Groups)) GroupsCb.SelectedItem = Lib.Groups; else { if (GroupsCb.Items.Count > 0) GroupsCb.SelectedIndex = 0; } string projname = Path.GetFileNameWithoutExtension(Lib.ProjectPath); if (Lib.Name.Contains("test") && projname.Contains("_test")) { TestCb.Checked = true; } else TestCb.Checked = false; IsStubCb.Checked = Lib.IsStub; NameTb.Text = PK.Wrapper.GenerateNewLibraryName(Lib.Name); LevelCb.SelectedItem = Lib.Level; DirectoryTb.Text = Path.GetDirectoryName(Lib.ProjectPath); ProjNameTb.Text = GenerateNewProjName(projname); SetSuffixs(); return this.ShowDialog(owner); }
private void UpdateForm(LibraryWrapper Lib) { FormText = Strings.Library+" : " + Lib.Name; ModifiedFormText = FormText + "*"; this.Lib = Lib; this.Pages.Clear(); this.Pages.Add(new Editors.Pages.Library.MainPage(Lib)); this.Pages.Add(new Editors.Pages.DescriptionPage(Lib)); this.Pages.Add(new Editors.Pages.DocumentationPage(Lib)); this.Pages.Add(new Editors.Pages.Library.LibraryDependenciesPage(Lib)); this.Pages.Add(new Editors.Pages.Library.LibraryCategoryPage(Lib)); this.Pages.Add(new Editors.Pages.Library.ISASpecificPage(Lib)); this.Pages.Add(new Editors.Pages.Library.ProcessorSpecificPage(Lib)); //this.Pages.Add(new Editors.Pages.LibraryCategory.FlagsPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.FeatureAssociationsPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.TemplatesPage(LibCat)); //this.Pages.Add(new Editors.Pages.LibraryCategory.LibraryProjCachePage(LibCat)); this.Initialize(); SetModified(false); }
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); }
public DocumentationPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); HeaderLbl.Text = this.NodeName; }
protected IEventComponent ShowLibraryEditorByGuid(string guid) { bool exist = false; foreach (DockContent item in DockPanel.Contents) { if (item.GetType() == typeof(LibraryEditor)) { LibraryEditor editor = (LibraryEditor)item; if (editor.Library.Guid == guid) { editor.Show(); exist = true; } } } if (!exist) { LibraryWrapper lib = PK.Wrapper.FindLibrary(guid); if (lib != null) { LE = new LibraryEditor(); LE.OpenContainingFolderEvent += new EventHandler <Forms.BaseForms.PathEventArgs>(OpenContainingFolderEvent); LE.SetLib(lib); LE.Show(DockPanel, DockState.Document); return(LE); } } return(null); }
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(); } }
public DescriptionPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); HeaderLbl.Text = this.NodeName; }
public MFLibraryTreeNode(LibraryWrapper library) : base(library.Name, ImageKeysEnum.Library) { this.Lib = library; this.Tag = library; }
public DialogResult ShowDialog(IWin32Window owner, string groups) { this.Text = Strings.NewLibraryCategory; this.Library = null; FillFields(); if (GroupsCb.Items.Contains(groups)) GroupsCb.SelectedItem = groups; else { if (GroupsCb.Items.Count > 0) GroupsCb.SelectedIndex = 0; } ProjNameTb.Text = "dotNetMF"; //DirectoryTb.Text = PK.Wrapper.SpoClientPath; DirectoryTb.Text = "$(SPOCLIENT)"; TestCb.Checked = false; IsStubCb.Checked = false; SetSuffixs(); NameTb.Text = PK.Wrapper.GenerateNewLibraryName("NewLibrary" + nameSuffixLbl.Text); return this.ShowDialog(owner); }
public DialogResult ShowDialog(IWin32Window owner, string groups) { this.Text = Strings.NewLibraryCategory; this.Library = null; FillFields(); if (GroupsCb.Items.Contains(groups)) { GroupsCb.SelectedItem = groups; } else { if (GroupsCb.Items.Count > 0) { GroupsCb.SelectedIndex = 0; } } ProjNameTb.Text = "dotNetMF"; //DirectoryTb.Text = PK.Wrapper.SpoClientPath; DirectoryTb.Text = "$(SPOCLIENT)"; TestCb.Checked = false; IsStubCb.Checked = false; SetSuffixs(); NameTb.Text = PK.Wrapper.GenerateNewLibraryName("NewLibrary" + nameSuffixLbl.Text); return(this.ShowDialog(owner)); }
/// <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); }
private void OpenComponentEditor(ComponentWrapper comp) { switch (comp.ComponentType) { case ComponentTypeWrapper.Library: if (PK.Wrapper.Solution != null) { LibraryWrapper LW = PK.Wrapper.FindLibrary(comp); if ((LW != null) && (!PK.Wrapper.Solution.IsReference(LW))) { mSolutionExplorer.Show(dockPanel1); mSolutionExplorer.SetSelectedComponent(comp); } else { mLibrariesExplorer.Show(dockPanel1); mLibrariesExplorer.SetSelectedComponent(comp); } } else { mLibrariesExplorer.Show(dockPanel1); mLibrariesExplorer.SetSelectedComponent(comp); } break; case ComponentTypeWrapper.Feature: mFeaturesExplorer.Show(dockPanel1); mFeaturesExplorer.SetSelectedComponent(comp); break; case ComponentTypeWrapper.LibraryCategory: mLibraryCategoriesExplorer.Show(dockPanel1); mLibraryCategoriesExplorer.SetSelectedComponent(comp); break; case ComponentTypeWrapper.MFAssembly: mAssembliesExplorer.Show(dockPanel1); mAssembliesExplorer.SetSelectedComponent(comp); break; case ComponentTypeWrapper.MFSolution: case ComponentTypeWrapper.Processor: case ComponentTypeWrapper.OperatingSystem: case ComponentTypeWrapper.BuildTool: case ComponentTypeWrapper.ISA: case ComponentTypeWrapper.BuildParameter: case ComponentTypeWrapper.Unknown: default: //mEditorsController.ShowEditor(e.Object); break; } }
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; } }
private void OtBtn_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(DirectoryTb.Text)) { throw new DirectoryNotFoundException(Strings.VoidDirectoryField + "."); } if (PK.Wrapper.CheckLibraryName(NameTb.Text + nameSuffixLbl.Text)) { throw new ArgumentException(Strings.Library + " \"" + NameTb.Text + nameSuffixLbl.Text + "\"" + Strings.AlreadyExist + "."); } string path = PK.Wrapper.ExpandEnvVars(DirectoryTb.Text, "") + "\\" + ProjNameTb.Text + projSuffixLbl.Text + ".proj"; if (File.Exists(path)) { throw new ArgumentException(Strings.File + "\r\n\"" + path + "\"\r\n" + Strings.AlreadyExist + "."); } if (this.Library != null) { this.Library = PK.Wrapper.CloneLibrary ( this.Library, NameTb.Text + nameSuffixLbl.Text, GroupsCb.Text, DirectoryTb.Text + "\\" + ProjNameTb.Text + projSuffixLbl.Text + ".proj", (LibraryLevelWrapper)LevelCb.SelectedItem, IsStubCb.Checked ); } else { this.Library = PK.Wrapper.CreateLibrary ( NameTb.Text + nameSuffixLbl.Text, GroupsCb.Text, DirectoryTb.Text + "\\" + ProjNameTb.Text + projSuffixLbl.Text + ".proj", (LibraryLevelWrapper)LevelCb.SelectedItem, IsStubCb.Checked ); } // this.Library = PK.Wrapper.CreateLibrary(RealNameLbl.Text, GroupsCb.Text, this.DirectoryTb.Text); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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()); }
public BaseWrapper[] GetLibraries(ProjectWrapper project) { List <BaseWrapper> libs = new List <BaseWrapper>(); foreach (ComponentWrapper comp in project.Libraries) { LibraryWrapper lib = PK.Wrapper.FindLibrary(comp.Guid); if (lib != null) { bool isReference = !this.TypedContent.IsReference(lib); if (isReference) { libs.Add(lib); } } } return(libs.ToArray()); }
public DialogResult ShowDialog(IWin32Window owner, LibraryWrapper Lib) { this.Text = Strings.CloneLibraryCategory; this.Library = Lib; FillFields(); if (GroupsCb.Items.Contains(Lib.Groups)) { GroupsCb.SelectedItem = Lib.Groups; } else { if (GroupsCb.Items.Count > 0) { GroupsCb.SelectedIndex = 0; } } string projname = Path.GetFileNameWithoutExtension(Lib.ProjectPath); if (Lib.Name.Contains("test") && projname.Contains("_test")) { TestCb.Checked = true; } else { TestCb.Checked = false; } IsStubCb.Checked = Lib.IsStub; NameTb.Text = PK.Wrapper.GenerateNewLibraryName(Lib.Name); LevelCb.SelectedItem = Lib.Level; DirectoryTb.Text = Path.GetDirectoryName(Lib.ProjectPath); ProjNameTb.Text = GenerateNewProjName(projname); SetSuffixs(); return(this.ShowDialog(owner)); }
private void ShowDescription(LibraryWrapper library) { DescriptionTB.AppendText("Name: " + library.Name + "\r\n\r\n"); DescriptionTB.AppendText("Project Path:\r\n"); DescriptionTB.AppendText(library.ProjectPath + "\r\n\r\n"); DescriptionTB.AppendText("Required: " + library.Required + "\r\n\r\n"); if (!string.IsNullOrEmpty(library.CustomFilter)) { DescriptionTB.AppendText("Custom Filter: " + library.CustomFilter + "\r\n\r\n"); } if (library.ProcessorSpecific != null) { if (!string.IsNullOrEmpty(library.ProcessorSpecific.Name)) { DescriptionTB.AppendText("Processor Specific: " + library.ProcessorSpecific.Name + "\r\n\r\n"); } } //DescriptionTB.AppendText("Sulution Visible: " + LCW.IsSolutionWizardVisible + "\r\n\r\n"); DescriptionTB.AppendText("Description:\r\n"); DescriptionTB.AppendText(library.Description + "\r\n\r\n"); }
public ProcessorSpecificPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.ProcessorSpecific) { }
public LibraryCategoryPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.LibraryCategory) { }
public LibraryPageBase(LibraryWrapper Lib) { InitializeComponent(); this.Lib = Lib; }
private void ShowDescription(LibraryWrapper library) { DescriptionTB.AppendText("Name: " + library.Name + "\r\n\r\n"); DescriptionTB.AppendText("Project Path:\r\n"); DescriptionTB.AppendText(library.ProjectPath + "\r\n\r\n"); DescriptionTB.AppendText("Required: " + library.Required + "\r\n\r\n"); if (!string.IsNullOrEmpty(library.CustomFilter)) DescriptionTB.AppendText("Custom Filter: " + library.CustomFilter + "\r\n\r\n"); if (library.ProcessorSpecific != null) { if (!string.IsNullOrEmpty(library.ProcessorSpecific.Name)) DescriptionTB.AppendText("Processor Specific: " + library.ProcessorSpecific.Name + "\r\n\r\n"); } //DescriptionTB.AppendText("Sulution Visible: " + LCW.IsSolutionWizardVisible + "\r\n\r\n"); DescriptionTB.AppendText("Description:\r\n"); DescriptionTB.AppendText(library.Description + "\r\n\r\n"); }
private void CheckLibrary(LibraryWrapper lib, string what, bool MatchCase, bool MatchWholeWord) { CheckLibrary(null, lib, what, MatchCase, MatchWholeWord); }
private void CheckLibrary(SearchResultsHolder.SearchComponentDescriptor ProjectDesc, LibraryWrapper lib, string what, bool MatchCase, bool MatchWholeWord) { SearchResultsHolder.SearchComponentDescriptor CompDesc = new SearchResultsHolder.SearchComponentDescriptor(ComponentWrapper.GetComponentWrapper(lib)); if (ProjectDesc != null) CompDesc.Parent = ProjectDesc; m_SearchResults.TotalComponentsSearched++; if (MatchWholeWord) { if (MatchCase) { if (lib.Name == what) { m_SearchResults.FindedComponents.Add(CompDesc); OnElementFinded(CompDesc); } } else { if (lib.Name.ToLower() == what.ToLower()) { m_SearchResults.FindedComponents.Add(CompDesc); OnElementFinded(CompDesc); } } } else { if (MatchCase) { if (lib.Name.Contains(what)) { m_SearchResults.FindedComponents.Add(CompDesc); OnElementFinded(CompDesc); } } else { if (lib.Name.ToLower().Contains(what.ToLower())) { m_SearchResults.FindedComponents.Add(CompDesc); OnElementFinded(CompDesc); } } } }
public void SaveLibraryProj(LibraryWrapper lib) { lib.Properties.Clear(); m_bw.SaveLibraryProj(lib.InnerObject); this.LoadDefaultLibrariesAsync(); }
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 ISASpecificPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.ISASpecific) { }
public LibraryDependenciesPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.Dependencies) { InitializeComponent(); }
private void OtBtn_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(DirectoryTb.Text)) throw new DirectoryNotFoundException(Strings.VoidDirectoryField+ "."); if (PK.Wrapper.CheckLibraryName(NameTb.Text + nameSuffixLbl.Text)) throw new ArgumentException(Strings.Library + " \"" + NameTb.Text + nameSuffixLbl.Text + "\"" + Strings.AlreadyExist + "."); string path = PK.Wrapper.ExpandEnvVars(DirectoryTb.Text, "") +"\\"+ ProjNameTb.Text + projSuffixLbl.Text+".proj"; if (File.Exists(path)) throw new ArgumentException(Strings.File + "\r\n\"" + path + "\"\r\n" + Strings.AlreadyExist + "."); if (this.Library != null) { this.Library = PK.Wrapper.CloneLibrary ( this.Library, NameTb.Text + nameSuffixLbl.Text, GroupsCb.Text, DirectoryTb.Text + "\\" + ProjNameTb.Text + projSuffixLbl.Text + ".proj", (LibraryLevelWrapper)LevelCb.SelectedItem, IsStubCb.Checked ); } else { this.Library = PK.Wrapper.CreateLibrary ( NameTb.Text + nameSuffixLbl.Text, GroupsCb.Text,DirectoryTb.Text+"\\"+ProjNameTb.Text+projSuffixLbl.Text+".proj", (LibraryLevelWrapper)LevelCb.SelectedItem, IsStubCb.Checked ); } // this.Library = PK.Wrapper.CreateLibrary(RealNameLbl.Text, GroupsCb.Text, this.DirectoryTb.Text); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public DependenciesPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); HeaderLbl.Text = this.NodeName; }
public void DeleteLibrary(LibraryWrapper lib) { string path = MsBuildWrapper.ExpandEnvVars(lib.ProjectPath, ""); File.Delete(path); this.LoadDefaultLibrariesAsync(); }
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; } }
public DependenciesPage(LibraryWrapper Lib) : base(Lib) { InitializeComponent(); HeaderLbl.Text = this.NodeName; }
private object GetMFObjectFromProjectFile(string path) { Project proj = PK.Wrapper.LoadProject(path); string guid = string.Empty; string settingsFile = string.Empty; foreach (ProjectPropertyGroupElement PG in proj.Xml.PropertyGroups) { foreach (ProjectPropertyElement prop in PG.Properties) { if (prop.Name == "ProjectGuid") { guid = prop.Value; } if (prop.Name == "MFSettingsFile") { settingsFile = prop.Value; } } } LibraryWrapper lib = null; ProjectWrapper project = null; //if(guid == string.Empty) return null; lib = PK.Wrapper.FindLibrary(guid); if (lib != null) { return(lib); } foreach (var item in PK.Wrapper.Solution.Projects) { if (item.Guid == guid) { project = item; return(project); } } //Ru: смотрим солюшен ли это //En: Is this solution? if (!string.IsNullOrEmpty(settingsFile)) { proj = PK.Wrapper.LoadProject(PK.Wrapper.ExpandEnvVars(settingsFile, "")); foreach (ProjectPropertyGroupElement PG in proj.Xml.PropertyGroups) { foreach (ProjectPropertyElement prop in PG.Properties) { if (prop.Name == "PlatformGuid") { guid = prop.Value; if (PK.Wrapper.Solution.Guid == guid) { return(PK.Wrapper.Solution); } } } } } return(null); }
public LibraryWrapper CloneLibrary(LibraryWrapper BaseLib, string NewName, string NewGroups, string NewPath, LibraryLevelWrapper NewLevel, bool NewIsStub) { Library Lib = new Library(); BaseLib.InnerObject.CopyTo(Lib); Lib.Name = NewName; Lib.Groups = NewGroups; Lib.ProjectPath = NewPath; Lib.Level = (LibraryLevel)NewLevel; Lib.IsStub = NewIsStub; Lib.LibraryFile = Lib.Name + ".$(LIB_EXT)"; Lib.ManifestFile = Lib.Name + ".$(LIB_EXT).manifest"; Lib.Properties.Clear(); return BaseWrapper.Wrap<LibraryWrapper>(Lib); }
/// <summary> /// Sets Libraray for edition /// </summary> /// <param name="LibCat"></param> public void SetLib(LibraryWrapper Lib) { UpdateForm(Lib); }
/// <summary> /// 加载程序集 /// </summary> private void LoadAssembly() { try { string path = Path.GetFullPath(string.Format("{0}\\{1}", LibraryWrapper.ProcessorArchitecture, DllName)); _wrapper = new LibraryWrapper(path, "thostmduserapi.dll"); #region 读取方法入口列表 string resourceName = string.Format("CTPMarketApi.Entry{0}.txt", LibraryWrapper.IsAmd64 ? "64" : "32"); var assembly = System.Reflection.Assembly.GetExecutingAssembly(); Stream stream = assembly.GetManifestResourceStream(resourceName); if (stream != null) { using (StreamReader reader = new StreamReader(stream)) { string text = reader.ReadToEnd(); string entryStart = "ordinal hint"; int start = text.IndexOf(entryStart); if (start > -1) { string[] arr = text.Substring(start).Split('\n'); if (arr.Length > 1) { for (int i = 1; i < arr.Length; i++) { string[] list = arr[i].Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (list.Length > 4) { _entryList.Add(list[3]); } } } } } stream.Close(); } if (_entryList.Count == 0) { throw new Exception(string.Format("Cannot find entry point form resource {0}", resourceName)); } #endregion #region 获取非托管方法 createSpi = GetDelegate <DelegateCreateSpi>("CreateSpi"); getApiVersion = GetDelegate <DelegateGetString>("GetApiVersion"); getTradingDay = GetDelegate <DelegatetTradingDay>("GetTradingDay"); connect = GetDelegate <DelegateConnect>("Connect"); disconnect = GetDelegate <DelegateDisconnect>("DisConnect"); userLogin = GetDelegate <DelegateUserLogin>("ReqUserLogin"); userLogout = GetDelegate <DelegateUserLogout>("ReqUserLogout"); subscribeMarketData = GetDelegate <DelegateSubscribeMarketData>("SubMarketData"); unsubscribeMarketData = GetDelegate <DelegateUnsubscribeMarketData>("UnSubscribeMarketData"); regOnRspError = GetDelegate <DelegateRegOnRspError>("RegOnRspError"); regOnHeartBeatWarning = GetDelegate <DelegateRegOnHeartBeatWarning>("RegOnHeartBeatWarning"); regOnFrontConnected = GetDelegate <DelegateRegOnFrontConnected>("RegOnFrontConnected"); regOnFrontDisconnected = GetDelegate <DelegateRegOnFrontDisconnected>("RegOnFrontDisconnected"); regOnRspUserLogin = GetDelegate <DelegateRegOnRspUserLogin>("RegOnRspUserLogin"); regOnRspUserLogout = GetDelegate <DelegateRegOnRspUserLogout>("RegOnRspUserLogout"); regOnRspSubMarketData = GetDelegate <DelegateRegOnRspSubMarketData>("RegOnRspSubMarketData"); regOnRspUnSubMarketData = GetDelegate <DelegateRegOnRspUnSubMarketData>("RegOnRspUnSubMarketData"); regOnRtnDepthMarketData = GetDelegate <DelegateRegOnRtnDepthMarketData>("RegOnRtnDepthMarketData"); #endregion _spi = createSpi(); } catch (Exception ex) { throw ex; } }
public ISASpecificPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.ISASpecific) { }
/// <summary> /// Sets Libraray for edition /// </summary> /// <param name="LibCat"></param> public void SetLib(LibraryWrapper Lib) { UpdateForm(Lib); }
public LibraryCategoryPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.LibraryCategory) { }
public MFProjectTreeNode(ProjectWrapper project) : base(project.Name, ImageKeysEnum.Project) { this.Project = project; this.Tag = project; #region Features MFTreeNodeBase FeaturesNode = new MFComponentsTreeNode("Features");//this.NewNode("Features", MFTreeNodeBase.TreeNodeType.Components, null, MFTreeNodeBase.ImageKeysEnum.Components); this.Nodes.Add(FeaturesNode); foreach (ComponentWrapper feat in this.Project.Features) { //FeatureWrapper f = PK.Wrapper.FindFeature(feat.Guid); MFTreeNodeBase FeatNode = new MFFeatureTreeNode(PK.Wrapper.FindFeature(feat.Guid));//this.NewNode(f.Name, MFTreeNodeBase.TreeNodeType.Feature, f, MFTreeNodeBase.ImageKeysEnum.Feature); FeaturesNode.Nodes.Add(FeatNode); } #endregion #region Library Categories MFTreeNodeBase LibraryCategoriesNode = new MFComponentsTreeNode("Library Categories");//this.NewNode("Library Categories", MFTreeNodeBase.TreeNodeType.Components, null, MFTreeNodeBase.ImageKeysEnum.Components); this.Nodes.Add(LibraryCategoriesNode); foreach (ComponentWrapper LibCat in this.Project.LibraryCategories) { MFTreeNodeBase LibCatNode = new MFLibCatTreeNode(PK.Wrapper.FindLibraryCategory(LibCat.Guid));//this.NewNode(lc.Name, MFTreeNodeBase.TreeNodeType.LibCat, lc, MFTreeNodeBase.ImageKeysEnum.LibraryCategory); LibraryCategoriesNode.Nodes.Add(LibCatNode); } #endregion #region Libraries MFTreeNodeBase LibraryesNode = new MFComponentsTreeNode("Libraries");//this.NewNode("Libraries", MFTreeNodeBase.TreeNodeType.Components, null, MFTreeNodeBase.ImageKeysEnum.Components); this.Nodes.Add(LibraryesNode); //Groups Libraries Dictionary SortedDictionary <string, TreeNode> LibGroupsDict = new SortedDictionary <string, TreeNode>(); SortedList <string, TreeNode> LibVoidGroupsList = new SortedList <string, TreeNode>(); foreach (ComponentWrapper l in this.Project.Libraries) { LibraryWrapper lib = PK.Wrapper.FindLibrary(l); if (lib != null) { //MFTreeNodeBase LibNode = new MFLibraryTreeNode(lib, ref LibGroupsDict, ref LibVoidGroupsList);//this.NewNode(lib.Name, MFTreeNodeBase.TreeNodeType.Lib, lib, MFTreeNodeBase.ImageKeysEnum.Library); } } foreach (TreeNode tn in LibVoidGroupsList.Values) { LibraryesNode.Nodes.Add(tn); } foreach (TreeNode tn in LibGroupsDict.Values) { LibraryesNode.Nodes.Add(tn); } List <BuildFileWrapper> source_files = new List <BuildFileWrapper>(Project.SourceFiles); source_files.AddRange(Project.HeaderFiles); source_files.AddRange(Project.OtherFiles); source_files.Add(Project.ScatterFile); AddFileList(new CollectionWrapper <BuildFileWrapper, MFBuildFile>(source_files), this.Project.ProjectPath); #endregion }
public ProcessorSpecificPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.ProcessorSpecific) { }
//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 } } }
public LibraryDependenciesPage(LibraryWrapper Wrapper) : base(Wrapper, Strings.Dependencies) { InitializeComponent(); }
public MFLibraryTreeNode(LibraryWrapper library) : base(library.Name, ImageKeysEnum.Library) { this.Lib = library; this.Tag = library; }
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; } } } }