示例#1
0
    public void Show()
    {
        foreach (Graphic g in graphics)
        {
            g.enabled = true;
        }

        Showed?.Invoke();
    }
        public void PushTo(Layer RenderGroup)
        {
            if (IsShowed)
            {
                throw new Exception("This object is already showed");
            }
            RenderGroup.RenderGroup.Add(this);

            IsShowed = true;
            Showed?.Invoke(this, null);
        }
示例#3
0
        public void ShowContext()
        {
            if (_isShowed)
            {
                return;
            }

            _isShowed = true;

            SetContextParameters(1f, true);
            Showed?.Invoke(this);
        }
 public void ShowWindow()
 {
     if (Settings.SettingsHolder.ForceSoftwareRendering)
     {
         RenderOptions.ProcessRenderMode = RenderMode.Default;
     }
     Dispatcher.Invoke(() =>
     {
         Topmost = false; Topmost = true;
         Opacity = 0;
         Show();
         Showed?.Invoke();
         BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(200)));
     });
 }
示例#5
0
 public virtual void ShowWindow()
 {
     if (App.Settings.ForceSoftwareRendering)
     {
         RenderOptions.ProcessRenderMode = RenderMode.Default;
     }
     Dispatcher?.InvokeAsync(() =>
     {
         BeginAnimation(OpacityProperty, null);
         Opacity = 0;
         Show();
         Showed?.Invoke();
         RefreshTopmost();
         BeginAnimation(OpacityProperty, _showAnim);
     });
 }
示例#6
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            for (var i = 0; i < _uiElements.Count; i++)
            {
                _uiElements[i].Update(gameTime);
            }
            _currentModalElement?.Update(gameTime);

            if (_waitForShowed && _uiElements.All(e => e.State == UiState.Active))
            {
                _waitForShowed = false;
                Showed?.Invoke();
            }

            if (_waitForHidden && _uiElements.All(e => e.State == UiState.Inactive))
            {
                _waitForHidden = false;
                Hidden?.Invoke();
            }
        }
示例#7
0
        async void ContextMenu_Action(string action)
        {
            bool remove = action == "Remove";

            if (action == "Open Containing Folder")
            {
                if (File.Exists(_path))
                {
                    Showed?.Invoke(Path.GetDirectoryName(_path));
                }
                else
                {
                    remove |= await ShouldRemove();
                }
            }

            if (remove)
            {
                Removed?.Invoke(this, _path);
            }
        }
        async void ContextMenu_Click(object sender, EventArgs e)
        {
            Window root = (Window)this.GetVisualRoot();

            root.Focus();

            IInteractive item = ((RoutedEventArgs)e).Source;

            if (item is MenuItem selected)
            {
                bool remove = (string)selected.Header == "Remove";

                if ((string)selected.Header == "Open Containing Folder")
                {
                    if (File.Exists(_path))
                    {
                        Showed?.Invoke(Path.GetDirectoryName(_path));
                    }
                    else
                    {
                        remove |= await MessageWindow.Create(
                            $"An error occurred while locating the file.\n\n" +
                            "You may not have sufficient privileges to read from the destination folder, or\n" +
                            "the file you're attempting to locate has been moved.\n\n" +
                            "Would you like to remove it from the Recent Projects list?",
                            new string[] { "Yes", "No" }, root
                            ) == "Yes";
                    }
                }

                if (remove)
                {
                    Removed?.Invoke(this, _path);
                }
            }
        }
示例#9
0
 public void Show()
 {
     canvas.enabled = true;
     OnShow();
     Showed?.Invoke(this);
 }
示例#10
0
 public void Show()
 {
     Showed?.Invoke();
 }
示例#11
0
 static void Form_Showed(object sender, EventArgs e)
 {
     Showed?.Invoke((Form)sender);
 }
示例#12
0
 protected virtual void OnShowed(GameObjectUI arg1)
 {
     Showed?.Invoke(arg1, EventArgs.Empty);
 }