예제 #1
0
            public GlowWindow(PpsWindow ownerWindow, GlowDirection direction)
            {
                this.ownerWindow = ownerWindow;
                this.direction   = direction;

                CreateWindow(
                    caption: String.Empty,
                    style: NativeMethods.WS_POPUP | NativeMethods.WS_CLIPCHILDREN | NativeMethods.WS_CLIPSIBLINGS,
                    exStyle: NativeMethods.WS_EX_TOOLWINDOW | NativeMethods.WS_EX_LAYERED,
                    parentWindow: new WindowInteropHelper(ownerWindow).Owner
                    );
                CreateBitmaps();
            }             // ctor
예제 #2
0
        /// <summary></summary>
        /// <param name="owner"></param>
        /// <param name="appSettingsKey"></param>
        public PpsWindowApplicationSettings(PpsWindow owner, string appSettingsKey = "")
        {
            this.owner = owner;

            isResizeable = owner.ResizeMode != ResizeMode.NoResize;
            SettingsKey  = appSettingsKey;

            if (UpgradeSettings)
            {
                Upgrade();
                this[nameof(UpgradeSettings)] = false;
            }

            persistTimer       = new DispatcherTimer(TimeSpan.FromMilliseconds(10000), DispatcherPriority.ApplicationIdle, (sender, e) => Save(), owner.Dispatcher);
            this.owner.Closed += (sender, e) =>
            {
                if (persistTimer.IsEnabled)                 // force save on close
                {
                    Save();
                }
            };

            InitWindowPlacement();
        }         // ctor