private TokenInfoDictionary(IResourceResolver resolver) { using (var tokenInfoBufferResource = resolver.Resolve(TokenInfoDictionaryFileName)) using (var stringValueResource = resolver.Resolve(FeatureMapFileName)) using (var posValueResource = resolver.Resolve(PosMapFileName)) using (var wordIdMapResource = resolver.Resolve(TargetMapFileName)) { TokenInfoBuffer = new TokenInfoBuffer(tokenInfoBufferResource); StringValues = new StringValueMapBuffer(stringValueResource); PosValues = new StringValueMapBuffer(posValueResource); WordIdMap = new WordIdMap(wordIdMapResource); } }
public static ConnectionCosts NewInstance(IResourceResolver resolver) { using (var resource = resolver.Resolve(ConnectionCostsFileName)) { return(Read(resource)); } }
public static ContentDialog SetOkToClose(this ContentDialog dialog, IResourceResolver resolver = null) { resolver = resolver ?? Settings.DefaultResolver; dialog.PrimaryButtonText = resolver.Resolve(ResourceTypes.Ok); dialog.IsPrimaryButtonEnabled = true; return(dialog); }
public static DoubleArrayTrie NewInstance(IResourceResolver resolver) { using (var stream = resolver.Resolve(DoubleArrayTrieFileName)) { return(Read(stream)); } }
public static CharacterDefinitions NewInstance(IResourceResolver resolver) { using (var charDefInput = resolver.Resolve(CharacterDefinitionsFileName)) { var definitions = IntArrayIO.ReadSparseArray2D(charDefInput); var mappings = IntArrayIO.ReadSparseArray2D(charDefInput); var symbols = StringArrayIO.ReadArray(charDefInput); return(new CharacterDefinitions(definitions, mappings, symbols)); } }
#pragma warning disable 1591 // Xml Comments public virtual void Intercept(IInvocation invocation) { var resourceName = string.Format("{0}.{1}", invocation.Method.DeclaringType.Name, invocation.Method.Name.Replace("get_", string.Empty)); var value = _resolver.Resolve(resourceName); if (!string.IsNullOrEmpty(value)) { invocation.ReturnValue = value; } else { invocation.Proceed(); } }
public static UnknownDictionary NewInstance(IResourceResolver resolver, CharacterDefinitions characterDefinitions, int totalFeatures) { using (var unkDefInput = resolver.Resolve(UnknownDictionaryFileName)) { var costs = IntArrayIO.ReadArray2D(unkDefInput); var references = IntArrayIO.ReadArray2D(unkDefInput); var features = StringArrayIO.ReadArray2D(unkDefInput); return(new UnknownDictionary( characterDefinitions, references, costs, features, totalFeatures )); } }
public void Forward(HttpRequest req, HttpResponse res, String where) { res.StatusCode = "307"; _resolver.Resolve(where).Process(req, res); }