Hi there,
I have a background application with the following code:
private MediaTransport CurrentMediaTransport
{
get
{
MediaCenterEnvironment env = host.MediaCenterEnvironment;
if (env != null)
{
MediaExperience exp = env.MediaExperience;
if (exp != null) return exp.Transport;
}
return null;
}
}
public void Start()
{
bool check = true;
while (check)
{
MediaTransport mt = CurrentMediaTransport;
if (mt != null)
{
DialogTest("Not null");
mt.PropertyChanged += new PropertyChangedEventHandler(mt_PropertyChanged);
check = false;
}
else
{
DialogTest("null");
}
Thread.Sleep(10000);
}
}
void mt_PropertyChanged(IPropertyObject sender, string property)
{
//throw new NotImplementedException();
DialogTest(property);
}
Basically, I am trying to get the current MediaTransport object, but it always returns null for me?
Why is this? I've done a bit of searching, but couldn't find anything that would answer my question.
I did however find out that the MediaTransport expires if left alone for a period of time, is this still the case? (I ask as I will need to do something with this information in future).
I'm not the most experienced programmer so try not to go into too much technical speak :p
Thanks.