コード例 #1
0
        /// <summary>
        /// Makes the element render and re-enables all of its functionality
        /// </summary>
        public virtual void Show()
        {
            Visible = true;
            _parent?.Append(this);

            OnShow?.Invoke(this);
        }
コード例 #2
0
        public void Show(string title, long userId)
        {
            List <UserTweet> _tweets = new List <UserTweet>();
            var user         = User.GetUserFromId(userId);
            var userTimeline = user.GetUserTimeline(new UserTimelineParameters
            {
                ExcludeReplies = true,
                IncludeRTS     = false,
                MaximumNumberOfTweetsToRetrieve = 10
            });

            foreach (var tweet in userTimeline)
            {
                if (!tweet.IsRetweet && tweet.InReplyToScreenName == null)
                {
                    var keys = _client.AnalyseKeyPhrases(tweet.Text);

                    _tweets.Add(new UserTweet
                    {
                        Text = string.Join(" - ", keys),
                        URL  = tweet.Url,
                        Date = tweet.CreatedAt
                    });
                }
            }
            OnShow?.Invoke(title, _tweets);
        }
コード例 #3
0
ファイル: Home.cs プロジェクト: fhart/GGJ2019
    private void SetupHome()
    {
        var score = hero.gold;

        if (completionValue == 0)
        {
            score -= 5000;
        }
        else
        {
            score += completionValue * 5;
        }

        var i = 0;

        foreach (var item in hero.items)
        {
            if (item != null)
            {
                heroItemsSlots[i].sprite = item.Sprite;
                score += item.Score;
                Debug.Log(score);
            }

            i++;
        }

        scoreText.text           = string.Format("Your score is {0}", score);
        insideBackground.texture = insideTexture;

        OnShow?.Invoke();
    }
 protected async Task CallOnShow(TModel model, string containerClass)
 {
     if (OnShow != null)
     {
         await OnShow.Invoke(model, containerClass);
     }
 }
コード例 #5
0
ファイル: ModalService.cs プロジェクト: mc738/Minx
 public void Show(string title, RenderFragment content)
 {
     // if (contentType.BaseType != typeof(ComponentBase))
     //    throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
     // var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.CloseComponent(); });
     OnShow?.Invoke(title, content);
 }
コード例 #6
0
ファイル: Banner.cs プロジェクト: hathu0610/Unity-Robot-Game
 /// <summary>
 /// Displays the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, and no callbacks.
 /// </summary>
 /// <param name="placementId">The unique identifier for a specific Placement, found on the <a href="https://operate.dashboard.unity3d.com/">developer dashboard</a>.</param>
 public void Show(string placementId)
 {
     loaded        = true;
     m_placementId = placementId;
     m_showing     = true;
     OnShow?.Invoke(this, new StartEventArgs(placementId));
 }
コード例 #7
0
    public override void ShowElement()
    {
        gameObject.SetActive(true);
        StopAllCoroutines();

        switch (componentsToAnimate_SHOW)
        {
        case (ComponentsToAnimate.Transform):
            StartCoroutine(AnimateTransform_SHOW());
            break;

        case (ComponentsToAnimate.Graphic):
            StartCoroutine(AnimateGraphic_SHOW());
            break;

        case (ComponentsToAnimate.Both):
            StartCoroutine(AnimateTransformAndGraphic_SHOW());
            break;
        }

        if (OnShow != null)
        {
            OnShow.Invoke();
        }
    }
コード例 #8
0
            public override void OnScrolled(RecyclerView recyclerView, int dx, int dy)
            {
                base.OnScrolled(recyclerView, dx, dy);

                var visibleItemCount  = recyclerView.ChildCount;
                var totalItemCount    = recyclerView.GetAdapter().ItemCount;
                var pastVisiblesItems = LayoutManager.FindFirstVisibleItemPosition();

                if ((visibleItemCount + pastVisiblesItems) >= totalItemCount && !IsLoading && dy > 0)
                {
                    LoadMoreEvent?.Invoke(this, null);
                }

                if (scrolledDistance > HIDE_THRESHOLD && controlsVisible)
                {
                    OnHide?.Invoke(this, null);
                    controlsVisible  = false;
                    scrolledDistance = 0;
                }

                else if (scrolledDistance < -HIDE_THRESHOLD && !controlsVisible)
                {
                    OnShow?.Invoke(this, null);
                    controlsVisible  = true;
                    scrolledDistance = 0;
                }

                if ((controlsVisible && dy > 0) || (!controlsVisible && dy < 0))
                {
                    scrolledDistance += dy;
                }
            }
コード例 #9
0
        //public Task Show<TModel>(Type contentType, TModel model)
        //{
        //    if (contentType.BaseType != typeof(ComponentBase))
        //    {
        //        throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
        //    }

        //    var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.AddAttribute(2, "Model", model); x.CloseComponent(); });

        //    return Show(content);
        //}

        public async Task Show(RenderFragment content, string containerClass)
        {
            if (OnShow != null)
            {
                await OnShow.Invoke(content, containerClass);
            }
        }
コード例 #10
0
        /// <summary>
        /// Shows toast by specified setting action.
        /// </summary>
        /// <param name="settingAction">The setting action.</param>
        public void Show(Action <ToastSetting> settingAction)
        {
            var setting = new ToastSetting();

            settingAction(setting);

            OnShow?.Invoke(setting);
        }
コード例 #11
0
 public void SetAsLoading()
 {
     // loading = true;
     // if (contentType.BaseType != typeof(ComponentBase))
     //    throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
     // var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.CloseComponent(); });
     OnShow?.Invoke();
 }
コード例 #12
0
 public async Task Show(string Titulo, object DataSouce, string[] ColumnasMostar, bool PermiteAgregar,
                        bool PermiteEditar, bool PermiteEliminar, bool HabilitaPaginacion, bool HabilitarBuscadorColumna,
                        bool HabilitarMenuColumna, EventCallback <object> EnviarSeleccionado)
 {
     await OnShow?.Invoke(Titulo, DataSouce, ColumnasMostar, PermiteAgregar,
                          PermiteEditar, PermiteEliminar, HabilitaPaginacion, HabilitarBuscadorColumna,
                          HabilitarMenuColumna, EnviarSeleccionado);
 }
コード例 #13
0
ファイル: MapManager.cs プロジェクト: Sonorh/AntNestProt
 public void Show()
 {
     foreach (var data in FieldData.Cells)
     {
         Field.GetCell(data.FieldPosition);
     }
     OnShow?.Invoke();
 }
コード例 #14
0
ファイル: CarpenterManager.cs プロジェクト: fhart/GGJ2019
    private void InitializeStore()
    {
        carpenterCanvas.gameObject.SetActive(true);
        dialogText.text  = string.Format(welcomeDialog, currentCarpenter.houseTiers[currentHomeTier].value);
        audioSource.clip = openDoor;
        audioSource.Play();

        OnShow?.Invoke();
    }
コード例 #15
0
        /// <summary>
        /// Shows the debug menu
        /// </summary>
        public void Show()
        {
            rootObject.SetActive(true);

            if (OnShow != null)
            {
                OnShow.Invoke();
            }
        }
コード例 #16
0
 public void Show()
 {
     foreach (var gobj in items)
     {
         gobj.SetActive(true);
     }
     _active = true;
     OnShow?.Invoke();
 }
コード例 #17
0
        internal async Task Show(int?overlayLeft = null, int?overlayTop = null)
        {
            if (_isOverlayShow || Trigger.Disabled)
            {
                return;
            }

            Element trigger = await JsInvokeAsync <Element>(JSInteropConstants.GetFirstChildDomInfo, Trigger.Ref);

            // fix bug in submenu: Overlay show when OvelayTrigger is not rendered complete.
            // I try to render Overlay when OvelayTrigger’s OnAfterRender is called, but is still get negative absoluteLeft
            // This may be a bad solution, but for now I can only do it this way.
            while (trigger.absoluteLeft <= 0 && trigger.clientWidth <= 0)
            {
                await Task.Delay(50);

                trigger = await JsInvokeAsync <Element>(JSInteropConstants.GetFirstChildDomInfo, Trigger.Ref);
            }

            _overlayLeft = overlayLeft;
            _overlayTop  = overlayTop;

            if (_isOverlayFirstRender)
            {
                _isWaitForOverlayFirstRender = true;

                StateHasChanged();
                return;
            }

            _isOverlayShow   = true;
            _isOverlayHiding = false;

            await UpdateParentOverlayState(true);

            await AddOverlayToBody();

            Element overlayElement = await JsInvokeAsync <Element>(JSInteropConstants.GetDomInfo, Ref);

            Element containerElement = await JsInvokeAsync <Element>(JSInteropConstants.GetDomInfo, Trigger.PopupContainerSelector);

            int left = GetOverlayLeft(trigger, overlayElement, containerElement);
            int top  = GetOverlayTop(trigger, overlayElement, containerElement);

            int zIndex = await JsInvokeAsync <int>(JSInteropConstants.GetMaxZIndex);

            _overlayStyle = $"z-index:{zIndex};left: {left}px;top: {top}px;{GetTransformOrigin()}";

            _overlayCls = Trigger.GetOverlayEnterClass();

            await Trigger.OnVisibleChange.InvokeAsync(true);

            StateHasChanged();

            OnShow?.Invoke();
        }
コード例 #18
0
 public void Show()
 {
     Shown = true;
     if (StateHasChanged == null)
     {
         throw new ArgumentNullException(nameof(StateHasChanged));
     }
     StateHasChanged.Invoke();
     OnShow?.Invoke();
 }
コード例 #19
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");
            }

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

            OnShow?.Invoke(title, content, parameters, options);
        }
コード例 #20
0
ファイル: ToastService.cs プロジェクト: kuic-sena/servidor
        protected void Show(string message, ToastType type)
        {
            var toast = new Toast
            {
                Id   = Guid.NewGuid(),
                Body = message,
                Type = type
            };

            OnShow?.Invoke(toast);
        }
コード例 #21
0
        /// <summary>
        /// Makes the element render and re-enables all of its functionality.
        /// </summary>
        public virtual void Show()
        {
            if (Visible)
            {
                return;
            }

            Visible = true;
            _parent?.Append(this);

            OnShow?.Invoke(this);
        }
コード例 #22
0
ファイル: StoreManager.cs プロジェクト: fhart/GGJ2019
    private void InitializeStore()
    {
        storeCanvas.gameObject.SetActive(true);
        dialogText.text   = welcomeDialog;
        selectedItemIndex = -1;

        SetHeroItems();
        audioSource.clip = openDoor;
        audioSource.Play();

        OnShow?.Invoke();
    }
コード例 #23
0
        ///// <summary>
        ///// Shows the modal with the component type using the specified <paramref name="title"/>,
        ///// passing the specified <paramref name="parameters"/>.
        ///// </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>
        //public void Show<T>(string title, ModalParameters parameters) where T : ComponentBase
        //{
        //    Show<T>(title, parameters);
        //}

        /// <summary>
        /// Shows the modal with the component type using the specified <paramref name="title"/>,
        /// passing the specified <paramref name="parameters"/> and setting a custom CSS style.
        /// </summary>
        /// <param name="title">Modal title.</param>
        /// <param name="parameters">Key/Value collection of parameters to pass to component being displayed.</param>
        public void Show <T>(string title, ModalParameters parameters) where T : ComponentBase
        {
            if (!typeof(ComponentBase).IsAssignableFrom(typeof(T)))
            {
                throw new ArgumentException($"{typeof(T).FullName} must be a Blazor Component");
            }

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

            _modalType = typeof(T);

            OnShow?.Invoke(title, content, parameters);
        }
コード例 #24
0
        public void Show(Type contentComponent, string title, ModalParameters parameters, ModalOptions options)
        {
            if (!typeof(ComponentBase).IsAssignableFrom(contentComponent))
            {
                throw new ArgumentException("Must be a Blazor Component");
            }

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

            this._modalType = contentComponent;

            OnShow?.Invoke(title, content, parameters, options);
        }
コード例 #25
0
        public void ShowModal <TComponent, TComponentModel>(string title, TComponentModel componentModel = null, string componentModelAttribute = null) where TComponent : ComponentBase where TComponentModel : class
        {
            var renderFragment = new RenderFragment(builder => {
                builder.OpenComponent <TComponent>(0);
                if (componentModel != null)
                {
                    builder.AddAttribute(1, componentModelAttribute, componentModel);
                }

                builder.CloseComponent();
            });

            OnShow?.Invoke(title, renderFragment);
        }
コード例 #26
0
        /// <summary>
        /// 开始验证更新
        /// </summary>
        public void Update()
        {
            //程序版本文件
            Dictionary <string, RemoteFile> listRemotFile = ParseRemoteXml(config.ServerUrl);
            //程序文件列表
            List <DownloadFileInfo> downloadList = new List <DownloadFileInfo>();

            //与本地文件MD5校验
            foreach (LocalFile file in config.UpdateFileList)
            {
                if (listRemotFile.ContainsKey(file.Path))
                {
                    RemoteFile rf = listRemotFile[file.Path];
                    string     v1 = rf.Verison;
                    string     v2 = file.Version;
                    if (v1 != v2)
                    {
                        downloadList.Add(new DownloadFileInfo(rf.Url, rf.Path, rf.LastVer, rf.Size, rf.Verison));
                        file.Path    = rf.Path;
                        file.LastVer = rf.LastVer;
                        file.Size    = rf.Size;
                        file.Version = rf.Verison;
                        bDownload    = true;
                    }

                    listRemotFile.Remove(file.Path);
                }
            }

            foreach (RemoteFile file in listRemotFile.Values)
            {
                downloadList.Add(new DownloadFileInfo(file.Url, file.Path, file.LastVer, file.Size, file.Verison));
                bDownload = true;
                config.UpdateFileList.Add(new LocalFile(file.Path, file.LastVer, file.Size, file.Verison));
            }
            downloadFileList = downloadList;

            //判断是否需要下载
            if (bDownload)
            {
                //关闭主程序进程
                OperProcess op = new OperProcess();
                op.InitUpdateEnvironment();

                OnShow?.Invoke();

                //调用窗体开始更新
                StartDownload(downloadList);
            }
        }
コード例 #27
0
        public void Show(string title, Type contentType)
        {
            if (contentType.BaseType != typeof(ComponentBase))
            {
                return;
            }

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

            OnShow?.Invoke(title, content);
        }
コード例 #28
0
ファイル: SimplePopup.cs プロジェクト: dhon2407/LSW-alpha
        private IEnumerator PopIn(UnityAction actionOnOpen = null)
        {
            yield return(null);

            _mainWindow.localScale = Vector3.zero;

            LeanTween.scale(_mainWindow, _initialScale, duration).setEase(LeanTweenType.linear);
            LeanTween.alphaCanvas(_canvasGroup, 1, duration);

            yield return(new WaitForSecondsRealtime(duration));

            _isVisible = true;
            actionOnOpen?.Invoke();
            OnShow.Invoke();
        }
コード例 #29
0
 private void CreateForm()
 {
     GenericForm        = InitializeFormBase();
     GenericForm.Shown += (o, e) => {
         Window = new Window(Handle);
         formAvailable.SetResult(this);
         Collection.Add(this);
         OnShow?.Invoke();
     };
     GenericForm.FormClosed += (o, e) => {
         formClosed.SetResult(this);
         Collection.Remove(this);
         OnClose?.Invoke();
     };
     Application.Run(GenericForm);
 }
コード例 #30
0
        public void Show(string title, Type contentType, object model = null)
        {
            if (contentType.BaseType != typeof(ComponentBase))
            {
                throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
            }

            var content = new RenderFragment(x =>
            {
                x.OpenComponent(1, contentType);
                x.AddAttribute(2, "Model", model);
                x.CloseComponent();
            });

            OnShow?.Invoke(title, content);
        }