-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dashboard.cs
755 lines (692 loc) · 31.7 KB
/
Dashboard.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
// Type: Intel.Mobile.WiMAXCU.UI.Dashboard.Dashboard
// Assembly: WiMAXCU, Version=6.2.4357.25644, Culture=neutral, PublicKeyToken=null
// MVID: 3C622363-C72C-43B7-9311-DD8942A58F18
// Assembly location: E:\Extracted\program files\Intel\WiMAX\Bin\WiMAXCU.exe
using Intel.Mobile.WiMAXCU.BizTier;
using Intel.Mobile.WiMAXCU.Common;
using Intel.Mobile.WiMAXCU.SDKInterop;
using Intel.Mobile.WiMAXCU.UI.CustomControls;
using Intel.Mobile.WiMAXCU.UI.DisplayWiMAX;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Threading;
using System.Windows.Forms;
namespace Intel.Mobile.WiMAXCU.UI.Dashboard
{
public class Dashboard : CustomForm
{
private static int _errorMessageCount = 0;
private static int _uniqueMsgId = Dashboard.RegisterWindowMessage(DashboardStringHelper.GetString("ApplicationCaption"));
private static uint MSGFLT_ADD = 1U;
private static int NOTIFY_FOR_THIS_SESSION = 0;
private ConnectionPanel _connectionPanel = new ConnectionPanel();
private NetworkListPanel _networkListPanel = new NetworkListPanel();
private PreferencesDialog _preferencesDlg = PreferencesDialog.Singleton;
private AdvancedDialog _advancedDlg = AdvancedDialog.Singleton;
private ManageNetworksDialog _manageNetworksDlg = ManageNetworksDialog.Singleton;
private TechSupportDialog _techSupportDlg = TechSupportDialog.Singleton;
private AboutDialog _aboutDlg = AboutDialog.Singleton;
private NetworkDetailsDialog _networkDetailsDlg = NetworkDetailsDialog.Singleton;
private NetworkPropertiesDialog _networkProperitesDlg = NetworkPropertiesDialog.Singleton;
private FUMOProgressDialog _fumoProgressDialog = FUMOProgressDialog.Singleton;
private ClickableCustomMessageBox _connectedCMB = new ClickableCustomMessageBox((string) null, (string) null, (LinkLabelLinkClickedEventHandler) null);
private ClickableCustomMessageBox _dualModeWarningCMB = new ClickableCustomMessageBox((string) null, (string) null, (LinkLabelLinkClickedEventHandler) null);
private DashboardMode _preferredDashboardMode = DashboardMode.Collapsed;
private IContainer components;
private TaskTray _taskTray;
private APDOEventHandler TheApdoEventHandler;
private WindowDragHelper _windowDragHelper;
private Timers _timers;
private bool _subscriptionAndFirewallPopupShown;
private System.Windows.Forms.Timer _waitingForWiMAXAfterResumeTimer;
public TaskTray TheTaskTray
{
get
{
return this._taskTray;
}
set
{
this._taskTray = value;
}
}
public NetworkListPanel TheNetworkListPanel
{
get
{
return this._networkListPanel;
}
}
public ConnectionPanel TheConnectionPanel
{
get
{
return this._connectionPanel;
}
}
public DashboardMode PreferredDashboardMode
{
get
{
return this._preferredDashboardMode;
}
set
{
this._preferredDashboardMode = value;
this.SetDashboardMode();
}
}
public bool SubscriptionAndFirewallPopupShown
{
get
{
return this._subscriptionAndFirewallPopupShown;
}
set
{
this._subscriptionAndFirewallPopupShown = value;
}
}
static Dashboard()
{
}
public Dashboard()
{
this.CreateHandle();
this.InitializeComponent();
this.CustomInitializeComponents();
ScalingUtils.ScaleControlHierarchy((Control) this);
this.RegisterForEvents();
this._timers = new Timers();
this._waitingForWiMAXAfterResumeTimer = new System.Windows.Forms.Timer();
this._waitingForWiMAXAfterResumeTimer.Tick += new EventHandler(this.OnWaitingForWiMAXAfterResumeTick);
this._waitingForWiMAXAfterResumeTimer.Interval = TimerSettings.Dashboard_WaitingForWiMAXAfterResumeTimer_Interval;
}
[DllImport("User32.dll", CharSet = CharSet.Auto)]
private static int RegisterWindowMessage(string lpString);
[DllImport("User32.dll", SetLastError = true)]
private static int ChangeWindowMessageFilter(int iMessage, uint dwFlag);
[DllImport("wtsapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static bool WTSRegisterSessionNotification(IntPtr hWnd, [MarshalAs(UnmanagedType.U4)] int dwFlags);
[DllImport("WtsApi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static bool WTSUnRegisterSessionNotification(IntPtr hWnd);
private void InitializeComponent()
{
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Dashboard));
this.TheApdoEventHandler = new APDOEventHandler();
this.SuspendLayout();
this.TheApdoEventHandler.BackColor = Color.DarkRed;
componentResourceManager.ApplyResources((object) this.TheApdoEventHandler, "TheApdoEventHandler");
this.TheApdoEventHandler.Name = "TheApdoEventHandler";
this.AutoScaleMode = AutoScaleMode.None;
componentResourceManager.ApplyResources((object) this, "$this");
this.Controls.Add((Control) this.TheApdoEventHandler);
this.ForeColor = Color.Black;
this.FormType = FormTypeEnum.MainApplication;
this.KeyPreview = true;
this.MaximizeBox = false;
this.Name = "Dashboard";
this.WindowState = FormWindowState.Minimized;
this.ResumeLayout(false);
}
protected override void Dispose(bool disposing)
{
new SecurityPermission(SecurityPermissionFlag.AllFlags).Demand();
if (disposing)
{
Eventing.DeRegisterAllUIEvents((object) this);
if (this._windowDragHelper != null)
this._windowDragHelper.CleanUp();
if (this.components != null)
this.components.Dispose();
}
base.Dispose(disposing);
}
protected override void OnHandleDestroyed(EventArgs e)
{
Dashboard.WTSUnRegisterSessionNotification(this.Handle);
base.OnHandleDestroyed(e);
}
internal void ResetTrayIconVisibility()
{
try
{
if (AppFramework.Dashboard == null || AppFramework.Dashboard.TheTaskTray == null || AppFramework.Dashboard.TheTaskTray.TaskTrayNotifyIcon == null)
return;
AppFramework.Dashboard.TheTaskTray.TaskTrayNotifyIcon.Visible = false;
if (!CurrentUserSettings.GetShowTrayIconSetting())
return;
AppFramework.Dashboard.TheTaskTray.TaskTrayNotifyIcon.Visible = true;
AppFramework.Dashboard.TheTaskTray.UpdateUI();
}
catch (Exception ex)
{
Logging.LogEvent(TraceModule.SDK, TraceLevel.Warning, (object) this, Logging.GetMessageForException(ex));
}
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == Dashboard._uniqueMsgId)
{
AppFramework.Dashboard.ResetTrayIconVisibility();
this.ShowMainWindow();
}
else if (m.Msg == 562)
Eventing.GenerateUIEvent("WiMAXUI.OnWindowDragEnd", (object) this, new object[0]);
else if (m.Msg == 274)
{
if (m.WParam.ToInt32() == 1001)
AppFramework.Dashboard.ShowAboutDialog();
}
else if (m.Msg == 689)
{
switch (m.WParam.ToInt32())
{
case 1:
case 3:
case 5:
ConnectModeHandler.UserSessionIsActive = true;
break;
case 2:
case 4:
case 6:
ConnectModeHandler.UserSessionIsActive = false;
break;
}
}
else if (m.Msg == 536)
{
if (m.WParam.ToInt32() == 7)
{
if (this._waitingForWiMAXAfterResumeTimer != null)
{
MediaHandler.ResumingFromSleep = true;
this._waitingForWiMAXAfterResumeTimer.Start();
}
}
else if (m.WParam.ToInt32() == 4 && this._waitingForWiMAXAfterResumeTimer != null)
this._waitingForWiMAXAfterResumeTimer.Stop();
}
base.WndProc(ref m);
}
private void OnWaitingForWiMAXAfterResumeTick(object sender, EventArgs e)
{
this._waitingForWiMAXAfterResumeTimer.Stop();
MediaHandler.ResumingFromSleep = false;
}
private void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F1)
{
this._connectionPanel.LaunchHelp();
}
else
{
if (e.KeyCode != Keys.F5)
return;
this.Cursor = Cursors.WaitCursor;
this.UpdateDisplay();
this.Cursor = Cursors.Default;
}
}
private void OnSizeChanged(object sender, EventArgs e)
{
if (this.WindowState != FormWindowState.Minimized)
return;
this.ShowInTaskbar = true;
}
private void OnLoad(object sender, EventArgs e)
{
if (AllSettings.Singleton.ShowSplashScreen)
{
TimeSpan sleepTime = SplashScreen.GetSleepTime();
if (sleepTime.Ticks > 0L)
Thread.Sleep(sleepTime.Seconds * 1000 + sleepTime.Milliseconds);
SplashScreen.CloseForm();
Application.DoEvents();
Thread.Sleep(750);
}
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - (ImageHelper.FrameLeftPixel.Width + this._connectionPanel.Width + ImageHelper.FrameRightPixel.Width)) / 2, 50);
this.DoCollapse();
}
private void OnShown(object sender, EventArgs e)
{
if (AllSettings.Singleton.LaunchInTaskTray)
return;
AppHandler.ForceBringToFront(this.Handle);
this.SetTrayIconVisiblity();
ThreadPool.QueueUserWorkItem(new WaitCallback(this.DoInitApplication));
}
private void OnClosing(object sender, CancelEventArgs e)
{
FormClosingEventArgs closingEventArgs = e as FormClosingEventArgs;
if (closingEventArgs != null && CloseReason.UserClosing != closingEventArgs.CloseReason)
{
Application.Exit();
}
else
{
if (AppFramework.Dashboard.TheTaskTray == null)
return;
e.Cancel = true;
this.Hide();
}
}
private void OnSubscribeForServiceAndFirewallPopupClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if ((WhichLinkClicked) e.Link.LinkData == WhichLinkClicked.FirstLink)
{
new SecurityPermission(SecurityPermissionFlag.AllFlags).Demand();
UIHelper.LaunchDefaultBrowser(DashboardStringHelper.GetString("DefaultURL"));
}
else
this.LaunchHelp("/firewall.htm");
}
private void OnDualModeWarningForWiFiClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.LaunchHelp("/tasktray.htm#wimax_off");
}
private void OnDualModeWarningForWiMAXClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.LaunchHelp("/tasktray.htm#wifi_off");
}
private void OnRestoreNetworkSettingsComplete(object sender, object[] eventArgs)
{
AppFramework.Dashboard.TheTaskTray.TaskTrayNotifyIcon.Visible = true;
AppFramework.Dashboard.SetDashboardMode();
AppFramework.Dashboard.TheConnectionPanel.UpdateUI();
AppFramework.Dashboard.TheNetworkListPanel.UpdateUI(false);
if (AppFramework.Dashboard.TheTaskTray != null)
AppFramework.Dashboard.TheTaskTray.UpdateUI();
Application.DoEvents();
}
private void OnResetWiMAXDeviceComplete(object sender, object[] eventArgs)
{
AppFramework.Dashboard.SetDashboardMode();
AppFramework.Dashboard.TheConnectionPanel.UpdateUI();
AppFramework.Dashboard.TheNetworkListPanel.UpdateUI(false);
if (AppFramework.Dashboard.TheTaskTray != null)
AppFramework.Dashboard.TheTaskTray.UpdateUI();
Application.DoEvents();
}
private void OnShowDualModeWarningForWiFi(object sender, object[] eventArgs)
{
if (this._dualModeWarningCMB.Visible || !LocalMachineSettings.IsDualModeWarningEnabled() || !CurrentUserSettings.GetShowDualModeWarningPopup())
return;
string @string = DashboardStringHelper.GetString("LowerCaseClickHere_Clickable");
this._dualModeWarningCMB = new ClickableCustomMessageBox(string.Format(DashboardStringHelper.GetString("DualModeWarningForWiFi"), (object) @string), @string, new LinkLabelLinkClickedEventHandler(this.OnDualModeWarningForWiFiClicked), CustomMessageBoxStyle.Ok, DontShowThisMessageAgainOptions.DualModeWarningForWiFi);
this._dualModeWarningCMB.AccessibleName = "DualModeWarningMB";
this._dualModeWarningCMB.LocationOfMessageBox = CustomMessageBoxLocation.CenterOfDashboardOrInTaskTrayOnTop;
int num = (int) this._dualModeWarningCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true);
}
private void OnShowDualModeWarningForWiMAX(object sender, object[] eventArgs)
{
if (this._dualModeWarningCMB.Visible || !LocalMachineSettings.IsDualModeWarningEnabled() || !CurrentUserSettings.GetShowDualModeWarningPopup())
return;
string @string = DashboardStringHelper.GetString("LowerCaseClickHere_Clickable");
this._dualModeWarningCMB = new ClickableCustomMessageBox(string.Format(DashboardStringHelper.GetString("DualModeWarningForWiMAX"), (object) @string), @string, new LinkLabelLinkClickedEventHandler(this.OnDualModeWarningForWiMAXClicked), CustomMessageBoxStyle.Ok, DontShowThisMessageAgainOptions.DualModeWarningForWiMAX);
this._dualModeWarningCMB.AccessibleName = "DualModeWarningMB";
this._dualModeWarningCMB.LocationOfMessageBox = CustomMessageBoxLocation.CenterOfDashboardOrInTaskTrayOnTop;
int num = (int) this._dualModeWarningCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true);
}
public void OnStateChange(object sender, object[] eventArgs)
{
AppFramework.Dashboard.SetDashboardMode();
if (Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.BlockedForRadioSwitch)
this.Cursor = Cursors.WaitCursor;
else
this.Cursor = Cursors.Default;
}
public void OnError(object sender, object[] eventArgs)
{
if (eventArgs == null || eventArgs.Length < 2)
return;
this.ShowErrorMessage((int) eventArgs[0], (OperationThatFailed) eventArgs[1]);
AppFramework.Dashboard.TheConnectionPanel.UpdateUI();
AppFramework.Dashboard.TheNetworkListPanel.UpdateUI(false);
if (AppFramework.Dashboard.TheTaskTray == null)
return;
AppFramework.Dashboard.TheTaskTray.UpdateUI();
}
public void OnMediaStatusChanged(object sender, object[] eventArgs)
{
if (MediaHandler.TheMedia.WiMAXIsReady)
this._aboutDlg.ReinitDialog();
DashboardAndTaskTray.CloseMessageBoxesIfNeeded();
if (MediaHandler.TheMedia.WiMAXIsReady)
AppFramework.Dashboard.ResetTrayIconVisibility();
this._connectionPanel.UpdateUI();
this._networkListPanel.UpdateUI(false);
}
public void OnIntelCUControlChanged(object sender, object[] eventArgs)
{
DashboardAndTaskTray.CloseMessageBoxesIfNeeded();
this._connectionPanel.UpdateUI();
}
public void OnUpdateDashboardMode(object sender, object[] eventArgs)
{
AppFramework.Dashboard.SetDashboardMode();
}
public void OnPostInitApplication(object sender, object[] eventArgs)
{
this._aboutDlg.ReinitDialog();
this._techSupportDlg.ReinitDialog();
if (AppFramework.TaskTray != null)
AppFramework.TaskTray.UpdateUI();
AppFramework.Dashboard.SetDashboardMode();
}
private void OnIPAddressStateChanged(object sender, object[] eventArgs)
{
this.TheConnectionPanel.UpdateUI();
this._subscriptionAndFirewallPopupShown = false;
if (Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.IPAddressState == IPAddressStateEnum.Invalid)
{
if (Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.BlockedForDisconnect || Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.BlockedForRadioSwitch)
return;
AppFramework.TaskTray.ShowTaskTrayNotification(DashboardStringHelper.GetString("BalloonMsg_WiMAXHasLimitedOrNoConnectivity"), TaskTrayPopupClickOptions.LaunchIPAddressHelp, true, false, true);
}
else
{
if (Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.IPAddressState != IPAddressStateEnum.Valid || NetworkHandler.ConnectedNetworks.Count <= 0 || SPEventsHandler.Singleton.FastReconnect)
return;
int numSecondsConnected = 0;
NetworkHandler.Singleton.GetConnectionTime(ref numSecondsConnected);
if (this._connectedCMB.Visible || !CurrentUserSettings.GetShowSubscribeForServiceAndFirewallPopup() || numSecondsConnected >= 20)
return;
this._subscriptionAndFirewallPopupShown = true;
string connectedBalloonText = WiMAXDisplayService.Singleton.GetConnectedBalloonText(NetworkHandler.ConnectedNetworks[0].WmxNetwork, true);
string string1 = DashboardStringHelper.GetString("OpenWebBrowserClickHere_Clickable");
if (Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToLower() == "ko")
{
this._connectedCMB = new ClickableCustomMessageBox(string.Format(DashboardStringHelper.GetString("SubscribeForServiceAndFirewallPopup"), (object) connectedBalloonText, (object) NetworkHandler.ConnectedNetworks[0].NetworkName, (object) string1), string1, (string) null, new LinkLabelLinkClickedEventHandler(this.OnSubscribeForServiceAndFirewallPopupClicked), CustomMessageBoxStyle.Ok, DontShowThisMessageAgainOptions.SubscribeForServiceAndFirewallPopup);
}
else
{
string string2 = DashboardStringHelper.GetString("CapitalClickHere_Clickable");
this._connectedCMB = new ClickableCustomMessageBox(string.Format(DashboardStringHelper.GetString("SubscribeForServiceAndFirewallPopup"), (object) connectedBalloonText, (object) NetworkHandler.ConnectedNetworks[0].NetworkName, (object) string1, (object) string2), string1, string2, new LinkLabelLinkClickedEventHandler(this.OnSubscribeForServiceAndFirewallPopupClicked), CustomMessageBoxStyle.Ok, DontShowThisMessageAgainOptions.SubscribeForServiceAndFirewallPopup);
}
this._connectedCMB.AccessibleName = "SubscribeForServiceAndFirewallWarningMB";
this._connectedCMB.LocationOfMessageBox = CustomMessageBoxLocation.CenterOfDashboardOrInTaskTrayOnTop;
int num = (int) this._connectedCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true);
}
}
public void OnConnected(object sender, object[] eventArgs)
{
this.PreferredDashboardMode = DashboardMode.Collapsed;
}
public void OnAdapterListChanged(object sender, object[] eventArgs)
{
AppFramework.Dashboard.SetDashboardMode();
this._connectionPanel.UpdateUI();
this._networkListPanel.UpdateUI(true);
}
public void OnChangePreferredDashboardMode(object sender, object[] eventArgs)
{
if (this.PreferredDashboardMode == DashboardMode.Collapsed)
{
this.PreferredDashboardMode = DashboardMode.Expanded;
}
else
{
if (ScanModeHandler.ScanMode == ScanModeEnum.BackgroundScanningDisabled)
{
Logging.LogEvent(TraceModule.SDK, TraceLevel.Info, (object) this, "Enabling background scanning because the user hid the network list.");
ScanModeHandler.ScanMode = ScanModeEnum.BackgroundScanningEnabled;
}
this.PreferredDashboardMode = DashboardMode.Collapsed;
}
}
public void ShowPreferencesDialog()
{
int num = (int) this._preferencesDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowAdvancedDialog()
{
int num = (int) this._advancedDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowManageNetworksDialog()
{
int num = (int) this._manageNetworksDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowTechSupportDialog()
{
int num = (int) this._techSupportDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowAboutDialog()
{
int num = (int) this._aboutDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowNetworkDetailsDialog()
{
int num = (int) this._networkDetailsDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowNetworkProperitesDialog(NetworkDisplayItem ndi)
{
this._networkProperitesDlg.Network = ndi;
this._networkProperitesDlg.Profile = ndi.WmxNetwork.Profile.TheProfile;
int num = (int) this._networkProperitesDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowNetworkProperitesDialog(ProfileDisplayItem pdi)
{
this._networkProperitesDlg.Network = (NetworkDisplayItem) null;
this._networkProperitesDlg.Profile = pdi.TheProfile;
int num = (int) this._networkProperitesDlg.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowFUMOProgressDialog()
{
int num = (int) this._fumoProgressDialog.ShowDialog((IWin32Window) AppFramework.Dashboard);
}
public void ShowMainWindow()
{
AppFramework.Dashboard.Visible = true;
AppFramework.Dashboard.WindowState = FormWindowState.Normal;
AppFramework.Dashboard.Activate();
AppFramework.Dashboard.SetDashboardMode();
AppFramework.Dashboard.TheConnectionPanel.UpdateUI();
AppFramework.Dashboard.TheNetworkListPanel.UpdateUI(false);
if (AppFramework.Dashboard.TheTaskTray == null)
return;
AppFramework.Dashboard.TheTaskTray.UpdateUI();
}
public void LaunchHelp(string strHelpTopic)
{
OnlineHelp.LaunchHelp(strHelpTopic);
}
public void SetTrayIconVisiblity()
{
if (this.TheTaskTray == null || this.TheTaskTray.TaskTrayNotifyIcon == null)
return;
if (CurrentUserSettings.GetShowTrayIconSetting())
{
this.TheTaskTray.TaskTrayNotifyIcon.Visible = true;
this.TheTaskTray.UpdateUI();
}
else
this.TheTaskTray.TaskTrayNotifyIcon.Visible = false;
}
public void SetDashboardMode()
{
if (ProfileHandler.Singleton.IsPreferredProfileSet())
{
if (Intel.Mobile.WiMAXCU.BizTier.ApplicationState.Singleton.ShouldControlBeEnabled(DashboardControlEnum.Window_ShowHideNetworkListLinkLabel))
this.ShowHideState = ShowHideStateEnum.Enabled;
else
this.ShowHideState = ShowHideStateEnum.Disabled;
}
else
this.ShowHideState = ShowHideStateEnum.Hidden;
if (!MediaHandler.TheMedia.WiMAXIsReady || !MediaHandler.IntelCUIsInControl || (!AdapterHandler.TheAdapter.RadioIsOn() || NetworkHandler.ConnectedNetworks.Count > 0))
{
this.ShowHideState = ShowHideStateEnum.Hidden;
this.DoCollapse();
}
else if (ProfileHandler.Singleton.IsPreferredProfileSet() && this._preferredDashboardMode == DashboardMode.Collapsed)
this.DoCollapse();
else
this.DoExpand();
}
public void UpdateDisplay()
{
this._networkListPanel.UpdateUI(false);
this._connectionPanel.UpdateUI();
}
public IContainer GetComponents()
{
return this.components;
}
private void CustomInitializeComponents()
{
new SecurityPermission(SecurityPermissionFlag.AllFlags).Demand();
this.AccessibleName = "Dashboard";
this._connectionPanel.AccessibleName = "ConnectionPanel";
this._networkListPanel.AccessibleName = "NetworkListPanel";
try
{
Dashboard.ChangeWindowMessageFilter(Dashboard._uniqueMsgId, Dashboard.MSGFLT_ADD);
}
catch (Exception ex)
{
Logging.LogEvent(TraceModule.SDK, TraceLevel.Warning, (object) this, Logging.GetMessageForException(ex));
}
this._windowDragHelper = new WindowDragHelper();
this.KeyDown += new KeyEventHandler(this.OnKeyDown);
this.Closing += new CancelEventHandler(this.OnClosing);
this.SizeChanged += new EventHandler(this.OnSizeChanged);
this.Load += new EventHandler(this.OnLoad);
this.Shown += new EventHandler(this.OnShown);
this.TheApdoEventHandler.SendToBack();
this.TheApdoEventHandler.Visible = false;
this.AddPanels();
this.Text = DashboardStringHelper.GetString("ApplicationCaption");
this.BackColor = CustomForm.FormBackColor;
this.FormBorderStyle = FormBorderStyle.None;
SizeHelper.ResizeCustomControls(this.Controls);
this.UpdateDisplay();
if (Dashboard.WTSRegisterSessionNotification(this.Handle, Dashboard.NOTIFY_FOR_THIS_SESSION))
return;
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
private void RegisterForEvents()
{
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnStateChange), (object) this, "WiMAXUI.OnStateChange");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnError), (object) this, "WiMAXUI.OnError");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnMediaStatusChanged), (object) this, "WiMAXUI.OnMediaStatusChanged");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnUpdateDashboardMode), (object) this, "WiMAXUI.OnUpdateDashboardMode");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnIntelCUControlChanged), (object) this, "WiMAXUI.OnIntelCUControlChanged");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnPostInitApplication), (object) this, "WiMAXUI.OnPostInitApplication");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnIPAddressStateChanged), (object) this, "WiMAXSP.OnIPAddressStateChanged");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnRestoreNetworkSettingsComplete), (object) this, "WiMAXSP.OnRestoreNetworkSettingsComplete");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnConnected), (object) this, "WiMAXSP.OnConnected");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnAdapterListChanged), (object) this, "WiMAXUI.OnAdapterListChanged");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnChangePreferredDashboardMode), (object) this, "WiMAXUI.OnChangePreferredDashboardMode");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnResetWiMAXDeviceComplete), (object) this, "WiMAXSP.OnResetWiMAXDeviceComplete");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnShowDualModeWarningForWiFi), (object) this, "WiMAXSP.OnShowDualModeWarningForWiFi");
Eventing.RegisterForUIEvent(new Eventing.EventDelegate(this.OnShowDualModeWarningForWiMAX), (object) this, "WiMAXSP.OnShowDualModeWarningForWiMAX");
}
private void AddPanels()
{
this._connectionPanel.Location = new Point(ImageHelper.Unscaled.FrameLeftPixel.Width, ImageHelper.Unscaled.FrameTopPixel.Height);
this.Controls.Add((Control) this._connectionPanel);
this._networkListPanel.Location = new Point(ImageHelper.Unscaled.FrameLeftPixel.Width, this._connectionPanel.Location.Y + this._connectionPanel.Height);
this.Controls.Add((Control) this._networkListPanel);
}
private void ShowErrorMessage(int errorCode, OperationThatFailed operationThatFailed)
{
if (Dashboard._errorMessageCount > 0)
return;
string helpTopic = (string) null;
string errorMsg = ErrorStringsHelper.GetString("General_UnknownOperation");
string errorDetails = ErrorHelper.TranslateErrorCodeToMessage(errorCode);
string accessibleName = "";
switch (operationThatFailed)
{
case OperationThatFailed.Connect:
if (ConnectModeHandler.ConnectMode == ConnectModeEnum.Automatic)
return;
if (ScanModeHandler.ScanMode == ScanModeEnum.BackgroundScanningDisabled)
{
errorMsg = string.Format(ErrorStringsHelper.GetString("General_ConnectFailedInManualScanMode"), (object) ErrorStringsHelper.GetString("General_ConnectFailed"));
accessibleName = "ConnectFailedInManualScanMode";
}
else
{
errorMsg = string.Format(ErrorStringsHelper.GetString("General_ErrorMessageWithClickHelp"), (object) ErrorStringsHelper.GetString("General_ConnectFailed"));
accessibleName = "ConnectFailed";
}
helpTopic = "/errors.htm#noconnect";
break;
case OperationThatFailed.StopConnect:
errorMsg = ErrorStringsHelper.GetString("General_StopConnectFailed");
accessibleName = "General_StopConnectFailed";
break;
case OperationThatFailed.Disconnect:
errorMsg = ErrorStringsHelper.GetString("General_DisconnectFailed");
accessibleName = "General_DisconnectFailed";
break;
case OperationThatFailed.RadioOn:
errorMsg = ErrorStringsHelper.GetString("General_RadioOnFailed");
accessibleName = "General_RadioOnFailed";
break;
case OperationThatFailed.RadioOff:
errorMsg = ErrorStringsHelper.GetString("General_RadioOffFailed");
accessibleName = "General_RadioOffFailed";
break;
case OperationThatFailed.Scan:
errorMsg = ErrorStringsHelper.GetString("General_ScanFailed");
accessibleName = "General_SearchFailed";
break;
case OperationThatFailed.StopScan:
errorMsg = ErrorStringsHelper.GetString("General_StopSearchFailed");
accessibleName = "General_StopSearchFailed";
break;
}
if (errorCode == 40975)
{
errorMsg = string.Format(ErrorStringsHelper.GetString("General_WiFiStillHasRadio"), (object) errorMsg);
accessibleName = "RadioOnFailedWiFiStillHasRadio";
}
++Dashboard._errorMessageCount;
ErrorHelper.ShowErrorDialogOnlyIfPrimaryCUAndSDKReady((Control) AppFramework.Dashboard, errorMsg, errorDetails, helpTopic, accessibleName);
--Dashboard._errorMessageCount;
}
private void DoExpand()
{
int num1 = ImageHelper.FrameLeftPixel.Width + ImageHelper.FrameRightPixel.Width;
int num2 = ImageHelper.FrameTopPixel.Height + ImageHelper.BtnContractedCorner.Height;
int width = num1 + this._connectionPanel.Width;
int height = num2 + (this._connectionPanel.Height + this._networkListPanel.Height);
this._networkListPanel.Visible = true;
this._networkListPanel.Focus();
this.Size = new Size(width, height);
this.Expanded = true;
this.TheConnectionPanel.UpdateUI();
}
private void DoCollapse()
{
int num1 = ImageHelper.FrameLeftPixel.Width + ImageHelper.FrameRightPixel.Width;
int num2 = ImageHelper.FrameTopPixel.Height + ImageHelper.BtnContractedCorner.Height;
int width = num1 + this._connectionPanel.Width;
int height = num2 + this._connectionPanel.Height;
this._networkListPanel.Visible = false;
this._connectionPanel.Focus();
this.Size = new Size(width, height);
this.Expanded = false;
this.TheConnectionPanel.UpdateUI();
}
private void DoInitApplication(object obj)
{
Eventing.GenerateUIEvent("WiMAXUI.OnUpdateDashboardMode", (object) this, new object[0]);
Thread.Sleep(750);
AppHandler.InitApplication();
Eventing.GenerateUIEvent("WiMAXUI.OnPostInitApplication", (object) this, new object[0]);
}
}
}