34
34
using SoundSwitch . Framework . Updater ;
35
35
using SoundSwitch . Framework . Updater . Remind ;
36
36
using SoundSwitch . Localization ;
37
+ using SoundSwitch . Localization . Factory ;
37
38
using SoundSwitch . Model ;
38
39
using SoundSwitch . Properties ;
39
40
using SoundSwitch . UI . Forms ;
@@ -80,6 +81,11 @@ public sealed class TrayIcon : IDisposable
80
81
81
82
public TrayIcon ( )
82
83
{
84
+ //Localization
85
+ var rightToLeft = new LanguageFactory ( ) . Get ( AppModel . Instance . Language ) . IsRightToLeft ? RightToLeft . Yes : RightToLeft . No ;
86
+ _selectionMenu . RightToLeft = rightToLeft ;
87
+ _settingsMenu . RightToLeft = rightToLeft ;
88
+
83
89
UpdateIcon ( ) ;
84
90
_showContextMenu = typeof ( NotifyIcon ) . GetMethod ( "ShowContextMenu" , BindingFlags . Instance | BindingFlags . NonPublic ) ;
85
91
_tooltipInfoManager = new TooltipInfoManager ( NotifyIcon ) ;
@@ -102,7 +108,7 @@ public TrayIcon()
102
108
103
109
if ( e . Button != MouseButtons . Left ) return ;
104
110
105
- if ( _updateMenuItem . Tag != null && ! _postponeService . ShouldPostpone ( ( Release ) _updateMenuItem . Tag ) )
111
+ if ( _updateMenuItem . Tag != null && ! _postponeService . ShouldPostpone ( ( Release ) _updateMenuItem . Tag ) )
106
112
{
107
113
OnUpdateClick ( sender , e ) ;
108
114
return ;
@@ -144,7 +150,7 @@ public void ReplaceIcon(Icon newIcon)
144
150
return ;
145
151
146
152
var oldIcon = NotifyIcon . Icon ;
147
- NotifyIcon . Icon = ( Icon ) newIcon . Clone ( ) ;
153
+ NotifyIcon . Icon = ( Icon ) newIcon . Clone ( ) ;
148
154
try
149
155
{
150
156
oldIcon ? . Dispose ( ) ;
@@ -199,7 +205,7 @@ private void OnUpdateClick(object sender, EventArgs eventArgs)
199
205
200
206
StopAnimationIconUpdate ( ) ;
201
207
NotifyIcon . BalloonTipClicked -= OnUpdateClick ;
202
- _updateDownloadForm . DownloadRelease ( ( Release ) _updateMenuItem . Tag ) ;
208
+ _updateDownloadForm . DownloadRelease ( ( Release ) _updateMenuItem . Tag ) ;
203
209
}
204
210
205
211
private void SetEventHandlers ( )
@@ -264,7 +270,7 @@ private void StartAnimationIconUpdate()
264
270
{
265
271
if ( _animationTimer == null )
266
272
{
267
- _animationTimer = new TimerForm ( ) { Interval = 1000 } ;
273
+ _animationTimer = new TimerForm ( ) { Interval = 1000 } ;
268
274
var tick = 0 ;
269
275
_animationTimer . Tick += ( sender , args ) =>
270
276
{
@@ -335,7 +341,7 @@ private void DeviceClicked(object sender, EventArgs e)
335
341
{
336
342
try
337
343
{
338
- var item = ( ToolStripDeviceItem ) sender ;
344
+ var item = ( ToolStripDeviceItem ) sender ;
339
345
AppModel . Instance . SetActiveDevice ( item . AudioDevice ) ;
340
346
}
341
347
catch ( Exception )
0 commit comments