Exemple #1
0
 private void Window_KeyUp(object sender, KeyEventArgs e)
 {
     if ((e.Key == Key.Up || e.Key == Key.Down || e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Home))
     {
         MainAppMenu.Focus();
     }
 }
Exemple #2
0
 private void Window_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Source.GetType().FullName != "System.Windows.Controls.MenuItem" && !MainAppMenu.IsFocused && (e.Key == Key.Up || e.Key == Key.Down || e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Home))
     {
         MainAppMenu.Focus();
     }
 }
Exemple #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tw.session = session;
            String yes = "دارید";
            String no  = "ندارید";

            if (session.userType != "admin")
            {
                InsertPermLbl.Content += (session.allowInsert) ? yes : no;
                SearchPermLbl.Content += (session.allowSearch) ? yes : no;
                DeletePermLbl.Content += (session.allowDelete) ? yes : no;
                EditPermLbl.Content   += (session.allowEdit) ? yes : no;

                Config_Menu.Items.Remove(Manage_Users_MenuItem);
            }
            else
            {
                expander1.Visibility = Visibility.Hidden;
            }
            StreamReader sr = null;

            try
            {
                sr = new StreamReader(mainDirectory + "\\configBack.conf");
                String name = sr.ReadToEnd();
                Uri    uri  = new Uri(mainDirectory + "\\backgrounds\\" + name, UriKind.Absolute);
                image1.Source = new BitmapImage(uri);
                sr.Close();
            }
            catch (Exception)
            {
                if (sr != null)
                {
                    sr.Close();
                }
            }

            DoubleAnimation Dblanimation = new DoubleAnimation();

            Dblanimation.From     = 0;
            Dblanimation.To       = 600;
            Dblanimation.Duration = new Duration(TimeSpan.FromSeconds(3));
            tb1.BeginAnimation(TextBlock.WidthProperty, Dblanimation);

            dockManager.ParentWindow = this;
            tw.DockManager           = dockManager;
            tw.Show(Dock.Right);

            dockManagerMusic.ParentWindow = this;
            mmp.DockManager = dockManagerMusic;
            mmp.Show(Dock.Bottom);

            MainAppMenu.Focus();
            // for farsi language =>
            //InputSimulator.SimulateKeyDown(VirtualKeyCode.SHIFT);
            //InputSimulator.SimulateKeyPress(VirtualKeyCode.LMENU);
            //InputSimulator.SimulateKeyUp(VirtualKeyCode.SHIFT);
        }
Exemple #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            StreamReader sr = null;

            try
            {
                sr = new StreamReader("configBack.conf");
                String name = sr.ReadToEnd();
                Uri    uri  = new Uri(Environment.CurrentDirectory + "\\backgrounds\\" + name, UriKind.Absolute);
                image1.Source = new BitmapImage(uri);
                sr.Close();
            }
            catch (Exception)
            {
                if (sr != null)
                {
                    sr.Close();
                }
            }

            DoubleAnimation Dblanimation = new DoubleAnimation();

            Dblanimation.From     = 0;
            Dblanimation.To       = 600;
            Dblanimation.Duration = new Duration(TimeSpan.FromSeconds(3));
            tb1.BeginAnimation(TextBlock.WidthProperty, Dblanimation);

            dockManager.ParentWindow = this;
            tw.DockManager           = dockManager;
            tw.Show(Dock.Right);

            MainAppMenu.Focus();
            // for farsi language =>
            //InputSimulator.SimulateKeyDown(VirtualKeyCode.SHIFT);
            //InputSimulator.SimulateKeyPress(VirtualKeyCode.LMENU);
            //InputSimulator.SimulateKeyUp(VirtualKeyCode.SHIFT);
        }