Exemplo n.º 1
0
 /// <summary>
 /// Clean up resources to prepare for exit
 /// </summary>
 public void Cleanup()
 {
     if (LongToaster != null)
     {
         LongToaster.Dispose();
         LongToaster = null;
     }
     if (ShortToaster != null)
     {
         ShortToaster.Dispose();
         ShortToaster = null;
     }
 }
Exemplo n.º 2
0
        public void ShowToasterNotification(string message, bool extraTime)
        {
            //create on first use
            if (LongToaster == null)
            {
                LongToaster = new Toast.Notifier(cfg =>
                {
                    cfg.PositionProvider       = new ToastP.PrimaryScreenPositionProvider(ToastP.Corner.BottomRight, 10, 10);
                    cfg.LifetimeSupervisor     = new ToastL.TimeAndCountBasedLifetimeSupervisor(TimeSpan.FromSeconds(120), ToastL.MaximumNotificationCount.FromCount(8));
                    cfg.Dispatcher             = Application.Current.Dispatcher;
                    cfg.DisplayOptions.TopMost = true;
                    cfg.DisplayOptions.Width   = 600;
                });
            }
            if (ShortToaster == null)
            {
                ShortToaster = new Toast.Notifier(cfg =>
                {
                    cfg.PositionProvider       = new ToastP.PrimaryScreenPositionProvider(ToastP.Corner.BottomRight, 10, 10);
                    cfg.LifetimeSupervisor     = new ToastL.TimeAndCountBasedLifetimeSupervisor(TimeSpan.FromSeconds(12), ToastL.MaximumNotificationCount.FromCount(8));
                    cfg.Dispatcher             = Application.Current.Dispatcher;
                    cfg.DisplayOptions.TopMost = true;
                    cfg.DisplayOptions.Width   = 600;
                });
            }

            message += " (Systematizer)";
            var options = new ToastC.MessageOptions {
                FontSize = 15
            };

            if (extraTime)
            {
                ToastM.InformationExtensions.ShowInformation(LongToaster, message, options);
            }
            else
            {
                ToastM.InformationExtensions.ShowInformation(ShortToaster, message, options);
            }

            SystemSounds.Exclamation.Play();
        }
Exemplo n.º 3
0
        public Tutorijal(RacunarskiCentar racunarskiCentar, ObservableCollection <Softver> softveri, bool izmena, string oznaka,
                         Notifier notifierMainWindow, UndoRedoStack stack, OrderedDictionary prethodnaStanja)
        {
            notifierError = new Notifier(cfg =>
            {
                cfg.PositionProvider = new WindowPositionProvider(
                    parentWindow: this,
                    corner: Corner.TopRight,
                    offsetX: 20,
                    offsetY: 10);

                cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor(
                    notificationLifetime: System.TimeSpan.FromSeconds(5),
                    maximumNotificationCount: MaximumNotificationCount.FromCount(1));

                cfg.Dispatcher = Application.Current.Dispatcher;
            });
            this.potvrdio           = false;
            this.stekStanja         = stack;
            this.notifierMainWindow = notifierMainWindow;
            InitializeComponent();
            this.racunarskiCentar                  = racunarskiCentar;
            this.izmena                            = izmena;
            this.unosPrviPut                       = true;
            this.oznakaSoftveraZaIzmenu            = oznaka;
            this.dodavanjeSoftveraIzborStarogUnosa = false;
            tabelaSoftvera                         = softveri;
            noviSoftver                            = new Softver();
            if (!izmena)
            {
                oznakaSoftver.Focus();
            }
            BackStepMenuItem.IsEnabled     = false;
            this.prethodnaStanjaAplikacije = prethodnaStanja;
            this.staroStanje = null;

            //ukljuci prvi pop-up
            popupOznaka.IsOpen = true;
            pop = popupOznaka;
            Window w = this;

            if (null != w)
            {
                w.LocationChanged += delegate(object sender, EventArgs e)
                {
                    var offset = popupOznaka.HorizontalOffset;
                    popupOznaka.HorizontalOffset = offset + 1;
                    popupOznaka.HorizontalOffset = offset;

                    offset = popupNaziv.HorizontalOffset;
                    popupNaziv.HorizontalOffset = offset + 1;
                    popupNaziv.HorizontalOffset = offset;

                    offset = popupOS.HorizontalOffset;
                    popupOS.HorizontalOffset = offset + 1;
                    popupOS.HorizontalOffset = offset;

                    offset = popupProizvodjac.HorizontalOffset;
                    popupProizvodjac.HorizontalOffset = offset + 1;
                    popupProizvodjac.HorizontalOffset = offset;

                    offset = popupNastavi.HorizontalOffset;
                    popupNastavi.HorizontalOffset = offset + 1;
                    popupNastavi.HorizontalOffset = offset;

                    offset = popupSajt.HorizontalOffset;
                    popupSajt.HorizontalOffset = offset + 1;
                    popupSajt.HorizontalOffset = offset;

                    offset = popupGodina.HorizontalOffset;
                    popupGodina.HorizontalOffset = offset + 1;
                    popupGodina.HorizontalOffset = offset;

                    offset = popupCena.HorizontalOffset;
                    popupCena.HorizontalOffset = offset + 1;
                    popupCena.HorizontalOffset = offset;

                    offset = popupOpis.HorizontalOffset;
                    popupOpis.HorizontalOffset = offset + 1;
                    popupOpis.HorizontalOffset = offset;

                    offset = popupZavrsi.HorizontalOffset;
                    popupZavrsi.HorizontalOffset = offset + 1;
                    popupZavrsi.HorizontalOffset = offset;
                };

                w.SizeChanged += delegate(object sender, SizeChangedEventArgs e)
                {
                    var offset = popupOznaka.HorizontalOffset;
                    popupOznaka.HorizontalOffset = offset + 1;
                    popupOznaka.HorizontalOffset = offset;

                    offset = popupNaziv.HorizontalOffset;
                    popupNaziv.HorizontalOffset = offset + 1;
                    popupNaziv.HorizontalOffset = offset;

                    offset = popupOS.HorizontalOffset;
                    popupOS.HorizontalOffset = offset + 1;
                    popupOS.HorizontalOffset = offset;

                    offset = popupProizvodjac.HorizontalOffset;
                    popupProizvodjac.HorizontalOffset = offset + 1;
                    popupProizvodjac.HorizontalOffset = offset;

                    offset = popupNastavi.HorizontalOffset;
                    popupNastavi.HorizontalOffset = offset + 1;
                    popupNastavi.HorizontalOffset = offset;

                    offset = popupSajt.HorizontalOffset;
                    popupSajt.HorizontalOffset = offset + 1;
                    popupSajt.HorizontalOffset = offset;

                    offset = popupGodina.HorizontalOffset;
                    popupGodina.HorizontalOffset = offset + 1;
                    popupGodina.HorizontalOffset = offset;

                    offset = popupCena.HorizontalOffset;
                    popupCena.HorizontalOffset = offset + 1;
                    popupCena.HorizontalOffset = offset;

                    offset = popupOpis.HorizontalOffset;
                    popupOpis.HorizontalOffset = offset + 1;
                    popupOpis.HorizontalOffset = offset;

                    offset = popupZavrsi.HorizontalOffset;
                    popupZavrsi.HorizontalOffset = offset + 1;
                    popupZavrsi.HorizontalOffset = offset;
                };
            }
        }