static void AddToStack(NotifierViewBase notifier) { using (var helper = PersistentMemoryMapping.GetHelper()) { var list = helper.Read <List <MyRectangular> >(); if (list == null) { list = new List <MyRectangular>(); } list.Add(notifier.myRectangular); helper.Write(list); } }
public static void ShowView(NotifierViewBase view, ShowOptions options = null, bool showDialog = false) { if (view == null) { return; } if (options != null) { view.Options = options; } if (view.Options.IsEnabledSounds) { SystemSounds.Asterisk.Play(); } if (view.Options.IsFixedSizeOrContentToWH) { view.SizeToContent = SizeToContent.Manual; view.Width = view.Options.Width; view.Height = view.Options.Height; } else { view.SizeToContent = SizeToContent.WidthAndHeight; } view.Loaded += OverrideLoaded; view.ShowInTaskbar = false; if (!view.Options.IsAutoClose) { view.Closing += OverrideClosing; } if (showDialog) { view.ShowDialog(); } else { view.Show(); } }