Skip to content

Instantly share code, notes, and snippets.

@andreaGhisa
andreaGhisa / communitygist.cs
Created July 26, 2018 11:37
IStudioGroupNotification
public class InSourceNotificationGroup:IStudioGroupNotification
{
private readonly ObservableCollection<IStudioNotification> _notifications;
public InSourceNotificationGroup(string key)
{
Key = key;
_notifications = new ObservableCollection<IStudioNotification>();
}
public string Title { get; set; }
public IStudioNotificationCommand Action { get; set; }
@andreaGhisa
andreaGhisa / communitygist.cs
Created July 26, 2018 11:34
IStudioNotification implementation
public class InSourceNotification: IStudioNotification
{
public InSourceNotification(Guid id)
{
Id = id;
}
public Guid Id { get; }
public string Title { get; set; }
public IStudioNotificationCommand LinkAction { get; set; }
public bool IsExpanderVisible { get; set; }
public override bool OnFileComplete(ProjectFile projectFile, IMultiFileConverter multiFileConverter){
return true;
}
1. Home Tab 
[RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.HomeRibbonTabLocation))]
2. Editor Review 
[RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
3. Editor
[Action("Action Name", Name = "Help", Icon = "wiki", Description = "")]
[ActionLayout(typeof(TmAnonymizerRibbonGroup), 250, DisplayType.Large)]
 public class TmAnonymizerHelpAction : AbstractAction{
  protected override void Execute(){
  }
}
[RibbonGroup("TmRibbonGroup", "Tm Anonymizer user guide")]
[RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.HomeRibbonTabLocation))]
public class TmAnonymizerRibbonGroup : AbstractRibbonGroup{
}
public YourWindowsFormsControl(){
InitializeComponent();
var wpfMainWindow = new MainViewControl();
wpfMainWindow.InitializeComponent(); //initialize wpf control
elementHost.Child =wpfMainWindow; //assign the control to element host
}
private static readonly Lazy<YourControl> Control = new Lazy<YourControl>(() => new YourControl());
protected override void Initialize(IViewContext context){
}
protected override Control GetContentControl(){
return Control.Value;
}
[View(Id = "View Id",Name = "View Name",Description = "Description,LocationByType = typeof(TranslationStudioDefaultViews.TradosStudioViewsLocation))]
var tag = new Tag(TagType.TextPlaceholder, string.Empty, 1); (Tag object is found in Sdl.LanguagePlatform.Core.dll )