Integrating view parts

I have copied the sample code for "Integrating view parts inside an existing SDL Trados Studio view" into an empty project and I am getting an error. In the last line of code, the Lazy<T> initialisation, I have a red wiggly line under all three instances of "MyProjectViewPartControl"

I have all the references required by the sample code but are there any others needed?

Ben

  • Hi Tyke,

    You need to create a WinForms UserControl. In the sample you refer to, the UserControl is called MyProjectViewPartControl.

    I suggest looking at the Reference Samples that come with the SDK.

    For example the Wikipedia Search Example (scroll to the very bottom for the UserControl):

    These reference samples are included with the SDK installer (click your windows icon in the bottom left corner of your screen and go to the following folder):

  • Hi Jesse,

    Thanks for the tip. I have added the control and the red underline is no longer there.

    As you suggested, I looked at the samples in the SDK and wanted to step through the code, so I set a breakpoint and hit F5. I got an error message saying that I needed to include an exe and get it to reference the dll and make this my start up object. But in properties > application the drop down list for the start up object was empty and it would not accept any typed input. Any ideas how I can debug the dll? I'm brand new to coding in C# and still finding my way around, so sorry if the questions seem a bit dumb.

    Ben
  • Hi Tyke,

    You need to attach to a running Trados Process:

    Go to "Debug" and "Attach to Process" and select the Trados exe


    MSDN link:

    You can also configure this to happen automatically if manually attaching to the process gets cumbersome by

    setting Trados as the startup exe in your debug settings under project properties.