本文整理汇总了C#中ITranslation类的典型用法代码示例。如果您正苦于以下问题:C# ITranslation类的具体用法?C# ITranslation怎么用?C# ITranslation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITranslation类属于命名空间,在下文中一共展示了ITranslation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebSocketInterface
public WebSocketInterface(int port, ITranslation translations)
{
_server = new WebSocketServer();
var setupComplete = _server.Setup(new ServerConfig
{
Name = "NecroWebSocket",
Ip = "Any",
Port = port,
Mode = SocketMode.Tcp,
Security = "tls",
Certificate = new CertificateConfig
{
FilePath = @"cert.pfx",
Password = "necro"
}
});
if (setupComplete == false)
{
Logger.Write(translations.GetTranslation(TranslationString.WebSocketFailStart, port), LogLevel.Error);
return;
}
_server.NewMessageReceived += HandleMessage;
_server.NewSessionConnected += HandleSession;
_server.Start();
}
示例2: HomeController
public HomeController(IHomeZoneService homeZoneService, IMenuService menuService, ITranslation translation)
{
//_userManager = userManager;
_homeZoneService = homeZoneService;
_menuService = menuService;
_translation = translation;
}
示例3: ArticleDetailPage
public ArticleDetailPage(ITranslation translation, IArticleDetailPageViewModel viewModel)
{
_translation = translation;
_viewModel = viewModel;
BindingContext = _viewModel;
CreateUI();
}
示例4: MenuService
public MenuService(IMenuHolder holder,
IAccountPermissionsManager userPermissionsManager, ITranslation translation)
{
_holder = holder;
_userPermissionsManager = userPermissionsManager;
_translation = translation;
}
示例5: AddTranslationItemsFromFields
public static void AddTranslationItemsFromFields(string category, object obj, ITranslation translation)
{
if (obj == null)
return;
AddTranslationItemsFromList(category, translation, GetObjProperties(obj, "$this"));
}
示例6: EnsureTranslationIsNotADuplicate
private void EnsureTranslationIsNotADuplicate(ITranslation translationToAdd)
{
if (_translations.ContainsKey(translationToAdd.IsoCode))
{
throw new Exception(String.Format("{0} has already been added as a translation", translationToAdd.IsoCode));
}
}
示例7: AddTranslation
public void AddTranslation(ITranslation translation)
{
EnsureOnlyOneDefaultLanguage(translation);
EnsureTranslationIsNotADuplicate(translation);
_translations.Add(translation.IsoCode, translation);
}
示例8: TEditor
public TEditor(ListBox lb, ISong song, GUI owner, ITranslation trans)
{
//
// Erforderlich für die Windows Form-Designerunterstützung
//
InitializeComponent();
this.AcceptButton = this.button1;
this.song = song;
this.trans = trans;
this.lb = lb;
this.owner = owner;
this.textBox2.Text = this.song.Number.ToString();
this.textBox2.Enabled = false;
tEditor = this;
TEditorOpen = true;
if (this.trans != null)
{
this.textBox1.Text = this.trans.Title;
this.richTextBox1.Text = this.trans.Text;
this.checkBox1.Checked = this.trans.Unformatted;
this.panel1.Enabled = !this.trans.Unformatted;
}
else
{
this.textBox1.Text = "";
this.richTextBox1.Text = "";
}
}
示例9: EnsureOnlyOneDefaultLanguage
private void EnsureOnlyOneDefaultLanguage(ITranslation translationToAdd)
{
if ((translationToAdd.IsDefault)
&& (_translations.Any(t => t.Value.IsDefault)))
{
throw new Exception("Only one default langauge is allowed.");
}
}
示例10: GetSimilarTranslations
public IList<ITranslation> GetSimilarTranslations(
ITranslation sourceTranslation,
IList<ITranslation> targetTranslations)
{
return targetTranslations
.Where(translation => translation.Source.Id == sourceTranslation.Source.Id ||
translation.Target.Id == sourceTranslation.Target.Id)
.ToList();
}
示例11: LoginPage
public LoginPage(ILoginPageViewModel viewModel, ITranslation translation, IViewLocator viewLocator)
{
_viewModel = viewModel;
_viewModel.NavigateToMainPageCommand = new Command(async () => await NavigateToMainPage());
BindingContext = _viewModel;
_translation = translation;
_viewLocator = viewLocator;
}
示例12: MapInfoAnnotation
/// <summary>
/// Creates a new map message.
/// </summary>
/// <param name="text">The message.</param>
/// <param name="boundary">The boundary object.</param>
/// <param name="translation">The map translation.</param>
public MapInfoAnnotation(string text, IAnchor boundary, ITranslation translation)
: base(text, null, translation)
{
// Validate the parameters.
if (null == boundary) throw new ArgumentNullException("boundary");
if (null == translation) throw new ArgumentNullException("translation");
// Set the annotation defaults.
this.BackgroundColor = Color.White;
this.Visible = false;
// Set the boundary anchor.
this.boundary = boundary;
}
示例13: AddTranslationItemsFromList
public static void AddTranslationItemsFromList(string category, ITranslation translation, IEnumerable<Tuple<string, object>> items)
{
Action<string, object, PropertyInfo> action = delegate(string item, object itemObj, PropertyInfo propertyInfo)
{
var value = (string)propertyInfo.GetValue(itemObj, null);
if (AllowTranslateProperty(value))
{
translation.AddTranslationItem(category, item, propertyInfo.Name, value);
}
};
ForEachItem(items, action);
}
示例14: ArticleMasterPage
public ArticleMasterPage(ITranslation translation,
IArticleMasterPageViewModel viewModel,
IArticlesHubProxy articlesHub,
IViewLocator viewLocator)
{
_translation = translation;
_viewModel = viewModel;
_articlesHub = articlesHub;
_viewLocator = viewLocator;
BindingContext = _viewModel;
CreateUI();
this.SetDefaultPadding();
}
示例15: GetTranslation
public static ITranslation GetTranslation(string translationName)
{
if (string.IsNullOrEmpty(translationName))
{
_translation = null;
}
else if (!translationName.Equals(_name))
{
_translation = TranslationSerializer.Deserialize(Path.Combine(GetTranslationDir(), translationName + ".xlf"));
}
_name = translationName;
return _translation;
}