Exemplo n.º 1
0
        public IStringResourceData[] GetTranslations()
        {
            if (this._translationTable == null)
            {
                switch (this._textType)
                {
                case TaggedType.LocalizableText:
                    this._translationTable             = ProviderProxy.Provider.RetrieveSimilarStrings(nativeText: NativeText, context: Context, processId: ProcessId, culture: Culture);
                    this._shouldSendFeedbackToProvider = true;
                    break;

                case TaggedType.ResourceKey:
                    var stringResourceData = ProviderProxy.LoadExplicit(resourceKey: NativeText, context: Context, processId: ProcessId, culture: Culture);
                    this._translationTable    = new IStringResourceData[1];
                    this._translationTable[0] = stringResourceData;
                    break;

                default:
                    this._translationTable    = new IStringResourceData[1];
                    this._translationTable[0] = new StringResourceData(rawText: NativeText);
                    break;
                }
            }

            return(this._translationTable);
        }
Exemplo n.º 2
0
        public ExtensibleDataContext(object connection, MappingSource mapping)
            : base("", mapping)
        {
            FieldInfo providerField = typeof(System.Data.Linq.DataContext).GetField("provider", BindingFlags.Instance | BindingFlags.NonPublic);

            object proxy = new ProviderProxy(this).GetTransparentProxy();

            providerField.SetValue(this, proxy);

            this.Initialize(connection);
        }
Exemplo n.º 3
0
		public void TestRealTime()
		{
#if REALTIME
			ProviderProxy provider = new ProviderProxy();

			Starter starter = new RealTimeStarter();
    		starter.ProjectProperties.Starter.StartTime = (TimeStamp) new DateTime(2004,1,1);
    		starter.ProjectProperties.Starter.EndTime = (TimeStamp) new DateTime(2004,2,1);
			starter.ProjectProperties.Starter.IntervalDefault = Intervals.Hour1;
			starter.AddDataFeed(provider);
			// No charting for these tests.
    		starter.DataFolder = "Test\\DataCache";
    		starter.ProjectProperties.Starter.SetSymbols(USD_JPY";
	   		starter.Run(new OptimizeLoader());	
#endif	   		
		}
Exemplo n.º 4
0
        public bool Matches(string target)
        {
            var flag         = false;
            var translations = GetTranslations();

            for (var index = 0; index < translations.Length; ++index)
            {
                if (ProviderProxy.ComparisonMethod == null)
                {
                    if (translations[index].ToString() == target)
                    {
                        flag = true;
                        TranslationMatchFound(index: index);
                    }
                }
                else if (ProviderProxy.ComparisonMethod(key: translations[index].ToString(), target: target))
                {
                    flag = true;
                    TranslationMatchFound(index: index);
                }
            }

            return(flag);
        }