Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Application a = new Application();

            var k = myinics.GetValue("Lisans Anahtari");


            bool lisans = WpfApp4.Lisans.LisansKontrol(k);

            if (string.IsNullOrEmpty(k) || !lisans)
            {
                Window3 yeni = new Window3();
                yeni.ShowDialog();

                if (Window3.lis == 0)
                {
                    MessageBox.Show("Hatalı Lisans Anahtarı Girdiniz");
                }
                else
                {
                    MessageBox.Show("Lisans Aktive Edilmiştir!");
                }
                return;
            }

            a.StartupUri = new Uri("Window1.xaml", System.UriKind.Relative);
            a.Run();
        }
        private void dinner_Click(object sender, RoutedEventArgs e)
        {
            Dinner test = new Dinner();

            if (test.checkHours())//if current time is earlier than breakfast hours open breakfast menu
            {
                Window win3 = new Window3();
                win3.Show();
                this.Hide();//THIS keyword is not needed but helps me think what is happening
            }
            else//even if its 11am breakfast will no longer be served
            {
                MessageBox.Show("It is not lunch time yet");
                return;
            }
        }