Skip to content

Instantly share code, notes, and snippets.

View cromica's full-sized avatar

Romulus Crisan cromica

View GitHub Profile
@cromica
cromica / build.cmd
Created November 14, 2015 10:44
build windows batch script
@echo off
nuget "install" "xunit.runner.console" "-OutputDirectory" "tools" "-ExcludeVersion"
nuget "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion"
nuget restore
:Build
SET TARGET="Default"
@cromica
cromica / appveyor.yml
Created November 14, 2015 10:39
appveyor script
init:
- git config --global core.autocrlf input
build_script:
- cmd: build.cmd BuildApp
- cmd: build.cmd IntegrationTests
test: off
@cromica
cromica / CsvAuthenticationProvider.plugin.xml
Created October 29, 2015 10:12
Example to create plugin manifest for groupshare
<?xml version="1.0" encoding="utf-16"?>
<plugin id="Unique id of your plugin" name="name of your plugin" version="the plugin version">
<!--public key token has to be the same for all the plugins so do not change the value from this sample. you need to sign your plugin assembly to have this public key toke-->
<extension type="{Name of your type including the namespace}, {Assembly name}, Version={Assembly version}, Culture=neutral, PublicKeyToken=c28cdb26c445c888">
<extensionAttribute type="Sdl.StudioServer.Api.Core.CustomAuthenticationProviderExtentionAttribute, Sdl.StudioServer.Api.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888">
<constructorArgs />
<properties>
<property name="CanValidateUserExistance">True</property>
</properties>
</extensionAttribute>
@cromica
cromica / AutoSuggestIcon.cs
Created June 2, 2015 12:49
sample code on how to specify custom icon for AutoSuggest provider using Integration API
[AutoSuggestProvider(Id = "SourceCopyAutoSuggestProvider", Name = "AutoSuggest provider for copying the source words")]
public class SourceCopyAutoSuggestProvider : AbstractAutoSuggestProvider
{
private List<string> _segmentWordSuggestCandidates;
public SourceCopyAutoSuggestProvider()
{
// Set the default icon for the suggestions from this provider
Icon = new Icon(SystemIcons.Exclamation, 16, 16);
}
@cromica
cromica / SegmentConfirmationLevel.cs
Created June 2, 2015 12:38
sample code showing how you can change the segment confirmation level or subscribe to the changed event using Integration API
var editorController = GetEditorController();
var segmentId = editorController.ActiveDocument.ActiveSegmentPair.Properties.Id.Id;
editorController.ActiveDocument.SegmentsConfirmationLevelChanged += ActiveDocument_SegmentsConfirmationLevelChanged;
editorController.ActiveDocument.ChangeConfirmationLevelOnSegment(segmentId, ConfirmationLevel.Translated);
@cromica
cromica / DeleteAllCommentsOnSegment.cs
Created June 2, 2015 12:23
sample code showing how to delete all comments on a segment using integration API
var editorController = GetEditorController();
var segmentId = editorController.ActiveDocument.ActiveSegmentPair.Properties.Id.Id;
editorController.ActiveDocument.DeleteAllCommentsOnSegment(segmentId);
@cromica
cromica / DeleteCommentSegment.cs
Created June 2, 2015 12:21
sample code showing how to delete comment on segment using integration API
var editorController = GetEditorController();
var segmentId = editorController.ActiveDocument.ActiveSegmentPair.Properties.Id.Id;
var c = editorController.ActiveDocument.GetCommentsFromSegment(segmentId);
editorController.ActiveDocument.DeleteCommentOnSegment(segmentId, c.ElementAt(0));
@cromica
cromica / UpdateCommentOnSegment.cs
Created June 2, 2015 12:06
sample code showing how to update comment on segment using integration API
var editorController = GetEditorController();
var segmentId = editorController.ActiveDocument.ActiveSegmentPair.Properties.Id.Id;
var c = editorController.ActiveDocument.GetCommentsFromSegment(segmentId);
editorController.ActiveDocument.UpdateCommentOnSegment(segmentId, c.ElementAt(0),
string.Format("U Comment {0}", ++_commentsCount),
Severity.Medium);
@cromica
cromica / AddCommentOnSegment.cs
Created June 2, 2015 12:05
sample code showing how to add comment on segment using integration API
var editorController = GetEditorController();
var segmentId = editorController.ActiveDocument.ActiveSegmentPair.Properties.Id.Id;
editorController.ActiveDocument.AddCommentOnSegment(segmentId, string.Format("Comment {0}", ++_commentsCount), Severity.Low);
@cromica
cromica / UpdateParagraphProperties.cs
Created June 2, 2015 11:53
sample code showing how to update a paragraph properties using integration API
var segmentPair = _editorController.ActiveDocument.ActiveSegmentPair;
var paragraphProperties = segmentPair.GetParagraphUnitProperties();
var newComment = _editorController.ActiveDocument.PropertiesFactory.CreateComment("Test Comment", "Test author",
Severity.High);
if (paragraphProperties.Comments==null)
{
paragraphProperties.Comments = _editorController.ActiveDocument.PropertiesFactory.CreateCommentProperties();
}