Beispiel #1
0
        /// <summary>
        /// Apply Blur Effect on the window
        /// </summary>
        /// <param name="win">parent window</param>
        public static void ApplyEffect(this System.Windows.Window win)
        {
            // Create new effective objects
            System.Windows.Media.Effects.BlurEffect objBlur = new System.Windows.Media.Effects.BlurEffect {
                Radius = 5
            };
            System.Windows.Media.SolidColorBrush mask = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkGray)
            {
                Opacity = 50
            };

            // Buffering ...
            effectBuffer = win.Effect;
            brushBuffer  = win.OpacityMask;

            // in windows 10, the dispatcher way doesn't seem to work anymore
            if (Environment.OSVersion.Version.Major >= 10)
            {
                win.Effect      = objBlur;
                win.OpacityMask = mask;
            }
            else
            {
                // Change this.win effective objects
                win.Dispatcher.Invoke(new Action(delegate { win.Effect = objBlur; }), System.Windows.Threading.DispatcherPriority.Normal);
                win.Dispatcher.Invoke(new Action(delegate { win.OpacityMask = mask; }), System.Windows.Threading.DispatcherPriority.Normal);
            }
        }
Beispiel #2
0
        public USC_ALERTS()
        {
            try
            {
                InitializeComponent();

                DtQuantity = flag.Fill_DataGrid_join("SELECT [ID_Product],[Name],[Quantity]  FROM [dbo].[Products] where exist='true' and Quantity <= '" + Properties.Settings.Default.Quantity + "' and UnitQuantity ='0'");
                DtDate     = flag.Fill_DataGrid_join("SELECT [ID_Product],[Name],[EX_Date]  FROM [dbo].[Products] where exist='true' and TRY_CONVERT(date,EX_Date) <= '" + DateTime.Now.AddDays(Convert.ToDouble(Properties.Settings.Default.Date)).ToShortDateString() + "' ");

                for (int i = 0; i < DtQuantity.Rows.Count; i++)
                {
                    Grid grd = new Grid {
                        Height = 100, FlowDirection = FlowDirection.RightToLeft, Background = Brushes.White
                    };

                    grd.MouseEnter += StackPanel_PreviewMouseMove;
                    grd.MouseLeave += stptst_MouseLeave;

                    Thickness th  = new Thickness(20);
                    TextBlock txt = new TextBlock {
                        FlowDirection = FlowDirection.RightToLeft, FontSize = 25, Text = (DtQuantity.Rows[i].ItemArray[1] + " : " + "  الكمية المتبقية  " + DtQuantity.Rows[i].ItemArray[2] + "  قطعة"), Padding = th, FontFamily = txtx.FontFamily
                    };
                    grd.Children.Add(txt);

                    ef = grd.Effect;
                    stp.Children.Add(grd);
                }

                for (int i = 0; i < DtDate.Rows.Count; i++)
                {
                    if (DtDate.Rows[i].ItemArray[2].ToString() == "")
                    {
                        continue;
                    }
                    Grid grd = new Grid {
                        Height = 100, FlowDirection = FlowDirection.RightToLeft, Background = Brushes.White
                    };

                    grd.MouseEnter += StackPanel_PreviewMouseMove;
                    grd.MouseLeave += stptst_MouseLeave;

                    Thickness th  = new Thickness(20);
                    TextBlock txt = new TextBlock {
                        FlowDirection = FlowDirection.RightToLeft, FontSize = 25, Text = (DtDate.Rows[i].ItemArray[1] + " : " + "   تاريخ انتهاء الصلاحية   " + DtDate.Rows[i].ItemArray[2]), Padding = th, FontFamily = txtx.FontFamily
                    };
                    grd.Children.Add(txt);

                    ef = grd.Effect;
                    stp.Children.Add(grd);
                }
                //DateTime dt = DateTime.Now.AddDays(Convert.ToDouble(Properties.Settings.Default.Date));
                //MessageBox.Show(dt.ToShortDateString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #3
0
 private void Window_Closed(object sender, System.EventArgs e)
 {
     foreach (Window win in DockControl.DockManager.Instance.DockableWindows)
     {
         System.Windows.Media.Effects.Effect effect = null;
         mWinEffects.TryGetValue(win, out effect);
         win.Effect = effect;
     }
 }
Beispiel #4
0
 public MainWindow()
 {
     InitializeComponent();
     FileName        = string.Empty;
     bodyEffect      = bodyGrid.Effect;
     bodyGrid.Effect = null;
     this.Icon       = Common.QuestionsAndAnswers.ToBitmapImage(Properties.Resources.Question);
     InitEvents();
     InitTaskModes();
     Task task = Common.PropertyManager.DownloadNewVersion();
 }
Beispiel #5
0
        /// <summary>
        /// Apply Blur Effect on the window
        /// </summary>
        /// <param name="win">parent window</param>
        public static void ApplyEffect(this System.Windows.Window win)
        {
            // Create new effective objects
            var objBlur = new System.Windows.Media.Effects.BlurEffect { Radius = 5 };
            var mask = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkGray) { Opacity = 50 };

            // Buffering ...
            effectBuffer = win.Effect;
            brushBuffer = win.OpacityMask;

            // Change this.win effective objects
            win.Dispatcher.Invoke(new Action(delegate { win.Effect = objBlur; }), System.Windows.Threading.DispatcherPriority.Normal);
            win.Dispatcher.Invoke(new Action(delegate { win.OpacityMask = mask; }), System.Windows.Threading.DispatcherPriority.Normal);
        }
Beispiel #6
0
        /// <summary>
        /// Apply Blur Effect on the window
        /// </summary>
        /// <param name=”win”></param>
        public static void ApplyEffect(this System.Windows.Window win)
        {
            // Create new effective objects
            System.Windows.Media.Effects.BlurEffect objBlur = new System.Windows.Media.Effects.BlurEffect();
            objBlur.Radius = 5;
            System.Windows.Media.SolidColorBrush mask = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkGray);
            mask.Opacity = 50;

            // Buffering ...
            effectBuffer = win.Effect;
            brushBuffer  = win.OpacityMask;

            // Change this.win effective objects

            win.Dispatcher.Invoke(new Action(delegate { win.Effect = objBlur; }), System.Windows.Threading.DispatcherPriority.Normal);
            win.Dispatcher.Invoke(new Action(delegate { win.OpacityMask = mask; }), System.Windows.Threading.DispatcherPriority.Normal);
        }
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effect">The effect to use in this container</param>
 #endregion
 public EffectContainer(Effect effect)
 {
     Effect = effect;
 }
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effectPath">The path to the effect file to use in this container</param>
 /// <param name="contentManagerName">The name of the content manager to use to load this effect</param>
 #endregion
 public EffectContainer(String effectPath, String contentManagerName)
 {
     Effect = FlatRedBallServices.Load <Effect>(effectPath, contentManagerName);
 }
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effectPath">The path to the effect file to use in this container</param>
 #endregion
 public EffectContainer(String effectPath)
 {
     Effect = FlatRedBallServices.Load <Effect>(effectPath);
 }
Beispiel #10
0
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effect">The effect to use in this container</param>
 #endregion
 public EffectContainer(Effect effect)
 {
     Effect = effect;
 }
Beispiel #11
0
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effectPath">The path to the effect file to use in this container</param>
 /// <param name="contentManagerName">The name of the content manager to use to load this effect</param>
 #endregion
 public EffectContainer(String effectPath, String contentManagerName)
 {
     Effect = FlatRedBallServices.Load<Effect>(effectPath, contentManagerName);
 }
Beispiel #12
0
 /// <summary>
 /// Creates an effect container
 /// </summary>
 /// <param name="effectPath">The path to the effect file to use in this container</param>
 #endregion
 public EffectContainer(String effectPath)
 {
     Effect = FlatRedBallServices.Load<Effect>(effectPath);
 }