public static int CompareTextStreams(
TSTextStream x,
TSTextStream y)
{
if (x == y)
{
return 0;
}
else if (x == null && y == null)
{
return 0;
}
else if (x == null && y != null)
{
return -1;
}
else if (x != null && y == null)
{
return 1;
}
else
{
if (x.LanguageCode == "eng")
{
return -1;
}
else if (y.LanguageCode == "eng")
{
return 1;
}
else
{
if (x.LanguageCode == y.LanguageCode)
{
if (x.PID > y.PID)
{
return 1;
}
else if (y.PID > x.PID)
{
return -1;
}
else
{
return 0;
}
}
else
{
return string.Compare(
x.LanguageName, y.LanguageName);
}
}
}
}