void Logger_ErrorEvent(object sender, PKStudio.Helpers.ErrorEventArgs e) { if (this.ErrorsBtn.Checked) { AddError(e.Error); } this.ErrorsAndWarningsList.AddError(e.Error); LVColumnsResize(); SetBtnText(ErrorsBtn, ErrorsAndWarningsList.ErrorsCount + " Errors"); }
private string GetComponentName(PKStudio.PortingKitWrapper.SearchResultsHolder.SearchComponentDescriptor ComponentDescriptor) { string result = string.Empty; if (ComponentDescriptor.Parent != null) { result += GetComponentName(ComponentDescriptor.Parent) + "\\"; } if (ComponentDescriptor.Component != null) result += ComponentDescriptor.Component.Name; else if (ComponentDescriptor.File != null) result +=Path.GetFileName(ComponentDescriptor.File.File); return result; }
void PKWrapper_SearchComplitedEvent(object sender, PKStudio.PortingKitWrapper.SearchComplitedEventArgs e) { //SortList(); AddTextInList(Strings.MatchingComponents + " : " + e.SearchResults.FindedComponents.Count + " " + Strings.TotalComponentsSearched + " : " + e.SearchResults.TotalComponentsSearched); AutoResizeList(); }
void OnShowPropertiesEvent(object sender, PKStudio.Forms.BaseForms.ObjectEventArgs e) { mProperties.SetObject(e.Object); mProperties.Show(dockPanel1); }
void Logger_ErrorEvent(object sender, PKStudio.Helpers.ErrorEventArgs e) { string line = string.Empty; if ((e.Error.MessageObject as FileMessageObject) != null) { FileMessageObject FMO = e.Error.MessageObject as FileMessageObject; if (FMO.File == "EXEC") { line = Strings.Error + " " + e.Error.Message; } else { line = FMO.File + "(" + FMO.LineNumber + "," + FMO.ColumnNumber + "): " + Strings.Error + " " + e.Error.Code + ": " + e.Error.Message; } } if ((e.Error.MessageObject as ComponentMessageObject) != null) { ComponentMessageObject CMO = e.Error.MessageObject as ComponentMessageObject; line = CMO.Component.Name + ": " + Strings.Error + " " + e.Error.Code + ": " + e.Error.Message; } if (e.Error.MessageObject == null) { } if (!string.IsNullOrEmpty(line)) { this.AppendText(line + "\r\n"); int linenum = GetOutputLinesCount() - 2;//En: -2 because last line always empty Ru: -2 потому что последняя линяя всегда пустая ErrorsAndWarningsDict.Add(linenum, e.Error); } }
void OnGenerateEvent(object sender, PKStudio.Forms.BaseForms.GenerateEventArgs e) { switch (e.Type) { case PKStudio.Forms.BaseForms.GenerateTypes.KeilProject: //mKeilGeneratorTool.SetProject((MFSolution)obj); //mKeilGeneratorTool.Show(dockPanel1, DockState.Document); break; default: break; } }
void OnEditEvent(object sender, PKStudio.Forms.BaseForms.ObjectEventArgs e) { if (e.Object is ComponentWrapper) { ComponentWrapper comp = (ComponentWrapper)e.Object; OpenComponentEditor(comp); } else if (e.Object is PortingKitWrapper.SearchResultsHolder.SearchComponentDescriptor) { PortingKitWrapper.SearchResultsHolder.SearchComponentDescriptor compDesc = (PortingKitWrapper.SearchResultsHolder.SearchComponentDescriptor)e.Object; if (compDesc.File != null) { if ((compDesc.Parent.Parent == null)) //En: have received file and library that contains it. Ru: получены файл и библиотека его содержащая { mLibrariesExplorer.SetSelectedComponent(compDesc.Parent.Component, compDesc.File); mLibrariesExplorer.Show(dockPanel1); } else //En: Library have Parent - it's Project. Ru: У Library есть Parent - проект { mSolutionExplorer.SetSelectedComponent(compDesc.File); mSolutionExplorer.Show(dockPanel1); } if (compDesc.Line != null) { PKStudio.Helpers.EditorsFormsController.EditFileDescriptor desc = new EditorsFormsController.EditFileDescriptor(); desc.Path = compDesc.File.FullPath; desc.Line = compDesc.Line.Num; mEditorsController.ShowEditor(desc); } } if (compDesc.Component != null) { if (compDesc.Parent != null) { mSolutionExplorer.SetSelectedComponent(compDesc.Parent.Component, compDesc.Component); mSolutionExplorer.Show(dockPanel1); } else { OpenComponentEditor(compDesc.Component); } } } else { mEditorsController.ShowEditor(e.Object); //mLibrariesExplorer.SetSelectedComponent(e.Object); } }
void PKWrapper_SearchComplitedEvent(object sender, PKStudio.PortingKitWrapper.SearchComplitedEventArgs e) { mFindResultsForm.Show(dockPanel1); ProgressBar.Value = 100; SetProgressLabelText(Strings.Ready); }
void OnSelectionChangedEvent(object sender, PKStudio.Forms.BaseForms.ObjectEventArgs e) { mProperties.SetObject(e.Object); }
void OnShowReferencesDiagramEvent(object sender, PKStudio.Forms.BaseForms.ObjectEventArgs e) { mComponentReferencesDiagramForm.SetObject(e.Object); mComponentReferencesDiagramForm.Show(dockPanel1); }
void Wrapper_LoadSolutionAsyncCompleteEvent(object sender, PKStudio.PortingKitWrapper.LoadSolutionAsyncCompletedEventArgs e) { mSolutionExplorer.Show(dockPanel1, DockState.DockLeft); uVisionProjectGenerationToolStripMenuItem.Visible = true; buildToolStripMenuItem1.DropDownItems.Clear(); rebuildToolStripMenuItem.DropDownItems.Clear(); //BuildAllItem AddToolStripMenuItem(buildToolStripMenuItem1, "All Projects", "Build", BuildAllItem_Click, true); //BuildLocalAllItem AddToolStripMenuItem(buildLocalToolStripMenuItem, "All Projects", "BuildLocal", BuildAllItem_Click, true); //FastBuildAllItem AddToolStripMenuItem(fastBuildToolStripMenuItem, "All Projects", "FastBuild", BuildAllItem_Click, true); //ReBuildAllItem AddToolStripMenuItem(rebuildToolStripMenuItem, "All Projects", "Rebuild", BuildAllItem_Click, true); foreach (ProjectWrapper proj in e.Solution.Projects) { //BuildItem AddToolStripMenuItem(buildToolStripMenuItem1, proj.Name, proj, BuildItem_Click); //BuildLocalItem AddToolStripMenuItem(buildLocalToolStripMenuItem, proj.Name, proj, BuildLocalItem_Click); //FastBuildItem AddToolStripMenuItem(fastBuildToolStripMenuItem, proj.Name, proj, FastBuildItem_Click); //ReBuildItem AddToolStripMenuItem(rebuildToolStripMenuItem, proj.Name, proj, ReBuildItem_Click); } buildToolStripMenuItem.Visible = true; BuildTypeCB.Items.Clear(); BuildTypeCB.Items.Add("Debug"); BuildTypeCB.Items.Add("Release"); BuildTypeCB.Items.Add("RTM"); BuildTypeCB.Items.Add("Instrumented"); BuildTypeCB.SelectedIndex = 0; BuildTypeCB.Visible = true; BuildMediaTypeCB.Items.Clear(); BuildMediaTypeCB.Items.Add("FLASH"); BuildMediaTypeCB.Items.Add("RAM"); BuildMediaTypeCB.SelectedIndex = 0; BuildMediaTypeCB.Visible = true; BuildToolStripSeparator.Visible = true; mOutputForm.ClearAll(); mErrorListForm.ClearAll(); }
void PKWrapper_LoadSolutionAsyncCompleteEvent(object sender, PKStudio.PortingKitWrapper.LoadSolutionAsyncCompletedEventArgs e) { SetModel(new InventoryBrowserModel(new SolutionNode(e.Solution, null))); }