- Moderator
- #11
One more request, I modified the MP-RSSTicker plugin so that it has a new skin propertry #rssseparator. This is so it can be used as the wrapstring for the rss fadelabel.
I noticed an issue where StripWrapString could generate a ArgumentOutOfRange exception because the length is less than zero.
I modified the code to demonstrate:
[Info.][MPMain]: LabelControl.Label=' ::' _wrapString= #rssseparator
[Info.][MPMain]: LabelControl.Label.Length='4' _wrapString.Length=14
[Info.][MPMain]: render exception: System.ArgumentOutOfRangeException: Length cannot be less than zero.
XML:
As you can see #seperator is not evaluated as a skinproperty before hitting this function.
It Also probably would hurt putting a check for less than zero as well
I noticed an issue where StripWrapString could generate a ArgumentOutOfRange exception because the length is less than zero.
I modified the code to demonstrate:
Code:
private void StripWrapString(GUILabelControl labelControl)
{
Log.Info("LabelControl.Label='{0}' _wrapString={1}", labelControl.Label, _wrapString);
Log.Info("LabelControl.Label.Length='{0}' _wrapString.Length={1}", labelControl.Label.Length, _wrapString.Length);
labelControl.Label = labelControl.Label.Substring(0, labelControl.Label.Length - _wrapString.Length);
return;
}
[Info.][MPMain]: LabelControl.Label=' ::' _wrapString= #rssseparator
[Info.][MPMain]: LabelControl.Label.Length='4' _wrapString.Length=14
[Info.][MPMain]: render exception: System.ArgumentOutOfRangeException: Length cannot be less than zero.
XML:
Code:
<control>
<description>RSS Items</description>
<type>fadelabel</type>
<id>1</id>
<width>1250</width>
<height>50</height>
<posY>695</posY>
<posX>120</posX>
<font>mediastream12tc</font>
<label>#rssfeed</label>
<wrapString> #rssseparator </wrapString>
<animation effect="slide" start="0,100" end="0,0" tween="quadratic" easing="in" time=" 400" delay="200">WindowOpen</animation>
<animation effect="slide" end="0,100" tween="quadratic" easing="in" time=" 400" delay="200">WindowClose</animation>
<visible>plugin.isenabled(MP-RSSTicker)</visible>
</control>
As you can see #seperator is not evaluated as a skinproperty before hitting this function.
It Also probably would hurt putting a check for less than zero as well