当前位置: 首页>>代码示例>>C#>>正文


C# ITranslation类代码示例

本文整理汇总了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();
        }
开发者ID:Rozzla,项目名称:NecroBot,代码行数:28,代码来源:WebSocketInterface.cs

示例2: HomeController

 public HomeController(IHomeZoneService homeZoneService, IMenuService menuService, ITranslation translation)
 {
     //_userManager = userManager;
     _homeZoneService = homeZoneService;
     _menuService = menuService;
     _translation = translation;
 }
开发者ID:ChuHaiQuan,项目名称:SSO_SITE,代码行数:7,代码来源:HomeController.cs

示例3: ArticleDetailPage

		public ArticleDetailPage(ITranslation translation, IArticleDetailPageViewModel viewModel)
		{
			_translation = translation;
			_viewModel = viewModel;
			BindingContext = _viewModel;
			CreateUI();
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:7,代码来源:ArticleDetailPage.cs

示例4: MenuService

 public MenuService(IMenuHolder holder,
     IAccountPermissionsManager userPermissionsManager, ITranslation translation)
 {
     _holder = holder;
     _userPermissionsManager = userPermissionsManager;
     _translation = translation;
 }
开发者ID:ChuHaiQuan,项目名称:SSO_SITE,代码行数:7,代码来源:MenuService.cs

示例5: AddTranslationItemsFromFields

        public static void AddTranslationItemsFromFields(string category, object obj, ITranslation translation)
        {
            if (obj == null)
                return;

            AddTranslationItemsFromList(category, translation, GetObjProperties(obj, "$this"));
        }
开发者ID:NoUsername,项目名称:gitextensions,代码行数:7,代码来源:TranslationUtl.cs

示例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));
			}
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:7,代码来源:LanguageManager.cs

示例7: AddTranslation

		public void AddTranslation(ITranslation translation)
		{
			EnsureOnlyOneDefaultLanguage(translation);
			EnsureTranslationIsNotADuplicate(translation);

			_translations.Add(translation.IsoCode, translation);
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:7,代码来源:LanguageManager.cs

示例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 = "";
     }
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:28,代码来源:TEditor.cs

示例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.");
			}
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:8,代码来源:LanguageManager.cs

示例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();
 }
开发者ID:EugeneSqr,项目名称:VocabExt,代码行数:9,代码来源:SynonymSelector.cs

示例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;
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:9,代码来源:LoginPage.cs

示例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;
 }
开发者ID:alexbikfalvi,项目名称:DotNetApi,代码行数:18,代码来源:MapInfoAnnotation.cs

示例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);
 }
开发者ID:NoUsername,项目名称:gitextensions,代码行数:12,代码来源:TranslationUtl.cs

示例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();
		}
开发者ID:ChristianWeyer,项目名称:myProducts-End-to-End,代码行数:13,代码来源:ArticleMasterPage.cs

示例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;
 }
开发者ID:NoUsername,项目名称:gitextensions,代码行数:13,代码来源:Translator.cs


注:本文中的ITranslation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。