void  Resource::Save(CMSD::CResource& resource)
{
	resource.Identifier.append() = std::string((LPCSTR) identifier);
	CREATEIF(resource.Name.append() ,  name);
	CREATEIF(resource.ResourceType.append() ,  type);
	CREATEIF(resource.Description.append(),  description);

	//PropertyElement(L"Capacity", capacity).Save(resource.Property.append());
	//PropertyElement(L"Manufacturer", manufacturer).Save(resource.Property.append());
	//PropertyElement(L"Serial_number", serial_number).Save(resource.Property.append());

	//for(int i=0; i< simpleproperties.size(); i++)
	//{		
	//	simpleproperties[i].Save(resource.Property.append());
	//}

	PropertyElement().SaveProperties<CMSD::CResource>(resource, properties);

	Distribution* mtbfdist = CCMSDIntegrator::FindDistributionById(mtbfid);
	Distribution* mttrdist = CCMSDIntegrator::FindDistributionById(mttrid);
	if(mtbfdist!=NULL)// !mtbf.IsEmpty())
		mtbf->Save(resource.Property.append());
	if(mttrdist!=NULL)
		mttrdist->Save(resource.Property.append());

}