Example #1
0
        public override void NewCommand_Execute(object obj)
        {
            NewWindow nv = new NewWindow(new FizickoLice(), obj as Window);

            nv.Show();
            AfterWindowClosing(nv, obj as Window);
        }
        private Task Add(Command command)
        {
            switch (command)
            {
            case Command.ToggleWindow:
                return(ToggleWindow.Add());

            case Command.NextTab:
                return(NextTab.Add());

            case Command.PreviousTab:
                return(PreviousTab.Add());

            case Command.NewTab:
                return(NewTab.Add());

            case Command.CloseTab:
                return(CloseTab.Add());

            case Command.NewWindow:
                return(NewWindow.Add());

            case Command.ShowSettings:
                return(ShowSettings.Add());

            case Command.Copy:
                return(Copy.Add());

            case Command.Paste:
                return(Paste.Add());
            }

            return(Task.CompletedTask);
        }
Example #3
0
        private void OnNewWindow(object sender, CancelEventArgs args)
        {
            switch (_newWindowsBehavior)
            {
            case NewWindowsBehavior.Ignore:
                args.Cancel = true;
                break;

            case NewWindowsBehavior.ReplaceCurrent:
                _inner?.Navigate(_inner.StatusText);
                args.Cancel = true;
                break;

            case NewWindowsBehavior.OpenInBrowser:
                break;

            case NewWindowsBehavior.MultiTab:
                NewWindow?.Invoke(this, new NewWindowEventArgs(_inner?.StatusText ?? string.Empty));
                args.Cancel = true;
                break;

            case NewWindowsBehavior.Callback:
                var newArgs = new NewWindowEventArgs(_inner?.StatusText ?? string.Empty);
                NewWindow?.Invoke(this, newArgs);
                args.Cancel = newArgs.Cancel;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #4
0
        private void BtnStart_Click(object sender, EventArgs e)
        {
            frmMain NewWindow;

            if (rad3Min.Checked == true)
            {
                NewWindow = new frmMain(3);
            }
            else if (rad10Min.Checked == true)
            {
                NewWindow = new frmMain(10);
            }
            else
            {
                int time;
                if (!String.IsNullOrWhiteSpace(txtOther.Text) && int.TryParse(txtOther.Text, out time) && time < 100)
                {
                    NewWindow = new frmMain(time);
                }
                else
                {
                    MessageBox.Show("Time entered must be an integer less than 100.");
                    return;
                }
            }
            //make this form invisible while the new window opens, make it visible again when new window closes
            this.Visible = false;
            NewWindow.ShowDialog();
            NewWindow.Dispose();
            this.Visible = true;
        }
Example #5
0
        private void Rename(object para)
        {
            Note note = para as Note;

            if (note == null)
            {
                return;
            }
            NewWindow newWindow = new NewWindow(this)
            {
                Owner = mainWindow
            };

            newWindow.ShowDialog();
            if (TitleInput == "")
            {
                return;
            }
            string oldPath = note.FilePath;
            string newName = TitleInput;

            if (dataService.RenameData(oldPath, newName))
            {
                NoteList.Remove(note);
                NoteList.Add(new Note(dataService.GetPath(newName)));
                SelectedIndex = NoteList.Count - 1;
                OnAddedNewNote();
            }
            TitleInput = "";
        }
Example #6
0
        protected override void ProcessRecord()
        {
            var ctl = new NavItem
            {
                Key       = Key,
                Text      = Text,
                Url       = Url,
                Icon      = Icon,
                IconColor = IconColor
            };

            if (NewWindow.IsPresent)
            {
                ctl.NewWindow = NewWindow.ToBool();
            }

            if (Expanded.IsPresent)
            {
                ctl.Expanded = Expanded.ToBool();
            }

            if (SubItems != null)
            {
                foreach (var subItem in SubItems)
                {
                    ctl.SubItems.Add(subItem);
                }
            }

            SetControlProps(ctl);

            WriteObject(ctl);
        }
Example #7
0
 void ComWebBrowser_NewWindow(
     string URL,
     int Flags,
     string TargetFrameName,
     ref object PostData,
     string Headers,
     ref bool Processed)
 => NewWindow?.Invoke(URL, TargetFrameName, ref Processed);
Example #8
0
    public void CreateNewWindow()
    {
        NewWindow window = new NewWindow
        {
            DataContext = new NewWindowViewModel()
        };

        window.Show();
    }
Example #9
0
        private void CreateANewWindow(NewWindow message)
        {
            string windowId = "Window" + _counter++;
            var    vm       = new MainWindowViewModel(Self, windowId);

            _activeActorRef = CustomActorSystem.Instance.ActorSystemEx().ActorOf(Props.Create <MainWindowUIActor>(vm));
            CreateNewWindow.Create(vm);
            _childWindows.Add(windowId, _activeActorRef);
        }
Example #10
0
        protected override void OnExecute(object parameter)
        {
            NewWindow newWindow = new NewWindow();

            if (newWindow.ShowDialog().Value)
            {
                ProjectMgr.Instance.NewProject(newWindow.AssessmentName, newWindow.Description, newWindow.Thumbnail);
            }
        }
    public void CreateNewWindow(ViewModelBase newWindowViewModel)     // *new*
    {
        NewWindow window = new NewWindow()
        {
            DataContext = newWindowViewModel
        };

        window.Show();
    }
 private void zongTab_Drop(object sender, DragEventArgs e)
 {
     if (zongTab.ZongTabSelectedIndex == -1)
     {
         return;
     }
     List <Channel> dropList = (List <Channel>)e.Data.GetData(typeof(List <Channel>));
     TabItem        tab      = (TabItem)zongTab.ZongTabSelectedItem;
     NewWindow      win      = (NewWindow)tab.Content;
 }
        protected override void ProcessRecord()
        {
            var ctl = new PsButton();

            SetControlProps(ctl);

            ctl.Text          = Text;
            ctl.SecondaryText = SecondaryText;
            ctl.Url           = Url;
            ctl.Title         = Title;
            ctl.Icon          = Icon;
            ctl.IconColor     = IconColor;
            ctl.OnClick       = OnClick;

            if (NewWindow.IsPresent)
            {
                ctl.NewWindow = NewWindow.ToBool();
            }

            if (Primary.IsPresent)
            {
                ctl.Primary = Primary.ToBool();
            }

            if (Compound.IsPresent)
            {
                ctl.Compound = Compound.ToBool();
            }

            if (Action.IsPresent)
            {
                ctl.Action = Action.ToBool();
            }

            if (Toolbar.IsPresent)
            {
                ctl.Toolbar = Toolbar.ToBool();
            }

            if (Split.IsPresent)
            {
                ctl.Split = Split.ToBool();
            }

            if (MenuItems != null)
            {
                foreach (var menuItem in MenuItems)
                {
                    ctl.MenuItems.Add(menuItem);
                }
            }

            WriteObject(ctl);
        }
Example #14
0
        public override void UpdateCommand_Execute(object obj)
        {
            OsobaViewModel ovm = obj as OsobaViewModel;

            if (ovm != null && SelectedItem != null && ovm._mainWindow != null)
            {
                NewWindow nv = new NewWindow(SelectedItem, ovm._mainWindow);
                nv.Show();
                AfterWindowClosing(nv, ovm._mainWindow as Window);
            }
        }
Example #15
0
 public void SetNewWindowsBehavior(NewWindowsBehavior mode)
 {
     if (_inner == null)
     {
         return;
     }
     _inner.LifeSpanHandler = new LifeSpanHandler(mode, url => {
         var args = new NewWindowEventArgs(url);
         NewWindow?.Invoke(this, args);
         return(args.Cancel);
     });
 }
Example #16
0
        private void Button_Click_Full(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;

            button.Visibility = Visibility.Collapsed;
            NewWindow newWindow = new NewWindow();

            newWindow.page = MainWindow.main.MainCol.Content;
            newWindow.Show();
            MainWindow.main.changePage(new Full(), MainWindow.main.MainTitle.Text);
            MainWindow.main.WindowState = WindowState.Minimized;
        }
Example #17
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            var window = new MdiWindow();
            Windows.Add(window);

            if (NewWindow != null)
            {
                NewWindow.Invoke(this, new NewWindowEventArgs() { Window = window });
            }

            return window;
        }
Example #18
0
        private async void ShowJson()
        {
            var item = SelectedItem;

            _jsonWindowId = await NewWindow.Create(typeof(Views.JsonPage), "JSON", _jsonWindowId);

            if (item.Data != null)
            {
                GetEvent <ShowJsonEvent>().Publish(item.IsRequest ? item.Data.RequestBody : item.Data.ResponseBody);
            }
            else
            {
                GetEvent <ShowJsonEvent>().Publish(item.Text);
            }
        }
        protected override void ProcessRecord()
        {
            var ctl = new PsLink();

            SetControlProps(ctl);

            ctl.Value   = Value;
            ctl.Url     = Url;
            ctl.Title   = Title;
            ctl.Size    = Size;
            ctl.OnClick = OnClick;

            if (NewWindow.IsPresent)
            {
                ctl.NewWindow = NewWindow.ToBool();
            }

            if (Bold.IsPresent)
            {
                ctl.Bold = Bold.ToBool();
            }

            if (Italic.IsPresent)
            {
                ctl.Italic = Italic.ToBool();
            }

            if (Pre.IsPresent)
            {
                ctl.Pre = Pre.ToBool();
            }

            if (Align.HasValue)
            {
                ctl.Align = Align.Value;
            }

            if (Controls != null)
            {
                foreach (var control in Controls)
                {
                    ctl.Controls.Add(control);
                }
            }

            WriteObject(ctl);
        }
        protected override void ProcessRecord()
        {
            var ctl = new PsMenuItem();

            SetControlProps(ctl);

            ctl.Text          = Text;
            ctl.SecondaryText = SecondaryText;
            ctl.Url           = Url;
            ctl.Icon          = Icon;
            ctl.IconColor     = IconColor;
            ctl.OnClick       = OnClick;

            if (NewWindow.IsPresent)
            {
                ctl.NewWindow = NewWindow.ToBool();
            }

            if (IconOnly.IsPresent)
            {
                ctl.IconOnly = IconOnly.ToBool();
            }

            if (Split.IsPresent)
            {
                ctl.Split = Split.ToBool();
            }

            if (Divider.IsPresent)
            {
                ctl.Divider = Divider.ToBool();
            }

            if (SubMenuItems != null)
            {
                foreach (var subMenuItem in SubMenuItems)
                {
                    ctl.SubMenuItems.Add(subMenuItem);
                }
            }

            WriteObject(ctl);
        }
Example #21
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            //makes a new game window based on the time limit chosen
            frmMain NewWindow;

            if (rad3Min.Checked)
            {
                NewWindow = new frmMain(3);
            }
            else
            {
                NewWindow = new frmMain(10);
            }

            //make this form invisible while the new window opens, make it visible again when new window closes
            this.Visible = false;
            NewWindow.ShowDialog();
            NewWindow.Dispose();
            this.Visible = true;
        }
Example #22
0
        protected override void OnExecute(object parameter)
        {
            if (ProjectMgr.Instance.App == null)
            {
                return;
            }

            NewWindow newWindow = new NewWindow();

            newWindow.AssessmentName = ProjectMgr.Instance.App.Name;
            newWindow.Description    = ProjectMgr.Instance.App.Description;
            newWindow.Thumbnail      = ProjectMgr.Instance.App.Thumbnail;
            if (newWindow.ShowDialog().Value)
            {
                ProjectMgr.Instance.App.Name        = newWindow.AssessmentName;
                ProjectMgr.Instance.App.Description = newWindow.Description;
                ProjectMgr.Instance.App.Thumbnail   = newWindow.Thumbnail;
                ProjectMgr.Instance.Changed         = true;
            }
        }
Example #23
0
        public void ChangeWindow(string newWindowName, bool addToStack = true)
        {
            var newGo = _cachedWindows[newWindowName];

            NewWindow = GetWindow(newGo);

            if (CurrentWindow != null)
            {
                ClosePreviousWindow(CurrentWindow);
            }
            if (CurrentWindow == null ||
                NewWindow.PartnerNavigationWindow() != GetWindow(CurrentWindow).PartnerNavigationWindow())
            {
                ChangeNavigationWindow(NewWindow.PartnerNavigationWindow());
            }
            AppData.Ref.BlackBackground.SetActive(NewWindow.UseBlackBackground());
            AppSession.CurrentBackButtonBehavior = NewWindow.SetBackButtonBehavior();
            CurrentWindow = newGo;
            NewWindow.Setup();
            newGo.SetActive(true);
            _windowIsStackable = addToStack;
        }
Example #24
0
        public override void Perform()
        {
            //There will be at most 5 Windows. And It can't remove the first Window.
            if (WindowList.Count > 5 || (IsRemove && WindowList.Count > 1))
            {
                //The new Window already got created and shown.
                NewWindow.Close();

                //Select removed Window from 1 to Count-1.
                RemoveIndex = RemoveIndex % (WindowList.Count - 1) + 1;
                Window removeWindow = WindowList[RemoveIndex];

                //Close the window before removing it.
                removeWindow.Close();

                WindowList.Remove(removeWindow);
            }
            else
            {
                WindowList.Add(NewWindow);
            }
        }
Example #25
0
 private void VDCheckTimer_Tick(object sender, EventArgs e)
 {
     try
     {
         if (vdm.IsWindowOnCurrentVirtualDesktop(Handle))
         {
             return;
         }
         if (_isWindowMoved)
         {
             return;
         }
         using (_nw = new NewWindow())
         {
             _nw.Show(null);
             vdm.MoveWindowToDesktop(Handle, vdm.GetWindowDesktopId(_nw.Handle));
             _isWindowMoved = true;
         }
     }
     catch
     {
         //This will fail due to race conditions as currently written on occassion
     }
 }
Example #26
0
        private void New(object parameter)
        {
            TitleInput = "";
            NewWindow newWindow = new NewWindow(this)
            {
                Owner = mainWindow
            };

            newWindow.ShowDialog();
            if (TitleInput == "")
            {
                return;
            }
            Note newNote = dataService.AddNewData(TitleInput);

            if (newNote != null)
            {
                NoteList.Add(newNote);
                SelectedIndex = NoteList.Count - 1;
                OnAddedNewNote();
            }
            ClearSearchResult();
            TitleInput = "";
        }
Example #27
0
 public BrightnessContrastWindow(NewWindow controlledWindow)
 {
     ControlledWindow = controlledWindow;
     InitializeComponent();
     ControlledWindow.PrepareCanvasForFiltering();
 }
Example #28
0
 public void Action(object sender, EventArgs e)
 {
     NewWindow baru = new NewWindow("baru");
 }
Example #29
0
 public ColorBalanceControl(NewWindow controlledWindow)
 {
     ControlledWindow = controlledWindow;
     InitializeComponent();
     ControlledWindow.PrepareCanvasForFiltering();
 }
Example #30
0
 public void OnNewWindow(EventArgs e)
 {
     NewWindow?.Invoke(this, e);
 }