本文整理汇总了C#中PropertyList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyList.Add方法的具体用法?C# PropertyList.Add怎么用?C# PropertyList.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyList
的用法示例。
在下文中一共展示了PropertyList.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Flusso
public Flusso(Variable father, string[] fields, List<string> map)
{
this.father = father;
protocolname = map[0];
propertyDefinitions = VarDefinitions.Map[map[0]];
propertyValues = new PropertyList();
if (Regex.IsMatch(map[0], "Variables|Common", RegexOptions.IgnoreCase))
name = map[0];
else
name = fields[1];
name = name.Trim();
foreach (var pt in propertyDefinitions)
{
if (!pt.Value.Visibile) continue;
int i = map.FindIndex(x => x == pt.Key);
if (pt.Key=="Abilitato")
{
if (!Boolean.TryParse(fields[i-1], out abilitazione)) abilitazione = false;
}
if (i > 0)
{
propertyValues.Add(pt.Key, fields[i - 1].Replace("%sc%",";").Trim(),pt.Value);
}
else
propertyValues.Add(pt.Key, "", pt.Value);
}
}
示例2: LoadProperties
public virtual PropertyList LoadProperties(string path)
{
var xml = XElement.Parse(fileSystem.ReadAllText(path));
var result = new PropertyList();
var propertyNodes = xml.Descendants(ScopedName("PropertyGroup")).Descendants();
foreach (var node in propertyNodes)
result.Add(node.Name.LocalName, node.Value);
return result;
}
示例3: Canale
public Canale(string name,Nodo father, string[] fields, List<string> map)
{
this.father = father;
protocolname = map[0];
propertyDefinitions = ComDefinitions.Map[map[0]];
propertyValues = new PropertyList();
this.name = name;
foreach (var pt in propertyDefinitions)
{
if (!pt.Value.Visibile) continue;
int i = map.FindIndex(x => x == pt.Key);
if (pt.Key == "Abilitato")
{
if (!Boolean.TryParse(fields[i - 1], out abilitazione)) abilitazione = false;
}
if (i > 0)
{
propertyValues.Add(pt.Key, (fields[i - 1]).Replace("%sc%",";"), pt.Value);
}
else
propertyValues.Add(pt.Key, "", pt.Value);
}
}