本文整理汇总了C#中IDictionary.IsNull方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.IsNull方法的具体用法?C# IDictionary.IsNull怎么用?C# IDictionary.IsNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDictionary
的用法示例。
在下文中一共展示了IDictionary.IsNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMySqlMap
private YamlMappingNode CreateMySqlMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Enabled", (!nodes.IsNull() && nodes.ContainsKey("Enabled")) ? nodes["Enabled".ToYamlNode()].ToString() : d_mysqlenabled.ToString());
map.Add("Host", (!nodes.IsNull() && nodes.ContainsKey("Host")) ? nodes["Host".ToYamlNode()].ToString() : d_mysqlhost);
map.Add("Port", (!nodes.IsNull() && nodes.ContainsKey("Port")) ? nodes["Port".ToYamlNode()].ToString() : d_mysqlport.ToString());
map.Add("User", (!nodes.IsNull() && nodes.ContainsKey("User")) ? nodes["User".ToYamlNode()].ToString() : d_mysqluser);
map.Add("Password", (!nodes.IsNull() && nodes.ContainsKey("Password")) ? nodes["Password".ToYamlNode()].ToString() : d_mysqlpassword);
map.Add("Database", (!nodes.IsNull() && nodes.ContainsKey("Database")) ? nodes["Database".ToYamlNode()].ToString() : d_mysqldatabase);
map.Add("Charset", (!nodes.IsNull() && nodes.ContainsKey("Charset")) ? nodes["Charset".ToYamlNode()].ToString() : d_mysqlcharset);
return map;
}
示例2: CreateWolframAlphaMap
private YamlMappingNode CreateWolframAlphaMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
var map2 = new YamlMappingNode();
if(!nodes.IsNull() && nodes.ContainsKey("Api"))
{
var node2 = ((YamlMappingNode)nodes["Api".ToYamlNode()]).Children;
map2.Add("Key", (!node2.IsNull() && node2.ContainsKey("Key")) ? node2["Key".ToYamlNode()].ToString() : d_wolframalphaapikey);
}
else
map2.Add("Key", d_wolframalphaapikey);
map.Add("Api", map2);
return map;
}
示例3: WeatherMap
private void WeatherMap(IDictionary<YamlNode, YamlNode> nodes)
{
string Country = d_weatherhomecountry;
string City = d_weatherhomecity;
string Key = d_wundergroundapikey;
if(!nodes.IsNull() && nodes.ContainsKey("Home"))
{
var node2 = ((YamlMappingNode)nodes["Home".ToYamlNode()]).Children;
Country = (!node2.IsNull() && node2.ContainsKey("Country")) ? node2["Country".ToYamlNode()].ToString() : d_weatherhomecountry;
City = (!node2.IsNull() && node2.ContainsKey("City")) ? node2["City".ToYamlNode()].ToString() : d_weatherhomecity;
}
if(!nodes.IsNull() && nodes.ContainsKey("Wunderground"))
{
var node2 = ((YamlMappingNode)nodes["Wunderground".ToYamlNode()]).Children;
Key = (!node2.IsNull() && node2.ContainsKey("Key")) ? node2["Key".ToYamlNode()].ToString() : d_wundergroundapikey;
}
new WeatherConfig(Country, City, Key);
}
示例4: CreateRssMap
private YamlMappingNode CreateRssMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("QueryTime", (!nodes.IsNull() && nodes.ContainsKey("QueryTime")) ? nodes["QueryTime".ToYamlNode()].ToString() : d_querytime.ToString());
return map;
}
示例5: CreateModeMap
private YamlMappingNode CreateModeMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
var map2 = new YamlMappingNode();
if(!nodes.IsNull() && nodes.ContainsKey("Remove"))
{
var node2 = ((YamlMappingNode)nodes["Remove".ToYamlNode()]).Children;
map2.Add("Enabled", (!node2.IsNull() && node2.ContainsKey("Enabled")) ? node2["Enabled".ToYamlNode()].ToString() : d_enabled.ToString());
map2.Add("Type", (!node2.IsNull() && node2.ContainsKey("Type")) ? node2["Type".ToYamlNode()].ToString() : d_type);
}
else
{
map2.Add("Enabled", d_enabled.ToString());
map2.Add("Type", d_type);
}
map.Add("Remove", map2);
return map;
}
示例6: SQLiteMap
private void SQLiteMap(IDictionary<YamlNode, YamlNode> nodes)
{
bool Enabled = (!nodes.IsNull() && nodes.ContainsKey("Enabled")) ? nodes["Enabled".ToYamlNode()].ToString().ToBoolean() : d_sqliteenabled;
string FileName = (!nodes.IsNull() && nodes.ContainsKey("FileName")) ? nodes["FileName".ToYamlNode()].ToString() : d_sqlitefilename;
new SQLiteConfig(Enabled, sUtilities.GetSpecialDirectory(FileName));
}
示例7: CreateFloodingMap
private YamlMappingNode CreateFloodingMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Seconds", (!nodes.IsNull() && nodes.ContainsKey("Seconds")) ? nodes["Seconds".ToYamlNode()].ToString() : _seconds.ToString());
map.Add("NumberOfMessages", (!nodes.IsNull() && nodes.ContainsKey("NumberOfMessages")) ? nodes["NumberOfMessages".ToYamlNode()].ToString() : _numberofmessages.ToString());
map.Add("NumberOfFlooding", (!nodes.IsNull() && nodes.ContainsKey("NumberOfFlooding")) ? nodes["NumberOfFlooding".ToYamlNode()].ToString() : _numberofflooding.ToString());
return map;
}
示例8: CreateUpdateMap
private YamlMappingNode CreateUpdateMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Enabled", (!nodes.IsNull() && nodes.ContainsKey("Enabled")) ? nodes["Enabled".ToYamlNode()].ToString() : d_updateenabled.ToString());
map.Add("Version", (!nodes.IsNull() && nodes.ContainsKey("Version")) ? nodes["Version".ToYamlNode()].ToString() : d_updateversion);
map.Add("Branch", (!nodes.IsNull() && nodes.ContainsKey("Branch")) ? nodes["Branch".ToYamlNode()].ToString() : d_updatebranch);
map.Add("WebPage", (!nodes.IsNull() && nodes.ContainsKey("WebPage")) ? nodes["WebPage".ToYamlNode()].ToString() : d_updatewebpage);
return map;
}
示例9: FloodingMap
private void FloodingMap(IDictionary<YamlNode, YamlNode> nodes)
{
int Seconds = (!nodes.IsNull() && nodes.ContainsKey("Seconds")) ? nodes["Seconds".ToYamlNode()].ToString().ToInt32() : d_floodingseconds;
int NumberOfCommands = (!nodes.IsNull() && nodes.ContainsKey("NumberOfCommands")) ? nodes["NumberOfCommands".ToYamlNode()].ToString().ToInt32() : d_floodingnumberofcommands;
new FloodingConfig(Seconds, NumberOfCommands);
}
示例10: CreateShutdownMap
private YamlMappingNode CreateShutdownMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("MaxMemory", (!nodes.IsNull() && nodes.ContainsKey("MaxMemory")) ? nodes["MaxMemory".ToYamlNode()].ToString() : d_shutdownmaxmemory.ToString());
return map;
}
示例11: CreateSQLiteMap
private YamlMappingNode CreateSQLiteMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Enabled", (!nodes.IsNull() && nodes.ContainsKey("Enabled")) ? nodes["Enabled".ToYamlNode()].ToString() : d_sqliteenabled.ToString());
map.Add("FileName", (!nodes.IsNull() && nodes.ContainsKey("FileName")) ? nodes["FileName".ToYamlNode()].ToString() : d_sqlitefilename);
return map;
}
示例12: CreateShortUrlMap
private YamlMappingNode CreateShortUrlMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Name", (!nodes.IsNull() && nodes.ContainsKey("Name")) ? nodes["Name".ToYamlNode()].ToString() : d_shorturlname);
map.Add("ApiKey", (!nodes.IsNull() && nodes.ContainsKey("ApiKey")) ? nodes["ApiKey".ToYamlNode()].ToString() : d_shorturlapikey);
return map;
}
示例13: CreateServerMap
private YamlMappingNode CreateServerMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Enabled", (!nodes.IsNull() && nodes.ContainsKey("Enabled")) ? nodes["Enabled".ToYamlNode()].ToString() : d_serverenabled.ToString());
map.Add("Host", (!nodes.IsNull() && nodes.ContainsKey("Host")) ? nodes["Host".ToYamlNode()].ToString() : d_serverhost);
map.Add("Port", (!nodes.IsNull() && nodes.ContainsKey("Port")) ? nodes["Port".ToYamlNode()].ToString() : d_serverport.ToString());
map.Add("Password", (!nodes.IsNull() && nodes.ContainsKey("Password")) ? nodes["Password".ToYamlNode()].ToString() : d_serverpassword);
return map;
}
示例14: CreateScriptsMap
private YamlMappingNode CreateScriptsMap(IDictionary<YamlNode, YamlNode> nodes)
{
var map = new YamlMappingNode();
map.Add("Lua", (!nodes.IsNull() && nodes.ContainsKey("Lua")) ? nodes["Lua".ToYamlNode()].ToString() : d_scriptsluaenabled.ToString());
map.Add("Python", (!nodes.IsNull() && nodes.ContainsKey("Python")) ? nodes["Python".ToYamlNode()].ToString() : d_scriptspythonenabled.ToString());
map.Add("Directory", (!nodes.IsNull() && nodes.ContainsKey("Directory")) ? nodes["Directory".ToYamlNode()].ToString() : d_scriptsdirectory);
return map;
}
示例15: ShortUrlMap
private void ShortUrlMap(IDictionary<YamlNode, YamlNode> nodes)
{
string Name = (!nodes.IsNull() && nodes.ContainsKey("Name")) ? nodes["Name".ToYamlNode()].ToString() : d_shorturlname;
string ApiKey = (!nodes.IsNull() && nodes.ContainsKey("ApiKey")) ? nodes["ApiKey".ToYamlNode()].ToString() : d_shorturlapikey;
new ShortUrlConfig(Name, ApiKey);
}