Skip to content

Instantly share code, notes, and snippets.

View cromica's full-sized avatar

Romulus Crisan cromica

View GitHub Profile
@cromica
cromica / QuickInfoSearchDataProvider.cs
Last active January 15, 2019 18:59
tell me search data provider sample
public class QuickInfoSearchDataProvider : ISearchDataProvider
{
public string Name => "info";
public Icon ProviderIcon => PluginResources.info_1930258;
public static Engine Instance { get; } = new Engine(
typeof(Engine).Assembly,
typeof(Ip).Assembly);
@cromica
cromica / QuickInfoProvider.cs
Created January 15, 2019 18:46
define a tell me plugin loader
[TellMeSearchProvider]
public class QuickInfoProvider : ITellMePluginLoader
{
public ISearchDataProvider InitializeProvider()
{
var quickInfoSearchDataProvider = new QuickInfoSearchDataProvider();
return quickInfoSearchDataProvider;
}
}
@cromica
cromica / QuickInfoTellMeProvider.cs
Last active January 15, 2019 18:41
tell me provider sample
[TellMeProvider]
public class QuickInfoTellMeProvider : ITellMeProvider
{
public string Name => "QuickInfo tell me provider";
public AbstractTellMeAction[] ProviderActions => new QuickInfoTellMeAction[]
{
new QuickInfoTellMeAction
{
Keywords = new string[] { "quick", "info", "quickinfo" }
@cromica
cromica / hyper.conf
Created September 14, 2018 05:55
config file for hyper terminal
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@cromica
cromica / ProjectNotificationSample.cs
Created February 25, 2018 11:56
This is a sample on how to consume project creation, open and publish events in Trados Studio
using System;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NotificationsSample.EventAggregator;
using Newtonsoft.Json;
using Sdl.Desktop.IntegrationApi;
using Sdl.Desktop.IntegrationApi.Extensions;
using Sdl.Desktop.IntegrationApi.Interfaces;
using Sdl.ProjectAutomation.FileBased.Events;
@cromica
cromica / ContentSelectionSample.cs
Created February 25, 2018 11:16
This is a sample action that shows how to extract additional info for the content selection when working with Trados Studio Integarion API.
using Sdl.Desktop.IntegrationApi;
using Sdl.Desktop.IntegrationApi.Extensions;
using Sdl.TranslationStudioAutomation.IntegrationApi;
using System;
using System.Text;
using System.Windows.Forms;
namespace CurrentSelectionSample.RibbonAction
{
[Action(Id = "SelectionSample", Name = "Test Me", Icon = "CursorIcon")]
@cromica
cromica / ProjectWithGSTMs.cs
Created October 25, 2017 10:47
Run analysis using GroupShare TMs
using Sdl.Core.Globalization;
using Sdl.ProjectAutomation.Core;
using Sdl.ProjectAutomation.FileBased;
using System;
using System.IO;
using System.Linq;
namespace GS.ProjectAnalysisTest
{
class Program
@cromica
cromica / GetStudioVersion.cs
Created May 10, 2017 05:03
Get Studio version
var studio = new Studio();
var studioVersion = studio.GetStudioVersion();
@cromica
cromica / CreateSegment.cs
Last active March 9, 2016 13:23
Sample code for creating a new segment using SDL Studio Integration API
//Get the editor
var editorController = SdlTradosStudio.Application.GetController<EditorController>();
if (editorController == null) return;
if (editorController.ActiveDocument == null) return;
//get the active segment pair from the current active document in the editor
var activeSegmentPair = editorController.ActiveDocument.ActiveSegmentPair;
if (activeSegmentPair == null) return;
@cromica
cromica / build.fsx
Created November 14, 2015 12:06
fake build script sample
#r @"tools/FAKE.Core/tools/FakeLib.dll"
open Fake
open System
let authors = ["Sdl Community"]
//project details
let projectName = "GroupShareKit"
let projectDescription="A GroupShare API client library for .NET"