本文整理汇总了C#中IDictionary.IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.IsEmpty方法的具体用法?C# IDictionary.IsEmpty怎么用?C# IDictionary.IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDictionary
的用法示例。
在下文中一共展示了IDictionary.IsEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SchemaConfig
public SchemaConfig(string name,
string dataNode,
string group,
bool keepSqlSchema,
IDictionary<string, TableConfig> tables)
{
Name = name;
DataNode = dataNode;
Group = group;
Tables = tables;
IsNoSharding = tables == null || tables.IsEmpty();
MetaDataNodes = BuildMetaDataNodes();
AllDataNodes = BuildAllDataNodes();
IsKeepSqlSchema = keepSqlSchema;
}
示例2: InstallPackagesFromVSExtensionRepository
public void InstallPackagesFromVSExtensionRepository(string extensionId, bool isPreUnzipped, bool skipAssemblyReferences, bool ignoreDependencies, Project project, IDictionary<string, string> packageVersions)
{
if (String.IsNullOrEmpty(extensionId))
{
throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "extensionId");
}
if (project == null)
{
throw new ArgumentNullException("project");
}
if (packageVersions.IsEmpty())
{
throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "packageVersions");
}
var preinstalledPackageInstaller = new PreinstalledPackageInstaller(_websiteHandler, _packageServices, _vsCommonOperations, _solutionManager);
var repositoryPath = preinstalledPackageInstaller.GetExtensionRepositoryPath(extensionId, _vsExtensionManager, ThrowError);
var config = GetPreinstalledPackageConfiguration(isPreUnzipped, skipAssemblyReferences, ignoreDependencies, packageVersions, repositoryPath);
preinstalledPackageInstaller.PerformPackageInstall(this, project, config, RepositorySettings, ShowWarning, ThrowError);
}
示例3: AddExtendFunction
/// <param name="extFuncPrototypeMap">
/// funcName -> extFunctionPrototype. funcName
/// MUST NOT be the same as predefined function of MySql 5.5
/// </param>
/// <exception cref="System.ArgumentException" />
public virtual void AddExtendFunction(IDictionary<string, FunctionExpression> extFuncPrototypeMap)
{
if (extFuncPrototypeMap == null || extFuncPrototypeMap.IsEmpty())
{
return;
}
if (!allowFuncDefChange)
{
throw new NotSupportedException("function define is not allowed to be changed");
}
lock (this)
{
var toPut = new Dictionary<string, FunctionExpression>();
// check extFuncPrototypeMap
foreach (var en in extFuncPrototypeMap)
{
var funcName = en.Key;
if (funcName == null)
{
continue;
}
var funcNameUp = funcName.ToUpper();
if (functionPrototype.ContainsKey(funcNameUp))
{
throw new ArgumentException("ext-function '" + funcName + "' is MySql's predefined function!");
}
var func = en.Value;
if (func == null)
{
throw new ArgumentException("ext-function '" + funcName + "' is null!");
}
toPut[funcNameUp] = func;
}
functionPrototype.AddRange(toPut);
}
}
示例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: 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;
}
}