Inheritance: INotifyPropertyChanged
コード例 #1
0
ファイル: DisplaySettings.cs プロジェクト: Aixile/Etupirka
        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;
            }
        }
コード例 #2
0
ファイル: InformationManager.cs プロジェクト: Aixile/Etupirka
 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();
     }
 }
コード例 #3
0
ファイル: DisplaySettings.cs プロジェクト: Aixile/Etupirka
 public static void RestoreDisplay(GameInfo game = null)
 {
     if (lastDisplayInfo != null && game == currentGame)
     {
         AdjustDisplay(lastDisplayInfo);
         lastDisplayInfo = null;
         currentGame = null;
     }
 }