protected virtual Component ReadComponent(XElement source) { var name = source.Attribute("name").ValueNullSafe(); //Co z unikalnością imienia var text = source.Attribute("text").ValueNullSafe(); var type = source.Attribute("type").ValueNullSafe(); bool isMarkedForInstall = source.Attribute("isMarkedForInstall").ValueOr <bool>(true); ComponentType componentType = ComponentType.GetDefault(); if (ComponentType.IsKnownVersion(type)) { componentType = ComponentType.GetByName(type); } var newComponent = new Component(componentType, name, text); newComponent.IsMarkedForInstall = isMarkedForInstall; return(newComponent); }