本文整理汇总了C#中IDictionary.EntrySet方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.EntrySet方法的具体用法?C# IDictionary.EntrySet怎么用?C# IDictionary.EntrySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDictionary
的用法示例。
在下文中一共展示了IDictionary.EntrySet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Format
private static string Format(IDictionary<ObjectId, string> missingCommits)
{
StringBuilder r = new StringBuilder();
r.Append(JGitText.Get().missingPrerequisiteCommits);
foreach (KeyValuePair<ObjectId, string> e in missingCommits.EntrySet())
{
r.Append("\n ");
r.Append(e.Key.Name);
if (e.Value != null)
{
r.Append(" ").Append(e.Value);
}
}
return r.ToString();
}
示例2: Eval
public static object Eval(string source, IDictionary<string, Scriptable> bindings)
{
Context cx = ContextFactory.GetGlobal().EnterContext();
try
{
Scriptable scope = cx.InitStandardObjects();
if (bindings != null)
{
foreach (KeyValuePair<string, Scriptable> entry in bindings.EntrySet())
{
Scriptable @object = entry.Value;
@object.SetParentScope(scope);
scope.Put(entry.Key, scope, @object);
}
}
return cx.EvaluateString(scope, source, "source", 1, null);
}
finally
{
Context.Exit();
}
}
示例3: ReplaceDatabase
public void ReplaceDatabase(string databaseName, InputStream databaseStream, IDictionary
<string, InputStream> attachmentStreams)
{
ReplaceDatabase(databaseName, databaseStream, attachmentStreams == null ? null :
attachmentStreams.EntrySet().GetEnumerator());
}
示例4: Open
/// <exception cref="System.IO.IOException"></exception>
private HttpURLConnection Open(string method, string bucket, string key, IDictionary
<string, string> args)
{
StringBuilder urlstr = new StringBuilder();
urlstr.Append("http://");
urlstr.Append(bucket);
urlstr.Append('.');
urlstr.Append(DOMAIN);
urlstr.Append('/');
if (key.Length > 0)
{
HttpSupport.Encode(urlstr, key);
}
if (!args.IsEmpty())
{
Iterator<KeyValuePair<string, string>> i;
urlstr.Append('?');
i = args.EntrySet().Iterator();
while (i.HasNext())
{
KeyValuePair<string, string> e = i.Next();
urlstr.Append(e.Key);
urlstr.Append('=');
HttpSupport.Encode(urlstr, e.Value);
if (i.HasNext())
{
urlstr.Append('&');
}
}
}
Uri url = new Uri(urlstr.ToString());
Proxy proxy = HttpSupport.ProxyFor(proxySelector, url);
HttpURLConnection c;
c = (HttpURLConnection)url.OpenConnection(proxy);
c.SetRequestMethod(method);
c.SetRequestProperty("User-Agent", "jgit/1.0");
c.SetRequestProperty("Date", HttpNow());
return c;
}
示例5: Header
public Header(IDictionary<string, IList<string>> map) : this()
{
// initialize fields
foreach (KeyValuePair<string, IList<string>> next in map.EntrySet())
{
string key = next.Key;
IList<string> value = next.Value;
List<string> linkedList = new List<string>();
foreach (string element in value)
{
linkedList.AddItem(element);
props.AddItem(key);
props.AddItem(element);
}
keyTable.Put(key, linkedList);
}
}
示例6: ReplaceUri
private string ReplaceUri(string uri, IDictionary<string, string> replacements)
{
if (replacements.IsEmpty())
{
return uri;
}
KeyValuePair<string, string>? match = null;
foreach (KeyValuePair<string, string> replacement in replacements.EntrySet())
{
// Ignore current entry if not longer than previous match
if (match != null && match.Value.Key.Length > replacement.Key.Length)
{
continue;
}
if (!uri.StartsWith(replacement.Key))
{
continue;
}
match = replacement;
}
if (match != null)
{
return match.Value.Value + Sharpen.Runtime.Substring(uri, match.Value.Key.Length);
}
else
{
return uri;
}
}