本文整理汇总了C#中IReadOnlyDictionary类的典型用法代码示例。如果您正苦于以下问题:C# IReadOnlyDictionary类的具体用法?C# IReadOnlyDictionary怎么用?C# IReadOnlyDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IReadOnlyDictionary类属于命名空间,在下文中一共展示了IReadOnlyDictionary类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Preset
public Preset(IEnumerable<KeyValuePair<string, string>> names, IReadOnlyDictionary<string,object> properties)
{
foreach (var lang in names)
PresetName[lang.Key] = lang.Value;
foreach (var prop in properties)
State[prop.Key] = prop.Value;
}
开发者ID:dotMorten,项目名称:AllJoynLightingController,代码行数:7,代码来源:ControllerService.PresetService.cs
示例2: PipelineArgument
/// <summary>
/// Initializes a new instance of the <see cref="PipelineArgument"/> class.
/// </summary>
public PipelineArgument(IReadOnlyDictionary<string, string> propertyBag, IDocument document, IRuleSet rules, IPipelineMember successor)
{
PropertyBag = propertyBag;
Document = document;
Rules = rules;
Successor = successor;
}
开发者ID:tuvoksg1,项目名称:RulesEngine,代码行数:10,代码来源:PipelineArguments.cs
示例3: GetContent
public override ContentItem GetContent(IReadOnlyDictionary<string, Argument> invocation, bool throwExceptionIfNotFound)
{
var uri = invocation["url"].AsUri();
var request = WebRequest.Create(uri);
request.UseDefaultCredentials = true;
var response = this.GetResponse(uri.AbsoluteUri, request);
var result = new ContentItem { ContentType = response.ContentType };
using (var stream = response.GetResponseStream())
{
if (stream == Stream.Null || stream == null)
{
if (throwExceptionIfNotFound)
{
throw new StoreItemNotFoundException(this.Name, uri.AbsoluteUri);
}
return null;
}
using (var reader = new StreamReader(stream))
{
result.Content = reader.ReadToEnd();
}
}
return result;
}
开发者ID:niaher,项目名称:pipelyne,代码行数:30,代码来源:UrlStore.cs
示例4: RedisEntity
public RedisEntity(RedisAccount account, BindingTemplate channelOrKeyPath, Mode mode, IReadOnlyDictionary<string, object> bindingData)
{
Account = account;
Mode = mode;
_channelOrKeyPath = channelOrKeyPath;
_bindingData = bindingData;
}
开发者ID:JasonHaley,项目名称:Redis.WebJobs.Extensions,代码行数:7,代码来源:RedisEntity.cs
示例5: PossiblyConvertBody
static object PossiblyConvertBody(object messageBody, IReadOnlyDictionary<string, string> headers)
{
var legacySubscriptionMessage = messageBody as LegacySubscriptionMessage;
if (legacySubscriptionMessage == null)
{
return messageBody;
}
string returnAddress;
var topic = legacySubscriptionMessage.Type;
if (!headers.TryGetValue(Headers.ReturnAddress, out returnAddress))
{
throw new RebusApplicationException($"Got legacy subscription message but the '{Headers.ReturnAddress}' header was not present on it!");
}
var subscribe = legacySubscriptionMessage.Action == 0;
if (subscribe)
{
return new SubscribeRequest
{
Topic = topic,
SubscriberAddress = returnAddress
};
}
return new UnsubscribeRequest
{
Topic = topic,
SubscriberAddress = returnAddress
};
}
开发者ID:RichieYang,项目名称:Rebus,代码行数:34,代码来源:UnpackLegacyMessageIncomingStep.cs
示例6: Activate
public async override Task Activate(INavigationService navigationService, NavigationContextBase navigationContext, IReadOnlyDictionary<string, object> pageState)
{
await base.Activate(navigationService, navigationContext, pageState);
MyNavigationContext context = navigationContext as MyNavigationContext;
if (pageState != null)
{
/*********************************************************
* If you store state on deactivation and it is provided
* here, you know that the user has used the back button
* or returned from app suspension and should restore state.
*********************************************************/
this.Value1 = pageState[nameof(this.Value1)] as string;
this.Value2 = pageState[nameof(this.Value2)] as string;
this.Value3 = pageState[nameof(this.Value3)] as string;
}
else if (context != null)
{
/*********************************************************
* Alternatively, if the user has navigated to the page
* for the first time, there won't be existing page state
* to restore. The context can be used to populate the page.
*********************************************************/
this.Value1 = context.Value1;
this.Value2 = context.Value2;
this.Value3 = context.Value3;
}
}
开发者ID:colincwilliams,项目名称:CSharp-Navigation-Service,代码行数:28,代码来源:MainPageViewModel.cs
示例7: BindAddChild
public override PropertyTreeMetaObject BindAddChild(OperatorDefinition definition, IReadOnlyDictionary<string, PropertyTreeMetaObject> arguments)
{
var result = definition.Apply(null, component, arguments);
if (result == null)
return Null;
return CreateChild(result);
}
开发者ID:Carbonfrost,项目名称:ff-property-trees,代码行数:7,代码来源:ReflectionMetaObject.cs
示例8: DownloadsScoreProvider
public DownloadsScoreProvider(IndexReader reader,
IReadOnlyDictionary<string, int[]> idMapping,
Downloads downloads,
RankingResult ranking,
QueryBoostingContext context,
double baseBoost)
: base(reader)
{
_idMapping = idMapping;
_downloads = downloads;
_baseBoost = baseBoost;
_ranking = ranking;
_context = context;
// We need the reader name: Lucene *may* have multiple segments (which are smaller indices)
// and RankingsHandler provides us with the per-segment document numbers.
//
// If no segments are present (small index) we use an empty string, which is what
// Lucene also uses internally.
var segmentReader = reader as SegmentReader;
_readerName = segmentReader != null
? segmentReader.SegmentName
: string.Empty;
}
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:25,代码来源:DownloadsScoreProvider.cs
示例9: CreateTableIfNotExists
internal static string CreateTableIfNotExists(string tableName, CreateFlags createFlags, IReadOnlyDictionary<string, ColumnMapping> columns)
{
bool fts3 = (createFlags & CreateFlags.FullTextSearch3) != 0;
bool fts4 = (createFlags & CreateFlags.FullTextSearch4) != 0;
bool fts = fts3 || fts4;
var @virtual = fts ? "VIRTUAL " : string.Empty;
var @using = fts3 ? "USING FTS3 " : fts4 ? "USING FTS4 " : string.Empty;
// Build query.
var query = "CREATE " + @virtual + "TABLE IF NOT EXISTS \"" + tableName + "\" " + @using + "(\n";
var decls = columns.Select(c => SQLBuilder.SqlDecl(c.Key, c.Value));
var decl = string.Join(",\n", decls.ToArray());
query += decl;
var fkconstraints =
string.Join(
",\n",
columns.Where(x => x.Value.ForeignKeyConstraint != null).Select(x =>
string.Format("FOREIGN KEY(\"{0}\") REFERENCES \"{1}\"(\"{2}\")",
x.Key,
x.Value.ForeignKeyConstraint.TableName,
x.Value.ForeignKeyConstraint.ColumnName)));
query += (fkconstraints.Length != 0) ? "," + fkconstraints : "";
query += ")";
return query;
}
开发者ID:matrostik,项目名称:SQLitePCL.pretty,代码行数:27,代码来源:SQLBuilder.cs
示例10: LanguageServiceMetadata
public LanguageServiceMetadata(IDictionary<string, object> data)
: base(data)
{
this.ServiceType = (string)data.GetValueOrDefault("ServiceType");
this.Layer = (string)data.GetValueOrDefault("Layer");
this.Data = (IReadOnlyDictionary<string, object>)data;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:LanguageServiceMetadata.cs
示例11: CheckProperyType
public static bool CheckProperyType(IReadOnlyDictionary<string, string> data, KeyValuePair<string, string> param)
{
var result = true;
switch (param.Value)
{
case "Int32":
int number;
if (data.ContainsKey(param.Key))
result = int.TryParse(data[param.Key], out number);
break;
case "Guid":
Guid guid;
if (data.ContainsKey(param.Key))
result = Guid.TryParse(data[param.Key], out guid);
break;
case "DateTime":
DateTime dateTime;
if (data.ContainsKey(param.Key))
result = DateTime.TryParse(data[param.Key], out dateTime);
break;
}
return result;
}
开发者ID:v-lukyanenko,项目名称:Crate.DataStorage,代码行数:25,代码来源:Tools.cs
示例12: Validate
public Task Validate(ParsedMutation mutation, IReadOnlyList<SignatureEvidence> authentication, IReadOnlyDictionary<AccountKey, AccountStatus> accounts)
{
if (this.alwaysValid)
return Task.FromResult(0);
else
throw new TransactionInvalidException("Disabled");
}
开发者ID:hellwolf,项目名称:openchain,代码行数:7,代码来源:NullValidator.cs
示例13: SetApplicationData
public void SetApplicationData(IReadOnlyDictionary<string, object> applicationData) {
// creating fake context is the only way to access HttpApplicationFactory.ApplicationState
var context = new HttpContext(new SimpleWorkerRequest("", "", new StringWriter()));
foreach (var pair in applicationData) {
context.Application[pair.Key] = pair.Value;
}
}
开发者ID:nwillems,项目名称:Gate.Adapters.AspNet,代码行数:7,代码来源:AspNetRemote.cs
示例14: NpkDirDifferences
public NpkDirDifferences(IReadOnlyList<ImgInfo> imgsInFirstButNotSecond, IReadOnlyDictionary<NpkPath, FrameCountDifferenceInfo> imgsWithFewerFramesInSecond, IReadOnlyList<ImgInfo> imgsInSecondButNotFirst, IReadOnlyDictionary<NpkPath, FrameCountDifferenceInfo> imgsWithMoreFramesInSecond)
{
ImgsInFirstButNotSecond = imgsInFirstButNotSecond;
ImgsWithFewerFramesInSecond = imgsWithFewerFramesInSecond;
ImgsInSecondButNotFirst = imgsInSecondButNotFirst;
ImgsWithMoreFramesInSecond = imgsWithMoreFramesInSecond;
}
开发者ID:TeoTwawki,项目名称:DFOToolBox,代码行数:7,代码来源:NpkDirDifferences.cs
示例15: RootGuardianActorRef
public RootGuardianActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, //TODO: switch from Func<Mailbox> createMailbox to MailboxType mailboxType
IInternalActorRef supervisor, ActorPath path, IInternalActorRef deadLetters, IReadOnlyDictionary<string, IInternalActorRef> extraNames)
: base(system,props,dispatcher,createMailbox,supervisor,path)
{
_deadLetters = deadLetters;
_extraNames = extraNames;
}
开发者ID:yaozd,项目名称:akka.net,代码行数:7,代码来源:RootGuardianActorRef.cs
示例16: ProcessSettings
private static void ProcessSettings(Service service, IReadOnlyDictionary<string, string> settings)
{
if (settings.ContainsKey("BasePath"))
service.BasePath = settings["BasePath"];
if (settings.ContainsKey("Host"))
service.Host = settings["Host"];
if (settings.Keys.Any(k => k.StartsWith("Info")))
service.Info = new Info();
if (settings.ContainsKey("InfoDescription"))
service.Info.Description = settings["InfoDescription"];
if (settings.ContainsKey("InfoVersion"))
service.Info.Version = settings["InfoVersion"];
if (settings.ContainsKey("InfoTermsOfService"))
service.Info.TermsOfService = settings["InfoTermsOfService"];
if (settings.ContainsKey("InfoTitle"))
service.Info.Title = settings["InfoTitle"];
if (settings.Keys.Any(k => k.StartsWith("InfoContact")))
service.Info.Contact = new InfoContact();
if (settings.ContainsKey("InfoContactName"))
service.Info.Contact.Name = settings["InfoContactName"];
if (settings.ContainsKey("InfoContactUrl"))
service.Info.Contact.Url = settings["InfoContactUrl"];
if (settings.ContainsKey("InfoContactEmail"))
service.Info.Contact.Email = settings["InfoContactEmail"];
if (settings.Keys.Any(k => k.StartsWith("InfoLicense")))
service.Info.License = new InfoLicense();
if (settings.ContainsKey("InfoLicenseUrl"))
service.Info.License.Url = settings["InfoLicenseUrl"];
if (settings.ContainsKey("InfoLicenseName"))
service.Info.License.Name = settings["InfoLicenseName"];
}
开发者ID:Robin--,项目名称:swaggerwcf,代码行数:35,代码来源:ServiceBuilder.cs
示例17: StopwatchTimer
public StopwatchTimer(MetricsCollector collector, string measurement, IReadOnlyDictionary<string, string> tags = null)
{
_collector = collector;
_measurement = measurement;
_tags = tags;
_stopwatch.Start();
}
开发者ID:influxdata,项目名称:influxdb-csharp,代码行数:7,代码来源:StopwatchTimer.cs
示例18: Validate
public async Task<IList<Mutation>> Validate(ParsedMutation mutation, IReadOnlyList<SignatureEvidence> authentication, IReadOnlyDictionary<AccountKey, AccountStatus> accounts)
{
await ValidateAccountMutations(mutation.AccountMutations, accounts, authentication);
await ValidateDataMutations(mutation.DataRecords, authentication);
return new Mutation[0];
}
开发者ID:openchain,项目名称:openchain,代码行数:7,代码来源:PermissionBasedValidator.cs
示例19: AsyncMethodToStateMachineRewriter
internal AsyncMethodToStateMachineRewriter(
MethodSymbol method,
int methodOrdinal,
AsyncMethodBuilderMemberCollection asyncMethodBuilderMemberCollection,
SyntheticBoundNodeFactory F,
FieldSymbol state,
FieldSymbol builder,
IReadOnlySet<Symbol> hoistedVariables,
IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> nonReusableLocalProxies,
SynthesizedLocalOrdinalsDispenser synthesizedLocalOrdinals,
VariableSlotAllocator slotAllocatorOpt,
int nextFreeHoistedLocalSlot,
DiagnosticBag diagnostics)
: base(F, method, state, hoistedVariables, nonReusableLocalProxies, synthesizedLocalOrdinals, slotAllocatorOpt, nextFreeHoistedLocalSlot, diagnostics, useFinalizerBookkeeping: false)
{
_method = method;
_asyncMethodBuilderMemberCollection = asyncMethodBuilderMemberCollection;
_asyncMethodBuilderField = builder;
_exprReturnLabel = F.GenerateLabel("exprReturn");
_exitLabel = F.GenerateLabel("exitLabel");
_exprRetValue = method.IsGenericTaskReturningAsync(F.Compilation)
? F.SynthesizedLocal(asyncMethodBuilderMemberCollection.ResultType, syntax: F.Syntax, kind: SynthesizedLocalKind.AsyncMethodReturnValue)
: null;
_dynamicFactory = new LoweredDynamicOperationFactory(F, methodOrdinal);
_awaiterFields = new Dictionary<TypeSymbol, FieldSymbol>(TypeSymbol.EqualsIgnoringDynamicComparer);
_nextAwaiterId = slotAllocatorOpt?.PreviousAwaiterSlotCount ?? 0;
}
开发者ID:rafaellincoln,项目名称:roslyn,代码行数:29,代码来源:AsyncMethodToStateMachineRewriter.cs
示例20: LazyLoadWearLimits
private void LazyLoadWearLimits()
{
if (_wearLimitsBeforeWashing != null) return;
var jsonContent = File.ReadAllText(_jsonFilePath);
_wearLimitsBeforeWashing = JsonConvert.DeserializeObject<IReadOnlyDictionary<ClothingArticleType, ushort>>(jsonContent);
}
开发者ID:georgiancamarasan,项目名称:ClothesWashing,代码行数:7,代码来源:JsonWearLimitPolicy.cs
注:本文中的IReadOnlyDictionary类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论