private void ReferenceWindow_ContentRendered(object sender, EventArgs e)
        {
            IsShowing        = true;
            image.MoveBorder = eventBorder;
            image.MyBorder   = border;

            imgHandler = new ImageHandler(image);
            imgHandler.SourceChange += ImgHandler_SourceChange;
            //imgHandler.InitatedLoad();


            focus = new FocusManager(this);
            drag  = new DragManager();

            state     = new StateManager(this);
            Commander = new ReferenceWindowCommander(this);


            SettingsManager.ModeChange += focus.ModeChanged;

            if (PreloadState != null)
            {
                state.SetState(PreloadState);
            }
            if (PreloadImage != null)
            {
                imgHandler.LoadImage(PreloadImage);
            }
        }
Exemplo n.º 2
0
        private void ManagerWindow_ContentRendered(object sender, EventArgs e)
        {
            referenceWindows = new List <ReferenceWindow>();
            drag             = new DragManager();


            pw = new ProtectionWindow();
            WindowListBox.ItemsSource = referenceWindows;

            //Handle when start the program by drag .zrf on the icon.
            var lines = Environment.GetCommandLineArgs();

            if (lines.Length == 2)
            {
                FileInfo f = new FileInfo(lines[1]);
                if (f.Extension.ToLower() == ".zrf")
                {
                    LoadState(lines[1]);
                }
            }

            //To make things easier later:
            Directory.CreateDirectory(Environment.CurrentDirectory + "\\Presets");
        }