private void RecursiveCheckComponent(ComponentWrapper component) { if (this.References.RecursiveCheckComponent(component)) { _treeView.SetModel(InventoryBrowserModel.GetModel(this.References.GetNodes()), false); } }
public Lookup AddComponent(DataFlow dataFlowTask) { base.AddComponent(dataFlowTask.SSISObject, "DTSTransform.Lookup"); Component.RuntimeConnectionCollection[0].ConnectionManager = SSIS.DtsConvert.GetExtendedInterface(ConnectionManager.SSISObject); Component.RuntimeConnectionCollection[0].ConnectionManagerID = ConnectionManager.SSISObject.ID; ComponentWrapper.SetComponentProperty("CacheType", (int)CacheType); ComponentWrapper.SetComponentProperty("SqlCommand", SQLCommand); if (MatchBehaviour == NoMatchBehaviour.FailComponent || MatchBehaviour == NoMatchBehaviour.RedirectRowsToNoMatchOutput) { ComponentWrapper.SetComponentProperty("NoMatchBehavior", MatchBehaviour); } else if (MatchBehaviour == NoMatchBehaviour.IgnoreFailure) { ComponentWrapper.SetComponentProperty("NoMatchBehavior", NoMatchBehaviour.FailComponent); this.MatchOutput.SetErrorRowDisposition(RowDisposition.RD_IgnoreFailure); } else { ComponentWrapper.SetComponentProperty("NoMatchBehavior", NoMatchBehaviour.FailComponent); } return(this); }
public Lookup SetAdvancedParameters(LookupAdvancedParameters advanced) { this.Advanced = advanced; if (Advanced.HasSqlCommandParam) { ComponentWrapper.SetComponentProperty("SqlCommandParam", Advanced.SqlCommandParam); if (Advanced.HasParameters) { string parameterMap = string.Join(";", Advanced.Parameters.Select(par => "#" + FindSSISInputColumn(par).LineageID.ToString())) + ";"; ComponentWrapper.SetComponentProperty("ParameterMap", parameterMap); } } if (Advanced.HasCacheSize32Bit) { ComponentWrapper.SetComponentProperty("MaxMemoryUsage", Advanced.CacheSize32Bit); } if (Advanced.HasCacheSize64Bit) { ComponentWrapper.SetComponentProperty("MaxMemoryUsage64", Advanced.CacheSize64Bit); } if (Advanced.HasNoMatchCachePercentage) { ComponentWrapper.SetComponentProperty("NoMatchCachePercentage", Advanced.NoMatchCachePercentage); } return(this); }
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); }
private void ShowDescription(object sender, ComponentWrapper component) { if (sender == _treeView) { ReferenceData refData = this.References[component]; DescriptionTB.Clear(); if (refData.Wrapper is FeatureWrapper) { ShowDescription(refData.Wrapper as FeatureWrapper); } if (refData.Wrapper is LibraryWrapper) { ShowDescription(refData.Wrapper as LibraryWrapper); } if (refData.Wrapper is LibraryCategoryWrapper) { ShowDescription(refData.Wrapper as LibraryCategoryWrapper); } SetupTree(_dependTreeView, InventoryBrowserModel.GetModel(this.References.GetDependsFrom(component)), true); SetupTree(_referencedByTreeView, InventoryBrowserModel.GetModel(this.References.GetRequiredBy(component)), true); } else { //_treeView.SetSelectedComponent(component); } }
public static InventoryBrowserModel GetModel(ComponentWrapper component) { InventoryBrowserModel model = new InventoryBrowserModel(); model.Roots.Add(new ComponentNode(component, null)); return(model); }
protected Pipe.IDTSOutput100 AddSSISOutput(string outputName) { Pipe.IDTSOutput100 output = ComponentWrapper.InsertOutput(Pipe.DTSInsertPlacement.IP_AFTER, SSISDefaultOutput.ID); output.Name = outputName; output.Description = outputName; return(output); }
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(); } }
/// <summary> /// Mark the end of this job /// </summary> /// <param name="component">Last component to execute</param> public void End(Component <ComponentOut, JobOut> component) { ComponentWrapper <JobIn, JobOut, ComponentOut, JobOut> wrapperComponent = new ComponentWrapper <JobIn, JobOut, ComponentOut, JobOut>(component); _next = wrapperComponent; }
/// <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 CanTFindComponentsReference(ComponentWrapper component, string text, ComponentMessageObject CMO) { WEMessage message = new WEMessage(); message.Message = text + "Can't find " + GetStringByComponentType(component.ComponentType) + " with GUID " + component.Guid; message.MessageObject = CMO; this.OnWarning(message); }
public OLEDBCommand AddComponent(DataFlow dataFlowTask) { base.AddComponent(dataFlowTask.SSISObject, "DTSTransform.OLEDBCommand.3"); Component.RuntimeConnectionCollection[0].ConnectionManager = SSIS.DtsConvert.GetExtendedInterface(ConnectionManager.SSISObject); Component.RuntimeConnectionCollection[0].ConnectionManagerID = ConnectionManager.SSISObject.ID; ComponentWrapper.SetComponentProperty("SqlCommand", SQLCommand); return(this); }
public void SetSelectedComponent(ComponentWrapper component, BuildFileWrapper file) { TreeNodeAdv node = this.FindNode(component); if (node != null) { this.SetBuildFile(file, AllChildren(node)); } }
public void SetSelectedComponent(ComponentWrapper component) { TreeNodeAdv node = this.FindNode(component); if (node != null) { _treeView.SelectedNode = node; } }
private void _treeView_SelectionChangedEvent(object sender, BaseForms.ObjectEventArgs e) { ComponentWrapper wrapper = e.Object as ComponentWrapper; if (wrapper != null) { this.OnSelectionChangeEvent(wrapper); } }
private void _treeView_EditEvent(object sender, BaseForms.ObjectEventArgs e) { ComponentWrapper wrapper = e.Object as ComponentWrapper; if (wrapper != null) { this.OnEditEvent(wrapper); } }
protected void _treeView_SelectionChangedEvent(object sender, ObjectEventArgs e) { ComponentWrapper component = e.Object as ComponentWrapper; if (component != null) { ShowDescription(sender, component); } }
public OLEDBCommand AddParameterMapping(string columnName, int parameterNumber) { Refresh(); base.AddReadOnlyInputColumn(columnName); ComponentWrapper.MapInputColumn(DefaultInput.SSISObject.ID, base.FindSSISInputColumn(columnName).ID, DefaultInput.SSISObject.ExternalMetadataColumnCollection[parameterNumber].ID); return(this); }
private void CompareComponentName(ComponentWrapper component, string Name, string text, ComponentMessageObject CMO) { if (string.Compare(component.Name, Name, StringComparison.Ordinal) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Name mismatch. Component Name: \"" + component.Name + "\" " + GetStringByComponentType(component.ComponentType) + " Name:\"" + Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
/// <summary> /// Register a new component to execute after this one /// </summary> /// <typeparam name="TComponentOut">Output type of the component</typeparam> /// <param name="component">Component to add</param> /// <returns>A wrapper to chain components</returns> public ComponentWrapper <JobIn, JobOut, ComponentOut, TComponentOut> Then <TComponentOut>( Component <ComponentOut, TComponentOut> component) { ComponentWrapper <JobIn, JobOut, ComponentOut, TComponentOut> wrappedComponent = new ComponentWrapper <JobIn, JobOut, ComponentOut, TComponentOut>(component); _next = wrappedComponent; return(wrappedComponent); }
public static InventoryBrowserModel GetComponentNodeModel <T>(Array components) where T : BaseWrapper { InventoryBrowserModel model = new InventoryBrowserModel(); foreach (T component in components) { model.Roots.Add(new ComponentNode(ComponentWrapper.GetComponentWrapper(component), null)); } return(model); }
private void _treeView_SelectionChangedEvent(object sender, Forms.BaseForms.ObjectEventArgs e) { ComponentWrapper CW = e.Object as ComponentWrapper; if (CW != null) { ShowDescription(FindProjectTemplate(CW)); this.OnShowNextBtn(true); } }
private bool ContainsLibCat(ComponentWrapper libcat) { foreach (ComponentWrapper lc in this.LibraryCategories) { if (lc.Guid.ToLower() == libcat.Guid.ToLower()) { return(true); } } return(false); }
private bool ContainsFeature(ComponentWrapper feat) { foreach (ComponentWrapper f in this.Featuries) { if (f.Guid.ToLower() == feat.Guid.ToLower()) { return(true); } } return(false); }
private bool ContainsLibrary(ComponentWrapper lib) { foreach (ComponentWrapper l in this.Librares) { if (l.Guid.ToLower() == lib.Guid.ToLower()) { return(true); } } return(false); }
private ProjectWrapper FindProjectTemplate(ComponentWrapper CW) { foreach (ProjectWrapper project in PK.Wrapper.GetProjectTemplates()) { if (string.Compare(project.Name, CW.Name, true) == 0) { return(project); } } return(null); }
private void EditElement() { 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; this.OnEditEvent(comp); } } }
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 ShowDescription(ComponentWrapper processor) { ProcessorWrapper PW = PK.Wrapper.FindProcessor(processor.Guid); DescriptionTB.Clear(); if (PW != null) { DescriptionTB.AppendText("Name: " + PW.Name + "\r\n\r\n"); DescriptionTB.AppendText("Project Path:\r\n"); DescriptionTB.AppendText(PW.ProjectPath + "\r\n\r\n"); DescriptionTB.AppendText("Description:\r\n"); DescriptionTB.AppendText(PW.Description + "\r\n\r\n"); } }
private void CompareComponentProjectPath(ComponentWrapper component, string ProjectPath, string text, ComponentMessageObject CMO) { if (component.Name == "COM_PAL") { } if (string.Compare(component.ProjectPath, ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Project Path mismatch. Component Project Path: \"" + component.ProjectPath + "\" " + GetStringByComponentType(component.ComponentType) + " Project Path:\"" + ProjectPath + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
public SelectComponentDialog( bool Library, bool Feature, bool MFAssembly, bool MFSolution, bool Processor, bool OperatingSystem, bool BuildTool, bool ISA, bool BuildParameter, bool LibraryCategory ) { InitializeComponent(); this._libraryFilter = new LibFilter(); if (Library) TypeCb.Items.Add(ComponentTypeWrapper.Library); if (Feature) TypeCb.Items.Add(ComponentTypeWrapper.Feature); if (MFAssembly) TypeCb.Items.Add(ComponentTypeWrapper.MFAssembly); if (MFSolution) TypeCb.Items.Add(ComponentTypeWrapper.MFSolution); if (Processor) TypeCb.Items.Add(ComponentTypeWrapper.Processor); if (OperatingSystem) TypeCb.Items.Add(ComponentTypeWrapper.OperatingSystem); if (BuildTool) TypeCb.Items.Add(ComponentTypeWrapper.BuildTool); if (ISA) TypeCb.Items.Add(ComponentTypeWrapper.ISA); if (BuildParameter) TypeCb.Items.Add(ComponentTypeWrapper.BuildParameter); if (LibraryCategory) TypeCb.Items.Add(ComponentTypeWrapper.LibraryCategory); if (TypeCb.Items.Count != 0) TypeCb.SelectedIndex = 0; selectedComponent = null; }
private bool ContainsFeature(ComponentWrapper feat) { foreach (ComponentWrapper f in this.Featuries) { if (f.Guid.ToLower() == feat.Guid.ToLower()) return true; } return false; }
public void SetSelectedComponent(ComponentWrapper parent, ComponentWrapper component) { TreeNodeAdv node = this.FindNode(parent); if (node != null) { node = this.FindNode(component, AllChildren(node)); if (node != null) { _treeView.SelectedNode = node; } } }
private bool ContainsLibrary(ComponentWrapper lib) { foreach (ComponentWrapper l in this.Librares) { if (l.Guid.ToLower() == lib.Guid.ToLower()) return true; } return false; }
protected TreeNodeAdv FindNode(ComponentWrapper component, IEnumerable<TreeNodeAdv> nodes) { foreach (TreeNodeAdv node in nodes) { if (OnSetSelectedNode(this, node.Tag as BaseNode)) { BaseContentInventoryNode invNode = node.Tag as BaseContentInventoryNode; if (invNode != null) { if (component.IsSameGuid(invNode.Content)) { return node; } } } } return null; }
public LibraryWrapper FindLibrary(ComponentWrapper comp) { return this.m_helper.FindLibrary(comp); }
public void SetSelectedComponent(ComponentWrapper Parent, ComponentWrapper component) { _treeView.SetSelectedComponent(Parent, component); }
protected virtual bool OnCheckComponent(ComponentWrapper component) { return true; }
private ProjectWrapper FindProjectTemplate(ComponentWrapper CW) { foreach (ProjectWrapper project in PK.Wrapper.GetProjectTemplates()) { if (string.Compare(project.Name, CW.Name, true) == 0) { return project; } } return null; }
protected TreeNodeAdv FindNode(ComponentWrapper component) { return this.FindNode(component, _treeView.AllNodes); }
public void SetSelectedComponent(ComponentWrapper component, BuildFileWrapper file) { _treeView.SetSelectedComponent(component, file); }
public SearchComponentDescriptor(SearchComponentDescriptor Parent, ComponentWrapper Component) { this.Parent = Parent; this.Component = Component; this.File = null; this.Line = null; }
//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 } } }
private void _treeView_SelectionChangedEvent(object sender, Forms.BaseForms.ObjectEventArgs e) { ComponentWrapper CW = e.Object as ComponentWrapper; if (CW != null) { ShowDescription(CW); selectedProcessor = CW; this.OnShowNextBtn(true); } }
public LibraryWrapper CreateLibrary(string Name, LibraryLevelWrapper Level, string Description, string ProjectPath, bool IsTemplate, ComponentWrapper LibraryCategory) { Library library = new Library { Name = Name, Level = (LibraryLevel)Level, Description = Description, ProjectPath = ProjectPath }; LibraryWrapper wrapper = BaseWrapper.Wrap<LibraryWrapper>(library); wrapper.LibraryCategory = LibraryCategory; wrapper.IsTemplate = IsTemplate; return wrapper; }
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 void CopyTemplateFiles(LibraryCategoryWrapper libcat, SolutionWrapper solution, ComponentWrapper template) { this.m_bw.CopyTemplateFiles(libcat.InnerObject, solution.InnerObject, template.InnerObject); }
public Link(LINK_TYPE type, ComponentWrapper start, ComponentWrapper end) { this.Type = type; this.StartComponent = start; this.EndComponent = end; }
private bool ContainsLibCat(ComponentWrapper libcat) { foreach (ComponentWrapper lc in this.LibraryCategories) { if (lc.Guid.ToLower() == libcat.Guid.ToLower()) return true; } return false; }
private bool CheckComponentGUID(ComponentWrapper component, string text, ComponentMessageObject CMO) { if (string.IsNullOrEmpty(component.Guid)) { if (!string.IsNullOrEmpty(component.Name) || !string.IsNullOrEmpty(component.ProjectPath)) { WEMessage message = new WEMessage(); message.Message = text + "GUID missing in " + GetStringByComponentType(component.ComponentType); message.MessageObject = CMO; this.OnWarning(message); } return false; } return true; }