コード例 #1
0
ファイル: MDIDialog.cs プロジェクト: AnomalousMedical/Engine
 protected virtual void onShown(EventArgs args)
 {
     if (Shown != null)
     {
         Shown.Invoke(this, args);
     }
 }
コード例 #2
0
ファイル: UIPageBase.cs プロジェクト: phosphoer/ggj-2021
    public void Show(bool playAnim)
    {
        if (!_isVisible)
        {
            _isVisible = true;
            gameObject.SetActive(true);

            if (playAnim)
            {
                foreach (UIHydrate hydrate in _hydrateOnShow)
                {
                    hydrate.Hydrate();
                }
            }

            Shown?.Invoke();

            if (IsModal)
            {
                CanvasCursor.PushVisible();

                if (PlayerCharacterController.Instance != null)
                {
                    PlayerCharacterController.Instance.PushDisableControls();
                }
            }
        }

        EnsureFadeRoutine();
    }
コード例 #3
0
 /// <summary>
 /// Shows (expands) the toolbar
 /// </summary>
 public void Show()
 {
     Expand(); if (Shown != null)
     {
         Shown.Invoke(this, new EventArgs());
     }
 }
コード例 #4
0
        internal virtual void Draw()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            if (!Visible)
            {
                return;
            }

            BeforeDrawControl();
            DrawControl();
            DrawChildControls();
            DrawBorder();
            AfterDrawControl();

            if (!HasShown)
            {
                if (Shown != null)
                {
                    Shown.Invoke(this, EventArgs.Empty);
                }
                HasShown = true;
            }
        }
コード例 #5
0
 private void fireShown()
 {
     if (Shown != null)
     {
         Shown.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #6
0
        public void Show()
        {
            ObjC.Call(Handle, "center");
            ObjC.Call(Handle, "makeKeyAndOrderFront:", IntPtr.Zero);

            MacApplication.SynchronizationContext.Post(s => Shown?.Invoke(this, EventArgs.Empty), null);
        }
コード例 #7
0
        public Dialog()
        {
            _dialog = DependencyService.Get <IDialog>(DependencyFetchTarget.NewInstance);
            if (_dialog == null)
            {
                throw new Exception("Object reference not set to an instance of a Dialog.");
            }

            _dialog.Hidden += (s, e) =>
            {
                Hidden?.Invoke(this, EventArgs.Empty);
            };

            _dialog.OutsideClicked += (s, e) =>
            {
                OutsideClicked?.Invoke(this, EventArgs.Empty);
            };

            _dialog.Shown += (s, e) =>
            {
                Shown?.Invoke(this, EventArgs.Empty);
            };

            _dialog.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(ContentProperty, new Binding(nameof(Content), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(PositiveProperty, new Binding(nameof(Positive), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(NeutralProperty, new Binding(nameof(Neutral), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(NegativeProperty, new Binding(nameof(Negative), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(TitleProperty, new Binding(nameof(Title), mode: BindingMode.OneWayToSource, source: _dialog));
        }
コード例 #8
0
        public void MenuOptions_Loaded(object sender, RoutedEventArgs e)
        {
            NextTitle.Text = TitleText;
            NextTitle.BeginAnimation(TextBlock.OpacityProperty, new DoubleAnimation(1.0, TimeSpan.FromSeconds(0.1)));

            for (Int32 i = 0; i < OptionNames.Count; i++)
            {
                TextBlock textBlock = new TextBlock()
                {
                    Text = OptionNames[i], Foreground = Brushes.White, FontSize = 18, Opacity = 0.0, Margin = new Thickness(12, 4, 0, 0)
                };

                DoubleAnimation appear = new DoubleAnimation(0.8, TimeSpan.FromSeconds(0.1));
                appear.BeginTime = TimeSpan.FromSeconds(i * 0.1);

                if (i == OptionNames.Count - 1)
                {
                    appear.Completed += (s, args) => {
                        _selector.Opacity = 1.0;
                        Shown?.Invoke(this, new EventArgs());
                    };
                }

                textBlock.BeginAnimation(TextBlock.OpacityProperty, appear);

                NextOptions.Children.Add(textBlock);
            }

            _selector.Opacity = 0.0;
            MenuOptions_Transitioned(this, new EventArgs());
        }
コード例 #9
0
ファイル: Window.cs プロジェクト: furesoft/FureOS
        public void Show()
        {
            IsVisible = true;
            OnLoad();
            Invalidate();

            Shown?.Invoke(this);
        }
コード例 #10
0
        /// <summary>
        /// Shows the modal.
        /// </summary>
        /// <returns></returns>
        public async Task Show()
        {
            if (!IsVisible)
            {
                IsVisible = true;
                await Shown.InvokeAsync(null);

                StateHasChanged();
            }
        }
コード例 #11
0
        public virtual void Show(Vector2i position)
        {
            Left    = $"{position.X}px";
            Top     = $"{position.Y}px";
            Visible = true;

            OnShown();
            Shown?.Invoke(this);
            FitInWindow();
        }
コード例 #12
0
ファイル: SoftKeyboard.cs プロジェクト: x5f3759df/Citrus
 public void Show(bool show, SoftKeyboardType type)
 {
     if (show)
     {
         Shown?.Invoke();
     }
     else
     {
         Hidden?.Invoke();
     }
 }
コード例 #13
0
ファイル: Menu.cs プロジェクト: Baradoros/WGJ97StrangeGarden
    public void Show()
    {
        if (!isShowable)
        {
            return;
        }

        _uiControls.SetActive(true);
        isShowing = true;
        Shown.Invoke();
    }
コード例 #14
0
        /// <summary>
        /// Shows the modal using the specified <paramref name="title"/> and <paramref name="componentType"/>,
        /// passing the specified <paramref name="parameters"/> and setting a custom CSS style.
        /// </summary>
        /// <param name="title">Modal title.</param>
        /// <param name="componentType">Type of component to display.</param>
        /// <param name="parameters">Key/Value collection of parameters to pass to component being displayed.</param>
        /// <param name="options">Options to configure the modal.</param>
        public void Show(string title, Type componentType, ModalParameters parameters, ModalOptions options)
        {
            if (!typeof(ComponentBase).IsAssignableFrom(componentType))
            {
                throw new ArgumentException($"{componentType.FullName} must be a Blazor Component");
            }

            RenderFragment content = new RenderFragment(x => { x.OpenComponent(1, componentType); x.CloseComponent(); });

            Shown?.Invoke(title, content, parameters, options);
        }
コード例 #15
0
ファイル: SoftKeyboard.cs プロジェクト: klenin/Citrus
 public void Show(bool show)
 {
     if (show)
     {
         Shown?.Invoke();
     }
     else
     {
         Hidden?.Invoke();
     }
 }
コード例 #16
0
 int IVsWindowFrameNotify.OnShow(int fShow)
 {
     if (fShow == 0)
     {
         Hidden?.Invoke(_window, EventArgs.Empty);
     }
     else
     {
         Shown?.Invoke(_window, EventArgs.Empty);
     }
     return(VSConstants.S_OK);
 }
コード例 #17
0
        protected override void OnContentRendered(EventArgs e)
        {
            base.OnContentRendered(e);

            if (_shown)
            {
                return;
            }
            _shown = true;

            Shown?.Invoke(this, e);
        }
コード例 #18
0
        /// <summary>
        /// Ons the visiblity change.
        /// </summary>
        /// <param name="state">State.</param>
        public static void OnVisiblityChange(KeyboardVisibilityChange state)
        {
            switch (state)
            {
            case KeyboardVisibilityChange.Shown:
                Shown?.Invoke(null, EventArgs.Empty);
                break;

            case KeyboardVisibilityChange.Hidden:
                Hidden?.Invoke(null, EventArgs.Empty);
                break;
            }
        }
コード例 #19
0
ファイル: MirControl.cs プロジェクト: coolzoom/mir2-master
        protected void OnShown()
        {
            if (HasShown)
            {
                return;
            }

            if (Shown != null)
            {
                Shown.Invoke(this, EventArgs.Empty);
            }

            HasShown = true;
        }
コード例 #20
0
ファイル: PopupMenu.cs プロジェクト: jjg0519/OA
        public void Open(Point mousePos, int showDelayPeriod, object sender, MouseEventArgs e)
        {
            if (!MenuPopup.IsOpen)
            {
                if (!OpenMenuList.Contains(this))
                {
                    OpenMenuList.Add(this);
                }
                UIElement LayoutRoot = GetRootLayoutElement((FrameworkElement)sender);
                ClickedElements       = VisualTreeHelper.FindElementsInHostCoordinates(mousePos, LayoutRoot);
                RootGrid.Margin       = new Thickness(mousePos.X - 200 + OffsetX, mousePos.Y + OffsetY, 0, 0);
                ListBox.SelectedIndex = -1; // Reset selected item

                // Invoking the event via a dispatcher to make sure the visual tree for our listbox is created before the event handler is called
                if (Opening != null)
                {
                    ListBox.Dispatcher.BeginInvoke(() => Opening.Invoke(sender, e));
                }

                RootGrid.Width = 0;

                _timerOpen          = new DispatcherTimer();
                _timerOpen.Interval = TimeSpan.FromMilliseconds(showDelayPeriod);
                _timerOpen.Tick    += delegate
                {
                    _timerOpen.Stop();
                    // If menu has not already been closed by hovering on the outergrid
                    if (MenuPopup.IsOpen)
                    {
                        // Remove Width = 0 constraint set originally
                        RootGrid.Width = double.NaN;
                        if (Showing != null)
                        {
                            Showing.Invoke(sender, e);
                        }
                        Animate(RootGrid, "UIElement.Opacity", 0, 1, TimeSpan.FromMilliseconds(HoverShowDelay));
                        //Animate(ListBox, "(UIElement.Projection).(PlaneProjection.RotationY)", 90, 0, TimeSpan.FromMilliseconds(200));
                        if (Shown != null)
                        {
                            Shown.Invoke(sender, e);
                        }
                    }
                };
                _timerOpen.Start();

                MenuPopup.IsOpen = true;
            }
        }
コード例 #21
0
        public override async Task OnInitializing()
        {
            await base.OnInitializing();

            Height.BindTo(Root.Height);

            await Add(HeaderBar = new Stack(RepeatDirection.Horizontal).Id("HeaderBar"));

            Row = await Add(new Stack(RepeatDirection.Horizontal).Id("Row"));

            Row.Height.BindTo(Height, HeaderBar.Height, (x, y) => x - y);

            await AddPageContainer();

            Shown.Handle(OnShown);
        }
コード例 #22
0
        public void Show()
        {
            if (!IsOpen)
            {
                Window = new RenderWindow(new VideoMode(Size.X, Size.Y), Title, WindowStyle, WindowSettings);

                Init();

                if (!_isExternalWindow)
                {
                    _input.RegisterEvents(this);
                }

                OnShown();
                Shown?.Invoke(this);
            }
        }
コード例 #23
0
        public DevicePanel(View view)
        {
            View = view;

            Title       = new TextView().Font(color: Colors.White, size: 28).X(10).Y(10).Absolute();
            Description = new TextView().Font(color: Colors.White, size: 12).X(10).Y(42).Absolute();

            EnvironmentSimulator.Start();

            var actualHeight = Root.ActualHeight - 90;

            AccelerometerInfo = new TextView().Font(color: Colors.White, size: 15).X(10).Y(actualHeight - 60).Absolute();
            GyroscopeInfo     = new TextView().Font(color: Colors.White, size: 15).X(10).Y(actualHeight - 40).Absolute();
            CompassInfo       = new TextView().Font(color: Colors.White, size: 15).X(10).Y(actualHeight - 20).Absolute();

            Shown.Handle(OnShown);

            ShowValues();
        }
コード例 #24
0
        private void RemoveAllHandledEvents()
        {
            if (Shown != null)
            {
                foreach (var @delegate in Shown.GetInvocationList())
                {
                    var h = (EventHandler)@delegate;
                    Shown -= h;
                }
            }

            if (Closing != null)
            {
                foreach (var @delegate in Closing.GetInvocationList())
                {
                    var h = (CancelEventHandler)@delegate;
                    Closing -= h;
                }
            }

            if (Closed != null)
            {
                foreach (var @delegate in Closed.GetInvocationList())
                {
                    var h = (EventHandler)@delegate;
                    Closed -= h;
                }
            }

            var p = Parent as FrameworkElement;

            if (p != null)
            {
                p.DataContextChanged -= Parent_DataContextChanged;
            }
        }
コード例 #25
0
        static void Postfix(Form __instance)
        {
            var fields      = ReflectionHelper.NusGrabberForm.Type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
            var tabFields   = fields.Where(field => field.FieldType.Name == "ToolWindow").ToList();
            var closeMethod = tabFields[0].FieldType.GetMethod("Close");

            foreach (var field in tabFields)
            {
                var tab = (Control)field.GetValue(__instance);
                if (InjectorService.DisableTabs.Contains(tab.Name))
                {
                    closeMethod.Invoke(tab, Type.EmptyTypes);
                }
            }

            // Fixes window missing from taskbar when UseShellExecute = false
            __instance.Load += (sender, e) =>
            {
                __instance.ShowInTaskbar = false;
                __instance.ShowInTaskbar = true;
            };
            __instance.Shown       += (sender, e) => Shown?.Invoke(sender, e);
            __instance.FormClosing += (sender, e) => FormClosing?.Invoke(sender, e);
        }
コード例 #26
0
ファイル: Grid.cs プロジェクト: Geeksltd/Zebble.Grid
 public Grid() : base()
 {
     Shown.Handle(OnShown); EmptyTemplateChanged.Handle(OnEmptyTemplateChanged);
 }
コード例 #27
0
 /// <summary>
 ///
 /// </summary>
 protected virtual void OnShown()
 {
     Shown?.Invoke(this, new EventArgs());
 }
コード例 #28
0
ファイル: FrameProvider.cs プロジェクト: yunmiha/TizenFX
 private void OnShowNative(IntPtr handle, IntPtr userData)
 {
     Log.Debug(logTag, "OnShowNative()");
     Shown?.Invoke(this, EventArgs.Empty);
 }
コード例 #29
0
        public void Show()
        {
            IsShown = true;

            Shown?.Invoke();
        }
コード例 #30
0
 protected virtual void OnShown()
 {
     Shown?.Invoke();
 }