public static ICEMaterial CopyMaterial(ICEMaterial material, ElementCarbonVM parent) { switch (material.Category) { case ICECategory.None: return(new ICEMaterialNone(parent)); case ICECategory.Steel: var thisMat3 = material as ICEMaterialSteel; return(new ICEMaterialSteel(thisMat3.SteelMaterial, parent)); case ICECategory.Concrete: var thisMat = material as ICEMaterialConcrete; return(new ICEMaterialConcrete(thisMat.Grade, thisMat.Replacement, thisMat.ReinforcementDensity, parent)); break; case ICECategory.Timber: var thisMat2 = material as ICEMaterialTimber; return(new ICEMaterialTimber(thisMat2.TimberMaterial, thisMat2.IncludeCarbonFromBiomass, parent)); break; default: return(new ICEMaterialNone(parent)); } }
public void UpdateICEMaterial(ICEMaterial mat) { _iceMat = mat; RaisePropertyChanged(nameof(ICEMaterial)); RaisePropertyChanged(nameof(MaterialType)); RaisePropertyChanged(nameof(Category)); RaisePropertyChanged(nameof(EmbodiedCarbon)); RaisePropertyChanged(nameof(SequesteredCarbon)); }
public ElementCarbonVM(string name, double vol, RevitMaterial mat, RevitCategory cat, MaterialsVM parent) { _name = name; _volume = vol; _revitMaterial = mat; _category = cat; _parent = parent; _iceMat = new ICEMaterialNone(this); }
public void ChangeICEMaterial(ICEMaterial mat) { foreach (var item in Elements) { if (item.IsSelected && item.ElementSelected) { item.UpdateICEMaterial(ICEMaterial.CopyMaterial(mat, item)); } } Updated(); }