private IPropertySetting MapProperty(InheritedSetting inheritedSetting, RadElement element) { if (element == null) { return(null); } RadProperty mappedProperty = element.MapStyleProperty(inheritedSetting.property, inheritedSetting.settingType); if (mappedProperty == null) { return(null); } InheritedSetting newInheritedSetting = new InheritedSetting(inheritedSetting.settingType, mappedProperty); IPropertySetting newSetting; if (!mappedSettings.TryGetValue(newInheritedSetting, out newSetting)) { lock (Locker.SyncObj) { //double check concurrency pattern if (!mappedSettings.TryGetValue(newInheritedSetting, out newSetting)) { newSetting = inheritedSetting.setting.Clone() as IPropertySetting; newSetting.Property = mappedProperty; mappedSettings[newInheritedSetting] = newSetting; } } } return(newSetting); }
public override bool Equals(object obj) { InheritedSetting settingToCompare = (InheritedSetting)obj; return(this.settingType == settingToCompare.settingType && this.property == settingToCompare.property); }