GUI/SharpDisplay.cs
branchMiniDisplay
changeset 453 017874772461
parent 452 79a3f5946a87
     1.1 --- a/GUI/SharpDisplay.cs	Mon Jan 25 21:05:35 2016 +0100
     1.2 +++ b/GUI/SharpDisplay.cs	Thu Jan 28 20:22:46 2016 +0100
     1.3 @@ -18,7 +18,6 @@
     1.4  using OpenHardwareMonitor.Hardware;
     1.5  using OpenHardwareMonitor.Utilities;
     1.6  using System.Runtime.InteropServices;
     1.7 -using UacHelpers;
     1.8  using System.ServiceModel;
     1.9  using SharpLib.Display;
    1.10  
    1.11 @@ -54,19 +53,26 @@
    1.12              //Connect our client
    1.13              //Instance context is then managed by our client class
    1.14              iClient = new Client();
    1.15 +            iClient.CloseOrderEvent += OnCloseOrder;
    1.16              //
    1.17 -			iTextFieldTop = new TextField("", ContentAlignment.MiddleLeft,0,0);
    1.18 +            iTextFieldTop = new TextField("", ContentAlignment.MiddleLeft,0,0);
    1.19  			iTextFieldBottom = new TextField("", ContentAlignment.MiddleLeft, 0, 1);
    1.20  			iTextFieldTopRight = new TextField("", ContentAlignment.MiddleRight,1,0);
    1.21  			iTextFieldBottomRight = new TextField("", ContentAlignment.MiddleRight,1,1);
    1.22  			//
    1.23  			iClient.Open();
    1.24  			iClient.SetName("Open Hardware Monitor");
    1.25 -      iClient.SetPriority(Priorities.SystemMonitor);
    1.26 +            iClient.SetPriority(Priorities.SystemMonitor);
    1.27  
    1.28 -      CreateFields();
    1.29 +            CreateFields();
    1.30          }
    1.31  
    1.32 +        public void OnCloseOrder()
    1.33 +        {            
    1.34 +            iClient.Close();
    1.35 +        }
    1.36 +
    1.37 +
    1.38          private void HardwareRemoved(IHardware hardware)
    1.39          {
    1.40              hardware.SensorAdded -= new SensorEventHandler(SensorAdded);
    1.41 @@ -136,8 +142,6 @@
    1.42          {
    1.43              const int KNumberOfTickBeforeSwitch = 4;
    1.44              const int KMaxCharacterPerLine = 16;
    1.45 -            string packedFirstLine = ""; //We have 16 chars per line on our VFD
    1.46 -            string packedSecondLine = "";
    1.47              int count = 0;
    1.48  
    1.49              //string time = DateTime.Now.ToShortTimeString();
    1.50 @@ -344,7 +348,6 @@
    1.51              iTextFieldTop.Text = aUpperLine;
    1.52              iTextFieldBottom.Text = aLowerLine;
    1.53              iClient.SetFields(iTextFields);
    1.54 -
    1.55          }
    1.56  
    1.57          public void Quit()