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);
}
}