Here are the examples of the csharp api System.Collections.Generic.Dictionary.ContainsKey(XmlComponent) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : KmlFactory.cs
with MIT License
from samcragg
with MIT License
from samcragg
private static void RegisterType(XmlComponent xml, Type type)
{
if (Names.ContainsKey(type))
{
throw new ArgumentException("Clreplaced type has already been registered.");
}
if (Types.ContainsKey(xml))
{
throw new ArgumentException("Another type has been registered with the specified XML qualified name.");
}
Names.Add(type, xml);
Types.Add(xml, ConstructType(type));
}
19
Source : TypeBrowser.cs
with MIT License
from samcragg
with MIT License
from samcragg
private IEnumerable<ElementInfo> ExtractPropertyElements(TypeInfo typeInfo)
{
bool IsSerializableProperty(PropertyInfo property)
{
return property.CanRead &&
!property.GetMethod.IsStatic &&
(property.CanWrite || IsEnumerable(property));
}
foreach (PropertyInfo property in typeInfo.DeclaredProperties.Where(IsSerializableProperty))
{
KmlAttributeAttribute attribute = GetAttribute<KmlAttributeAttribute>(property);
if (attribute != null)
{
var component = new XmlComponent(null, attribute.AttributeName, null);
// Check if a property has already been registered with the info.
// Ignore later properties - i.e. don't throw an exception.
if (!this.attributes.ContainsKey(component))
{
this.attributes.Add(component, new ElementInfo(property, attribute));
}
}
else
{
KmlElementAttribute kmlElement = GetElement(property);
if (kmlElement != null)
{
yield return new ElementInfo(property, kmlElement);
}
}
}
}