I’m trying to work with the new CustomDataContainer class.
I assigns a customdata to some media in the mediapool.
All works fine until I remove a media from mediapool and I try to read customdata from the remaining media.
My code is :
when I remove a media in media pool and run this code I get the following error : Clic HERE
I don’t understand wath I’m doing wrong.
Any help will be appprecied.
Gilles
I assigns a customdata to some media in the mediapool.
All works fine until I remove a media from mediapool and I try to read customdata from the remaining media.
My code is :
foreach (IMediaBinNode objInBin in bin)
{
if (objInBin.NodeType == MediaBinNodeType.MediaRef)
{
Media media = objInBin as Media;
if (media.CustomData.GetObject(guid) == null)
continue;
obj = media.CustomData.GetObject(guid);
string[] cData = obj.ToString().Split(';');
if (cData[0] == "OF")
{
Media newMedia = new Media(cData[1]);
bin.Add(newMedia);
obj = "CF;" + media.FilePath;
newMedia.CustomData.SetObject(guid, obj);
media.ReplaceWith(newMedia);
myVegas.Project.MediaPool.Remove(media.KeyString);
counter++;
}
}
}
when I remove a media in media pool and run this code I get the following error : Clic HERE
I don’t understand wath I’m doing wrong.
Any help will be appprecied.
Gilles