protected override void AttributeChanged(EntityAttributeEventArgs e) { if ( e.AttributeName == "SourceFolder" ) { _subEntities.Clear(); // Remove all the sub entities and read the entire sub folder contents and create new // sub entities RecursiveReadFolderAndCreateEntities(this, SourceFolder); } if ( e.AttributeName == "FolderName" ) { UpdateDestination(GetAttribute<string>("DestinationFolder")); } }
protected override void AttributeChanging(EntityAttributeEventArgs e) { if ( e.AttributeName == "SourceFolder" ) { if ( !Directory.Exists(e.NewValue.ToString()) ) { throw new DirectoryNotFoundException(e.NewValue.ToString()); } } }
void Parent_OnAttributeChanged(object sender, EntityAttributeEventArgs e) { if (e.AttributeName == "DestinationFolder") { // Modify the Destination folder of this folder according to the // parent entity's attribute UpdateDestination(e.NewValue as string); } }
protected override void AttributeChanged(EntityAttributeEventArgs e) { if (e.AttributeName == "FileName") { UpdateDestination(Path.GetDirectoryName(GetAttribute<string>("DestinationPath"))); } }