Programmatically set a filter to current editor view

Hi there!

I am currently working on a plugin that will serve as a custom QA tool to perform checks and searches that we cannot do with standard methods, e.g. find segments containing specfic tags and other things.

So far, integration into the editor works quite well, I can perform the searches and checks as required. I am currently filling a ListView with the found segments and can jump to the respective segment per double click; so far so good.

What I would like to achieve now is, instead of having the plain segment text in a ListView and jumping to each segment via double click, is to just filter the active view for these segments. Alas, I do not know how.

I tried to integrate a viewpart as described in the SDL Translation Studio - Integration API SDK:

[ViewPart(
        Id = "MyProjectViewPart", 
        Name = "My Project View Part", 
        Description = "Integrationg a view part inside the project view")]
    [ViewPartLayout(Dock = DockType.Bottom, LocationByType = typeof(ProjectsController))]
    class MyProjectViewPart : AbstractViewPartController
    {
        protected override Control GetContentControl()
        {
            return _control.Value;
        }

        protected override void Initialize()
        {
            var projectController = SdlTradosStudio.Application.GetController<ProjectsController>();
            projectController.CurrentProjectChanged += (s, e) =>
                                                           {
                                                               if (projectController.CurrentProject == null)
                                                                   return;

                                                               _control.Value.CurrentProject = projectController.CurrentProject.FilePath;                                                               
                                                           };

            projectController.SelectedProjectsChanged += (s, e) =>
                                                             {                                                                 
                                                                 _control.Value.SelectedProjectsCount = projectController.SelectedProjects.Count();
                                                             };           
        }

        private static readonly Lazy<MyProjectViewPartControl> _control = new Lazy<MyProjectViewPartControl>(() => new MyProjectViewPartControl());
    }

 

However, that will not work since I get multiple errors:
a)  "Cannot convert expression type 'MyProjectViewPartControl' to return type 'System.Windows.Forms.Control'" for return _control.Value;
b)  projectController.CurrentProjectChanged  => this method cannot be resolved / is not a member of projectController
c) Lazy<MyProjectViewPartControl> _control => MyProjectViewPartControl
    
Switching <ProjectController> for <EditorController> as suggested in a similar thread does not help either.

Can someone please advise?

Thanks!

Andreas