Inheritance: INotifyPropertyChanged
Ejemplo n.º 1
0
        public static void AdjustDisplay(DisplayInfo displayInfo, GameInfo game = null)
        {
            if (currentGame != null && game != null) return;

            bool displayChanged = false;
            DisplayInfo current = GetDisplayDevices();
            lastDisplayInfo = new DisplayInfo();

            foreach (var device in displayInfo.devices)
            {
                if (device.Enabled && current.devices.Any(_device => device.DeviceID == _device.DeviceID) && device.Scaling != getDeviceScaling(device.DeviceID))
                {
                    lastDisplayInfo.devices.Add(new DisplayDeviceInfo() { DeviceID = device.DeviceID, Scaling = getDeviceScaling(device.DeviceID), Enabled = true });
                    if (setDeviceScaling(device.DeviceID, device.Scaling))
                    {
                        displayChanged = true;
                    }
                }
            }

            if (displayChanged)
            {
                currentGame = game;
                restartDisplayDrivers();
            }
            else
            {
                lastDisplayInfo = null;
            }
        }
Ejemplo n.º 2
0
 public void getEsInfo(GameInfo g)
 {
     using (SQLiteCommand command = conn.CreateCommand())
     {
         conn.Open();
         command.CommandText = "SELECT * FROM erogamescape WHERE id='" + g.ErogameScapeID + "' ";
         SQLiteDataReader reader = command.ExecuteReader();
         while (reader.Read())
         {
             g.Title = reader["title"].ToString();
             g.Brand = reader["brand"].ToString();
             g.SaleDay = DateTime.ParseExact(reader["saleday"].ToString(), "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
         }
         conn.Close();
     }
 }
Ejemplo n.º 3
0
 public static void RestoreDisplay(GameInfo game = null)
 {
     if (lastDisplayInfo != null && game == currentGame)
     {
         AdjustDisplay(lastDisplayInfo);
         lastDisplayInfo = null;
         currentGame = null;
     }
 }