private void Page_Saved(object sender, EventArgs e)
 {
     if (Services.Data.App_CloseConfigOnSave)
     {
         WindowInstance.Close();
     }
 }
    private void OKButton_Click(object sender, RoutedEventArgs e)
    {
        CanceledByUser = false;

        // Close the dialog
        WindowInstance.Close();
    }
Exemplo n.º 3
0
 private void TipViewModel_OnWShow(object sender, EventArgs e)
 {
     UpdateVariable();
     if (!config.options.Style.IsThruTipWindow)
     {
         WindowInstance.Focus();
     }
     HandleAutoAction();
 }
Exemplo n.º 4
0
        private void radButtonRelocate_Click(object sender, EventArgs e)
        {
            WindowInstance selectedWindow = (WindowInstance)radDropDownListWindow.SelectedItem.Value;
            Screen         selectedScreen = (Screen)radDropDownListScreen.SelectedItem.Value;
            int            x = StringFormatter.ToInt(radTextBoxX.Text, 0);
            int            y = StringFormatter.ToInt(radTextBoxY.Text, 0);

            Relocator.Relocate(selectedWindow.handerId, selectedScreen, x, y, radCheckBoxRemoveTitle.Checked);
        }
Exemplo n.º 5
0
        public override void OnRequestClose()
        {
            WindowInstance.Close();

            if (Requester != null)
            {
                Requester.RefreshView();
            }
        }
Exemplo n.º 6
0
        private static void PrintHTML(string html)
        {
            WindowInstance wp = Window.Open("", "PrintPage");

            wp.Document.Open();
            wp.Document.Write(html);
            wp.Document.Close();
            wp.Document.Body.Focus();
            wp.Print();
        }
Exemplo n.º 7
0
    private async void OKButton_ClickAsync(object sender, RoutedEventArgs e)
    {
        if (!await ViewModel.CreateArchiveAsync())
        {
            return;
        }

        // Close the dialog
        WindowInstance.Close();
    }
Exemplo n.º 8
0
    private void DialogAction_ActionHandled(object sender, DialogMessageActionHandledEventArgs e)
    {
        // Set the result
        DialogResult = e.ActionResult;

        // Close if set to do so
        if (e.ShouldCloseDialog)
        {
            WindowInstance.Close();
        }
    }
Exemplo n.º 9
0
        public void CreateWindow(UserControl usercontrol, Brush borderColor)
        {
            var windowInstance = new WindowInstance(this, borderColor)
            {
                UserControlInstance = usercontrol, WindowName = ((IWindow)usercontrol.DataContext).Windowname
            };

            _userControlInstances.Insert(0, windowInstance);
            UserControlInstances = _userControlInstances;
            UpdateView(usercontrol);
        }
    private Task AppGameRefreshRequiredAsync(object sender, RefreshRequiredEventArgs e)
    {
        if (e.GameCollectionModified && e.ModifiedGames.Contains(ViewModel.Game))
        {
            ForceClose = true;
            WindowInstance.Close();

            return(Task.CompletedTask);
        }

        return(Task.CompletedTask);
    }
Exemplo n.º 11
0
        private Project1UIButton CreateButtonElement(ElementModel element)
        {
            var button = new Project1UIButton();

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            button.Width      = element.Width;
            button.Height     = element.Height;
            button.FontSize   = element.FontSize;
            button.Opacity    = element.Opacity;
            button.FontWeight = element.IsTextBold ? FontWeights.Bold : FontWeights.Normal;
            if (element.Style != null)
            {
                var res = WindowInstance.TryFindResource(element.Style);
                if (res != null)
                {
                    button.Style = res as Style;
                }
                else
                {
                    res = WindowInstance.TryFindResource("default");
                    if (res != null)
                    {
                        button.Style = res as Style;
                    }
                }
            }

            button.Content = element.Text;
            var binding = new Binding();

            binding.Source = this;
            binding.Mode   = BindingMode.OneWay;
            binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            binding.Path = new PropertyPath("TakeButtonVisibility");

            switch (element.Command)
            {
            case "rest":
                button.Command = resetCommand;
                BindingOperations.SetBinding(button, Button.VisibilityProperty, binding);
                break;

            case "break":
                button.Command = busyCommand;
                BindingOperations.SetBinding(button, Button.VisibilityProperty, binding);
                break;
            }

            return(button);
        }
Exemplo n.º 12
0
        internal void DeleteView(WindowInstance windowInstance)
        {
            var index = UserControlInstances.IndexOf(windowInstance);

            UserControlInstances.Remove(windowInstance);

            var newIndex = index == 0 ? index : index - 1;

            if (UserControlInstances.Count != 0 && newIndex >= 0)
            {
                UserControlInstances[newIndex].IsActive = true;
                UpdateView(UserControlInstances[newIndex].UserControlInstance);
            }
            else
            {
                AktuellesTab = null;
            }
        }
Exemplo n.º 13
0
 public static void OpenRecordInNewWindow(string id, string typeName)
 {
     // We need to open in a new window and openEntityForm will replace the current window.
     // This can be replaced when Carina is released
     try
     {
         // In the outlook client we can't use main.aspx with openStdWindow because it returns 'The given key was not present in the dictionary.'
         // string url = "{0}/main.aspx?etn={1}&extraqs=&id=%7b{2}%7d&pagetype=entityrecord";
         string         url       = "{0}/userdefined/edit.aspx?etc={3}&id=%7b{2}%7d";
         int?           etc       = (int?)Script.Literal("Mscrm.EntityPropUtil.EntityTypeName2CodeMap[{0}]", typeName);
         int            height    = 1300; // Height of the Record Page.
         int            width     = 900;  // Width of the Record Page.
         string         serverUrl = String.Format(url, Page.Context.GetClientUrl(), typeName, id.Replace("{", "").Replace("}", ""), etc);
         string         name      = id.Replace("{", "").Replace("}", "").Replace("-", "");
         WindowInstance win       = Window.Open(serverUrl, "drillOpen", String.Format("height={0},width={1}", height, width));
         Script.Literal("{0}.focus()", win);
         //Utility.OpenWebResource(@"dev1_/html/Redirect.htm", serverUrl, width, height);
     }
     catch { }
 }
Exemplo n.º 14
0
    private async Task AttemptConfirmAsync()
    {
        DriveSelectionVM.UpdateReturnValue();

        // Make sure a drive was selected
        if (DriveSelectionVM.Result.SelectedDrives == null || !DriveSelectionVM.Result.SelectedDrives.Any())
        {
            Logger.Warn("No drive has been selected");
            return;
        }

        if (!DriveSelectionVM.Result.SelectedDrives.Select(x => new FileSystemPath(x)).DirectoriesExist())
        {
            Logger.Warn("Selected drive no longer exists");
            await DriveSelectionVM.RefreshAsync();

            return;
        }

        if (!DriveSelectionVM.BrowseVM.AllowNonReadyDrives && DriveSelectionVM.Result.SelectedDrives.Any(x =>
        {
            try
            {
                return(!new DriveInfo(x).IsReady);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Checking if drive is ready");
                return(true);
            }
        }))
        {
            Logger.Warn("One or more of the selected drives are not ready");
            await DriveSelectionVM.RefreshAsync();

            return;
        }

        DriveSelectionVM.Result.CanceledByUser = false;
        WindowInstance.Close();
    }
Exemplo n.º 15
0
    private static void InstantiateWindow(Windows windowType, bool status)
    {
        WindowInstance window = windows[windowType];

        if (window.Active == status)
        {
            return;
        }

        CloseAllWindow();

        if (status)
        {
            GameObject go = Instantiate(Resources.Load <GameObject>("Windows/" + windowType), canvas);
            window.Window = go;
        }
        else
        {
            window.Window = null;
        }
    }
Exemplo n.º 16
0
 public Touch CreateTouch(WindowInstance view, EventTarget target, int identifier, int pageX, int pageY)
 {
     return(default(Touch));
 }
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     // Close the dialog
     WindowInstance.Close();
 }
Exemplo n.º 18
0
 /// <summary>
 /// Intializes the value of a mouse event once it's been created (normally using document.createEvent method).
 /// </summary>
 /// <param name="type">the string to set the event's type to. Possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout.</param>
 /// <param name="canBubble">whether or not the event can bubble.</param>
 /// <param name="cancelable">whether or not the event's default action can be prevented.</param>
 /// <param name="view">the Event's AbstractView. You should pass the window object here. </param>
 /// <param name="detail">the Event's mouse click count.</param>
 /// <param name="screenX">the Event's screen x coordinate.</param>
 /// <param name="screenY">the Event's screen y coordinate. </param>
 /// <param name="clientX">the Event's client x coordinate.</param>
 /// <param name="clientY">the Event's client y coordinate. </param>
 /// <param name="ctrlKey">whether or not control key was depressed during the Event. </param>
 /// <param name="altKey">whether or not alt key was depressed during the Event.</param>
 /// <param name="shiftKey">whether or not shift key was depressed during the Event.</param>
 /// <param name="metaKey">whether or not meta key was depressed during the Event.</param>
 /// <param name="button">the Event's mouse event.button.</param>
 /// <param name="relatedTarget">the Event's related EventTarget. Only used with some event types (e.g. mouseover and mouseout). In other cases, pass null.</param>
 public virtual void InitMouseEvent(string type, bool canBubble, bool cancelable, WindowInstance view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, Element relatedTarget)
 {
 }
Exemplo n.º 19
0
 public Touch CreateTouch(WindowInstance view, EventTarget target, int identifier, int pageX, int pageY, int screenX, int screenY, int clientX, int clientY, int radiusX)
 {
     return(default(Touch));
 }
 private void VM_InstallationComplete(object sender, EventArgs e)
 {
     WindowInstance.Close();
 }
Exemplo n.º 21
0
 public Touch CreateTouch(WindowInstance view, EventTarget target)
 {
     return(default(Touch));
 }
Exemplo n.º 22
0
 public static jQuery Element(WindowInstance window)
 {
     return(null);
 }
Exemplo n.º 23
0
 public Touch CreateTouch(WindowInstance view, EventTarget target, int identifier, int pageX, int pageY, int screenX, int screenY, int clientX, int clientY, int radiusX, int radiusY, double rotationAngle, double force)
 {
     return(default(Touch));
 }
Exemplo n.º 24
0
 public static void SetWindow(WindowInstance newWin)
 {
 }
Exemplo n.º 25
0
 private void Cancel_Click(object sender, RoutedEventArgs e)
 {
     DriveSelectionVM.Result.CanceledByUser = true;
     WindowInstance.Close();
 }
Exemplo n.º 26
0
 /// <summary>
 /// The initKeyEvent method is used to initialize the value of an event created using document.createEvent("KeyboardEvent")
 /// </summary>
 /// <param name="type">The type of event.</param>
 /// <param name="bubbles">A boolean indicating whether the event should bubble up through the event chain or not (see bubbles).</param>
 /// <param name="cancelable">A boolean indicating whether the event can be canceled.</param>
 /// <param name="view">Specifies UIEvent.view. This value may be null.</param>
 /// <param name="ctrlKey">bool True if the Virtual Key to be generated is a combination of the Ctrl key and other keys</param>
 /// <param name="altKey">bool True if the Virtual Key to be generated is a combination of the Alt key and other keys</param>
 /// <param name="shiftKey">bool True if the Virtual Key to be generated is a combination of the Shift key and other keys</param>
 /// <param name="metaKey">bool True if the Virtual Key to be generated is a combination of the Meta key and other keys</param>
 /// <param name="keyCode">unsigned long the virtual key code value of the key which was depressed, otherwise zero</param>
 /// <param name="charCode">unsigned long the Unicode character associated with the depressed key otherwise zero</param>
 public virtual extern void InitKeyEvent(string type, bool bubbles, bool cancelable, WindowInstance view, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int keyCode, int charCode);
Exemplo n.º 27
0
 /// <summary>
 /// The initKeyEvent method is used to initialize the value of an event created using document.createEvent("KeyboardEvent")
 /// </summary>
 /// <param name="type">The type of event.</param>
 /// <param name="bubbles">A boolean indicating whether the event should bubble up through the event chain or not (see bubbles).</param>
 /// <param name="cancelable">A boolean indicating whether the event can be canceled.</param>
 /// <param name="view">Specifies UIEvent.view. This value may be null.</param>
 /// <param name="ctrlKey">bool True if the Virtual Key to be generated is a combination of the Ctrl key and other keys</param>
 /// <param name="altKey">bool True if the Virtual Key to be generated is a combination of the Alt key and other keys</param>
 /// <param name="shiftKey">bool True if the Virtual Key to be generated is a combination of the Shift key and other keys</param>
 /// <param name="metaKey">bool True if the Virtual Key to be generated is a combination of the Meta key and other keys</param>
 /// <param name="keyCode">unsigned long the virtual key code value of the key which was depressed, otherwise zero</param>
 /// <param name="charCode">unsigned long the Unicode character associated with the depressed key otherwise zero</param>
 public virtual extern void InitKeyEvent(string type, bool bubbles, bool cancelable, WindowInstance view, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int keyCode, int charCode);
Exemplo n.º 28
0
 private void OnWindowChanged(WindowInstance window, ChangeTrackerState state)
 {
     UpdateState();
 }
 private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
 {
     WindowInstance.Close();
 }
Exemplo n.º 30
0
 /// <summary>
 /// Intializes the value of a mouse event once it's been created (normally using document.createEvent method).
 /// </summary>
 /// <param name="type">the string to set the event's type to. Possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout.</param>
 /// <param name="canBubble">whether or not the event can bubble.</param>
 /// <param name="cancelable">whether or not the event's default action can be prevented.</param>
 /// <param name="view">the Event's AbstractView. You should pass the window object here. </param>
 /// <param name="detail">the Event's mouse click count.</param>
 /// <param name="screenX">the Event's screen x coordinate.</param>
 /// <param name="screenY">the Event's screen y coordinate. </param>
 /// <param name="clientX">the Event's client x coordinate.</param>
 /// <param name="clientY">the Event's client y coordinate. </param>
 /// <param name="ctrlKey">whether or not control key was depressed during the Event. </param>
 /// <param name="altKey">whether or not alt key was depressed during the Event.</param>
 /// <param name="shiftKey">whether or not shift key was depressed during the Event.</param>
 /// <param name="metaKey">whether or not meta key was depressed during the Event.</param>
 /// <param name="button">the Event's mouse event.button.</param>
 /// <param name="relatedTarget">the Event's related EventTarget. Only used with some event types (e.g. mouseover and mouseout). In other cases, pass null.</param>
 public virtual void InitMouseEvent(string type, bool canBubble, bool cancelable, WindowInstance view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, Element relatedTarget)
 {
 }
Exemplo n.º 31
0
        internal ProcessInstanceListItem(WindowInstance pro, Process process)
        {
            InitializeComponent();
            Main.Background = new SolidColorBrush(Color.FromArgb(100, 0, 0, 0));

            MouseDown += ((object sender, MouseButtonEventArgs args) =>
            {
                if (args.LeftButton == MouseButtonState.Pressed)
                {
                    (Common.Window.ContentFrame.Content as WindowSelectionPage).ChangeSelectedProcess(this);
                }
            });

            MouseDoubleClick += ((object sender, MouseButtonEventArgs args) =>
            {
                if (args.LeftButton == MouseButtonState.Pressed)
                {
                    (Common.Window.ContentFrame.Content as WindowSelectionPage).ChangeSelectedProcess(this);
                    Common.Window.SetCurrentView(NavigationButtons.Window_Configuration);
                }
            });

            ProcessID = process.Id;

            try
            {
                Icon i = Icon.ExtractAssociatedIcon(process.MainModule.FileName);
                if (i != null)
                {
                    ProcessIcon.Source = ImageConversion.ToImageSource(i);
                }
                else
                {
                    ProcessIcon.Source = ImageConversion.ToImageSource(Icon.FromHandle(SystemIcons.Application.Handle));
                }
            } catch (Win32Exception) { }

            if (WindowInstanceManager.SaveProfileContainer.Profiles.ContainsKey(WinAPI.GetWindowClassName(pro.InstanceProcess.MainWindowHandle)))
            {
                HasProfileImage.Visibility = Visibility.Visible;
            }
            if (pro.IsAdminProcess)
            {
                IsAdminImage.Visibility = Visibility.Visible;
            }
            ProcessName.Text   = (!string.IsNullOrEmpty(pro.InstanceProcess.MainWindowTitle) && !string.IsNullOrWhiteSpace(pro.InstanceProcess.MainWindowTitle)) ? pro.InstanceProcess.MainWindowTitle : pro.InstanceProcess.ProcessName;
            ProcessGIType.Text = pro.GDI.ToString();
            ProcessIconBackground.Background = new SolidColorBrush(Color.FromArgb(100, 0, 0, 0));

            Timer t = new Timer();

            t.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds;
            t.Elapsed += (async(object sender, ElapsedEventArgs args) =>
            {
                await Common.Window.Dispatcher.InvokeAsync(() =>
                {
                    try
                    {
                        pro.InstanceProcess.Refresh();
                        ProcessName.Text = (!string.IsNullOrEmpty(pro.InstanceProcess.MainWindowTitle) && !string.IsNullOrWhiteSpace(pro.InstanceProcess.MainWindowTitle)) ? pro.InstanceProcess.MainWindowTitle : pro.InstanceProcess.ProcessName;
                    }
                    catch (Exception) { }
                });
            });
            t.Start();
        }
Exemplo n.º 32
0
 public static EnvironmentType GetInstanceFromWindow(WindowInstance win) =>
 (win.Navigator.UserAgent.Contains("IndustrialAndroidWebApp") ||
  BridgeObjectUtil.HasFieldOrMethod(win, "IAWApp"))
         ? EnvironmentType.IndustrialAndroidWebApp
         : EnvironmentType.Desktop;
Exemplo n.º 33
0
 public static extern jQuery.Elements jQuery(WindowInstance window);