public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     // SchedulerBinding.instance.addPostFrameCallback(_ => {
     //     this.widget.actionModel.startFetchGameDetail();
     //     this.widget.actionModel.fetchGameDetail();
     // });
 }
Esempio n. 2
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(UserInfoManager.isLogin());
     this._loginSubId = EventBus.subscribe(sName: EventBusConstant.login_success,
                                           _ => { StatusBarManager.statusBarStyle(true); });
     this._logoutSubId = EventBus.subscribe(sName: EventBusConstant.logout_success,
                                            _ => { StatusBarManager.statusBarStyle(false); });
 }
Esempio n. 3
0
        public void didPopNext()
        {
            if (this.widget.viewModel.teamId.isNotEmpty())
            {
                CTemporaryValue.currentPageModelId = this.widget.viewModel.teamId;
            }

            StatusBarManager.statusBarStyle(isLight: this._hideNavBar);
        }
Esempio n. 4
0
 public override void initState() {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._refreshController = new RefreshController();
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         this.widget.actionModel.startFetchGame();
         this.widget.actionModel.fetchGame(arg: firstPageNumber);
     });
 }
Esempio n. 5
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;
            var navBarBottomPosition = navBarHeight + CCommonUtils.getSafeAreaTopPadding(context: this.context);

            if (pixels >= navBarBottomPosition)
            {
                if (this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = false);
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = true);
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > imageBaseHeight - navBarHeight - 24)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => this._isHaveTitle = true);
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => this._isHaveTitle = false);
                }
            }

            if (pixels > imageBaseHeight - navBarHeight)
            {
                if (!this._isShowTop)
                {
                    this.setState(() => this._isShowTop = true);
                }
            }
            else
            {
                if (this._isShowTop)
                {
                    this.setState(() => this._isShowTop = false);
                }
            }

            return(true);
        }
Esempio n. 6
0
        bool _onNotification(BuildContext context, ScrollNotification notification)
        {
            var axisDirection = notification.metrics.axisDirection;

            if (axisDirection == AxisDirection.left || axisDirection == AxisDirection.right)
            {
                return(true);
            }

            var pixels     = notification.metrics.pixels;
            var topPadding = 44 + CCommonUtils.getSafeAreaTopPadding(context: context);

            if (this._playButtonPosition == 0.0f)
            {
                var width       = MediaQuery.of(context).size.width;
                var imageHeight = width / this._aspectRatio;
                this._playButtonPosition = imageHeight + gameBriefKey.currentContext.size.height - topPadding - 24 - 6;
                // topPadding 是顶部的高度, 24 是底部的 padding, 6 是按钮到左边图片到底部的距离
            }

            if (pixels >= 44 + topPadding)
            {
                if (this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = false; });
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = true; });
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > this._playButtonPosition)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
Esempio n. 7
0
 static void _handleMethodCall(string method, List <JSONNode> args)
 {
     if (context != null)
     {
         using (WindowProvider.of(context: context).getScope()) {
             switch (method)
             {
             case "OnReceiveQRCode": {
                 string qrCode = args[0];
                 if (qrCode.StartsWith("http://") || qrCode.StartsWith("https://"))
                 {
                     var uri = new Uri(uriString: qrCode);
                     if (uri.AbsoluteUri.StartsWith("https://connect"))
                     {
                         var token = HttpUtility.ParseQueryString(query: uri.Query).Get("token");
                         if (token.isNotEmpty())
                         {
                             var isLoggedIn = StoreProvider.store.getState().loginState.isLoggedIn;
                             if (isLoggedIn)
                             {
                                 LoginApi.LoginByQr(token: token, "check");
                                 StoreProvider.store.dispatcher.dispatch(new MainNavigatorPushToQRScanLoginAction {
                                         token = token
                                     });
                             }
                             else
                             {
                                 qrCodeToken = token;
                                 StoreProvider.store.dispatcher.dispatch(new MainNavigatorPushToAction {
                                         routeName = MainNavigatorRoutes.Login
                                     });
                             }
                         }
                         else
                         {
                             StoreProvider.store.dispatcher.dispatch(new MainNavigatorPushToWebViewAction {
                                     url = qrCode
                                 });
                         }
                     }
                     else
                     {
                         StoreProvider.store.dispatcher.dispatch(new MainNavigatorPushToWebViewAction {
                                 url = qrCode
                             });
                     }
                 }
                 StatusBarManager.hideStatusBar(false);
                 StatusBarManager.statusBarStyle(false);
                 removeListener();
             }
             break;
             }
         }
     }
 }
Esempio n. 8
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._favoriteOffset = 0;
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         this.widget.actionModel.startFetchMyFavorite();
         this.widget.actionModel.fetchMyFavorite(0);
     });
 }
 public void OnClickStyle()
 {
     style += 1;
     if (style > 3)
     {
         style = 0;
     }
     StatusBarManager.BarStyle(style);
     Debug.Log("Style changed: " + style);
 }
Esempio n. 10
0
 public void OnClickAnim()
 {
     anim += 1;
     if (anim > 2)
     {
         anim = 0;
     }
     StatusBarManager.BarAnim(anim);
     Debug.Log("Animation changed: " + anim);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="app"></param>
        private void ClearOverrides(UIApplication app)
        {
            var doc     = app.ActiveUIDocument.Document;
            var dims    = (List <DimensionWrapper>)Arg1;
            var cleared = new List <DimensionWrapper>();

            using (var trans = new Transaction(doc, "Remove Dimension Overrides"))
            {
                trans.Start();
                StatusBarManager.InitializeProgress("Removing Overrides...", dims.Count);

                foreach (var dw in dims)
                {
                    StatusBarManager.StepForward();
                    try
                    {
                        var dim = (Dimension)doc.GetElement(dw.DimensionId);
                        if (dim == null)
                        {
                            return;
                        }

                        if (dim.NumberOfSegments == 0)
                        {
                            dim.ValueOverride = string.Empty;
                            cleared.Add(dw);
                        }
                        else
                        {
                            foreach (DimensionSegment s in dim.Segments)
                            {
                                if (s.GetHashCode() != dw.Hash)
                                {
                                    continue;
                                }

                                s.ValueOverride = string.Empty;
                                cleared.Add(dw);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Log.AppendLog(LogMessageType.EXCEPTION, e.Message);
                    }
                }

                StatusBarManager.FinalizeProgress();
                trans.Commit();
            }

            Messenger.Default.Send(new OverridesCleared {
                Dimensions = cleared
            });
        }
Esempio n. 12
0
        static void _handleMethodCall(string method, List <JSONNode> args)
        {
            if (GlobalContext.context != null)
            {
                using (WindowProvider.of(context: GlobalContext.context).getScope()) {
                    switch (method)
                    {
                    case "OnReceiveQRCode": {
                        string qrCode = args[0];
                        if (qrCode.StartsWith("http://") || qrCode.StartsWith("https://"))
                        {
                            var uri = new Uri(uriString: qrCode);
                            if (uri.AbsoluteUri.StartsWith("https://connect"))
                            {
                                var token = HttpUtility.ParseQueryString(query: uri.Query).Get("token");
                                if (token.isNotEmpty())
                                {
                                    var isLoggedIn = StoreProvider.store.getState().loginState.isLoggedIn;
                                    if (isLoggedIn)
                                    {
                                        checkToken(token: token);
                                    }
                                    else
                                    {
                                        qrCodeToken = token;
                                        StoreProvider.store.dispatcher.dispatch(new MainNavigatorPushToAction {
                                                routeName = MainNavigatorRoutes.Login
                                            });
                                    }
                                }
                                else
                                {
                                    CustomDialogUtils.showToast("暂不支持该二维码类型", Icons.sentiment_dissatisfied);
                                }
                            }
                            else
                            {
                                CustomDialogUtils.showToast("暂不支持该二维码类型", Icons.sentiment_dissatisfied);
                            }
                        }
                        else if (!qrCode.Equals("pop"))
                        {
                            CustomDialogUtils.showToast("暂不支持该二维码类型", Icons.sentiment_dissatisfied);
                        }

                        StatusBarManager.hideStatusBar(false);
                        StatusBarManager.statusBarStyle(isLight: StoreProvider.store.getState().loginState
                                                        .isLoggedIn);
                        removeListener();
                    }
                    break;
                    }
                }
            }
        }
Esempio n. 13
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;

            if (pixels >= 44 + this._topPadding)
            {
                if (this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = false);
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = true);
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > headerHeight - 24 - (44 + this._topPadding))
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => this._isHaveTitle = true);
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => this._isHaveTitle = false);
                }
            }

            if (pixels > headerHeight - (44 + this._topPadding))
            {
                if (!this._isShowTop)
                {
                    this.setState(() => this._isShowTop = true);
                }
            }
            else
            {
                if (this._isShowTop)
                {
                    this.setState(() => this._isShowTop = false);
                }
            }

            return(true);
        }
Esempio n. 14
0
    public override void Refresh()
    {
        StatusBarManager.Show(true);
        StatusBarManager.BarStyle(3);
        ScoreText.text = SmileProject.Instance.GetSmilePoints().ToString();
        m_flower_ani.Play("FlowerAni");

        //SmileProject.Instance.FlowerGo.SetActive (true);
        //if (!SmileProject.Instance.FlowerGo.GetComponent<Animation> ().isPlaying)
        //SmileProject.Instance.FlowerGo.GetComponent<Animation> ().CrossFade ("FlowerDance");
    }
        /// <summary>
        ///
        /// </summary>
        /// <param name="app"></param>
        private void ReplaceAndDeleteDimensionTypes(UIApplication app)
        {
            var doc            = app.ActiveUIDocument.Document;
            var dims           = (List <DimensionTypeWrapper>)Arg1;
            var repalcementDim = (DimensionTypeWrapper)Arg2;
            var deleted        = new List <DimensionTypeWrapper>();

            using (var trans = new Transaction(doc, "Delete Dimension Types"))
            {
                trans.Start();

                var replace     = dims.ToDictionary(x => x.Id, x => x);
                var replacement = (DimensionType)doc.GetElement(repalcementDim.Id);
                var allDims     = new FilteredElementCollector(doc)
                                  .OfClass(typeof(Dimension))
                                  .WhereElementIsNotElementType()
                                  .Where(x => replace.ContainsKey(x.GetTypeId()))
                                  .Cast <Dimension>()
                                  .ToList();

                // (Konrad) We need to first replace all instances that use the Types
                // that will be deleted.
                StatusBarManager.InitializeProgress("Replacing Types...", allDims.Count);
                foreach (var d in allDims)
                {
                    StatusBarManager.StepForward();
                    d.DimensionType = replacement;
                }
                StatusBarManager.FinalizeProgress();

                // (Konrad) We can then safely delete the dimension type
                StatusBarManager.InitializeProgress("Deleting Types...", dims.Count);
                foreach (var dt in dims)
                {
                    try
                    {
                        doc.Delete(dt.Id);
                        deleted.Add(dt);
                    }
                    catch (Exception e)
                    {
                        Log.AppendLog(LogMessageType.EXCEPTION, e.Message);
                    }
                }
                StatusBarManager.FinalizeProgress();

                trans.Commit();
            }

            Messenger.Default.Send(new DimensionsDeleted {
                Dimensions = deleted
            });
        }
Esempio n. 16
0
 public void didPush()
 {
     StatusBarManager.hideStatusBar(true);
     Promise.Delayed(TimeSpan.FromMilliseconds(400)).Then(() => {
         var width   = MediaQuery.of(this.context).size.width;
         var height  = width * 9 / 16;
         var originY = (MediaQuery.of(this.context).size.height - height) / 2;
         AVPlayerPlugin.initVideoPlayer(this.widget.url, HttpManager.getCookie(), 0, originY, width, height,
                                        false,
                                        this.widget.needUpdate, this.widget.limitSeconds);
     });
 }
Esempio n. 17
0
        public override void initState()
        {
            base.initState();
            StatusBarManager.statusBarStyle(false);
            this._scrollController    = new ScrollController();
            this._contentFocusNodeKey = GlobalKey.key("_contentFocusNodeKey");
            this._nameFocusNodeKey    = GlobalKey.key("_nameFocusNodeKey");
            this._contactFocusNodeKey = GlobalKey.key("_contactFocusNodeKey");

            this._contentFocusNode.addListener(this._contentFocusNodeListener);
            this._nameFocusNode.addListener(this._nameFocusNodeListener);
            this._contactFocusNode.addListener(this._contactFocusNodeListener);
        }
        public void didPopNext()
        {
            if (this.widget.viewModel.eventId.isNotEmpty())
            {
                CTemporaryValue.currentPageModelId = this.widget.viewModel.eventId;
            }

            StatusBarManager.statusBarStyle(false);
            if (this._showPlayer)
            {
                AVPlayerPlugin.showPlayer();
            }
        }
Esempio n. 19
0
        private static void OnUpdateStatusBar(UpdateStatusBarMessage msg)
        {
            if (string.IsNullOrWhiteSpace(msg.Message))
            {
                return;
            }

            DispatcherHelper.CheckBeginInvokeOnUI(() =>
            {
                StatusBarManager.SetStatus(msg.Message);
                StatusBarManager.Logs.Add(msg.Message);
            });
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="dims"></param>
        /// <returns></returns>
        public List <DimensionWrapper> ClearOverrides(List <DimensionWrapper> dims)
        {
            var result = new List <DimensionWrapper>();

            using (var trans = new Transaction(_doc, "Clear Dimension Overrides"))
            {
                trans.Start();
                StatusBarManager.InitializeProgress("Removing Overrides...", dims.Count);

                foreach (var dw in dims)
                {
                    StatusBarManager.StepForward();
                    try
                    {
                        var dim = (Dimension)_doc.GetElement(dw.DimensionId);
                        if (dim == null)
                        {
                            return(null);
                        }

                        if (dim.NumberOfSegments == 0)
                        {
                            dim.ValueOverride = string.Empty;
                            result.Add(dw);
                        }
                        else
                        {
                            foreach (DimensionSegment s in dim.Segments)
                            {
                                if (s.GetHashCode() != dw.Hash)
                                {
                                    continue;
                                }

                                s.ValueOverride = string.Empty;
                                result.Add(dw);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Log.AppendLog(LogMessageType.EXCEPTION, e.Message);
                    }
                }

                StatusBarManager.FinalizeProgress();
                trans.Commit();
            }

            return(result);
        }
Esempio n. 21
0
    public override void Refresh()
    {
        // Enable white filter
        // SmileProject.Instance.LutifyComp.Blend = 1;

        for (int i = 0; i < UIObjects.Length; i++)
        {
            UIObjects[i].SetActive(true);
        }
        SwitchCamera(true);
        StatusBarManager.Show(false);
        m_loading             = false;
        loading_tiper.enabled = false;
    }
Esempio n. 22
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.hideStatusBar(false);
     SplashManager.fetchSplash();
     this._refreshController = new RefreshController();
     this.navBarHeight       = maxNavBarHeight;
     this.titleStyle         = CTextStyle.H2;
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         this.widget.actionModel.startFetchArticles();
         this.widget.actionModel.fetchArticles(initOffset);
         this.widget.actionModel.fetchReviewUrl();
     });
 }
Esempio n. 23
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._userOffset        = 0;
     this._refreshController = new RefreshController();
     this._title             = this.widget.viewModel.currentUserId == this.widget.viewModel.userId
         ? "我的粉丝"
         : "全部粉丝";
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         this.widget.actionModel.startFetchFollower();
         this.widget.actionModel.fetchFollower(0);
     });
 }
        bool _onNotification(BuildContext context, ScrollNotification notification)
        {
            var pixels     = notification.metrics.pixels;
            var topPadding = 44 + CCommonUtils.getSafeAreaTopPadding(context: context);

            if (this._titleHeight == 0.0f)
            {
                var width       = MediaQuery.of(context).size.width;
                var imageHeight = width / this._aspectRatio;
                this._titleHeight = imageHeight + eventTitleKey.currentContext.size.height - topPadding +
                                    16; // topPadding 是顶部的高度 16 是文字与图片的间隙
            }

            if (pixels >= 44 + topPadding)
            {
                if (this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = false; });
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = true; });
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > this._titleHeight)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
        public override void initState()
        {
            base.initState();
            StatusBarManager.statusBarStyle(false);
            this._refreshController = new RefreshController();
            this.navBarHeight       = maxNavBarHeight;
            this.titleStyle         = CTextStyle.H2;
            this._hasBeenLoadedData = false;
            SchedulerBinding.instance.addPostFrameCallback(_ => {
                this.widget.actionModel.startFetchNotifications();
                this.widget.actionModel.fetchNotifications(arg: firstPageNumber).Then(() => {
                    if (this._hasBeenLoadedData)
                    {
                        return;
                    }

                    this._hasBeenLoadedData = true;
                    this.setState(() => { });
                });
            });
            this._loginSubId = EventBus.subscribe(sName: EventBusConstant.login_success, args => {
                this.navBarHeight = maxNavBarHeight;
                this.titleStyle   = CTextStyle.H2;
                this.widget.actionModel.startFetchNotifications();
                this.widget.actionModel.fetchNotifications(arg: firstPageNumber).Then(() => {
                    if (this._hasBeenLoadedData)
                    {
                        return;
                    }

                    this._hasBeenLoadedData = true;
                    this.setState(() => { });
                });
            });
            this._refreshSubId = EventBus.subscribe(sName: EventBusConstant.refreshNotifications, args => {
                this.navBarHeight = maxNavBarHeight;
                this.titleStyle   = CTextStyle.H2;
                this.widget.actionModel.startFetchNotifications();
                this.widget.actionModel.fetchNotifications(arg: firstPageNumber).Then(() => {
                    if (this._hasBeenLoadedData)
                    {
                        return;
                    }

                    this._hasBeenLoadedData = true;
                    this.setState(() => { });
                });
            });
        }
Esempio n. 26
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._isEmailFocus    = true;
     this._isPasswordFocus = false;
     this._emailFocusNode.addListener(listener: this._focusNodeListener);
     this._passwordFocusNode.addListener(listener: this._focusNodeListener);
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         if (this.widget.viewModel.loginEmail.Length > 0 || this.widget.viewModel.loginPassword.Length > 0)
         {
             this.widget.actionModel.clearEmailAndPassword();
         }
     });
 }
Esempio n. 27
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._focusNode = new FocusNode();
     this._title     = this.widget.viewModel.currentUserId == this.widget.viewModel.userId
         ? "我关注的"
         : "全部关注";
     SchedulerBinding.instance.addPostFrameCallback(_ => {
         if (this.widget.viewModel.searchFollowingKeyword.Length > 0 ||
             this.widget.viewModel.searchFollowingUsers.Count > 0)
         {
             this.widget.actionModel.clearSearchFollowingResult();
         }
     });
 }
Esempio n. 28
0
    void Start()
    {
        currHealth = maxHealth;

        statusBar        = transform.FindChild("StatusBar");
        uioverlay        = transform.Find("UIoverlay");
        playerBody       = transform.Find("PlayerBody");
        halo             = playerBody.Find("HaloPoint");
        graphics         = playerBody.Find("Graphics");
        statusBarManager = statusBar.GetComponent <StatusBarManager>();
        itemDispMan      = uioverlay.Find("PersonalItemList").GetComponent <ItemDisplayManager>();

        if (!isLocalPlayer)
        {
            uioverlay.Find("ObservingMessage").Find("Text").GetComponent <Text>().text = "Observing player " + playerName + ". Press n to switch to next player.";
        }
        else
        {
            graphics.GetComponent <SpriteRenderer>().sortingOrder = 5;
            Destroy(uioverlay.Find("ObservingMessage").gameObject);
        }



        UnityEngine.Object.DontDestroyOnLoad(this.gameObject);


        deadColor = new Color();
        ColorUtility.TryParseHtmlString("#3A2424FF", out deadColor);
        blinkColor = new Color();
        ColorUtility.TryParseHtmlString("#FFFFFF58", out blinkColor);

        if (team != 0)
        {
            graphics.GetComponent <SpriteRenderer>().color = color;
        }
        else  //**if run scene without lobby
        {
            Color[] Colors = new Color[] { Color.red, Color.green, Color.blue, Color.cyan, Color.yellow, Color.white };

            tempPlayerTot++;
            color = Colors[tempPlayerTot - 1];
            graphics.GetComponent <SpriteRenderer>().color = color;
            playerName = "Player-" + tempPlayerTot;
            team       = tempPlayerTot;
        }
    }
        public void TestInitialize()
        {
            windowManager     = Substitute.For <WindowManagerEx>();
            endpointExplorer  = Substitute.For <EndpointExplorerViewModel>();
            messageList       = Substitute.For <MessageListViewModel>();
            licenseStatusBar  = Substitute.For <LicenseStatusBar>();
            statusbarManager  = new StatusBarManager(licenseStatusBar);
            eventAggregator   = Substitute.For <IEventAggregator>();
            workNotifier      = Substitute.For <IWorkNotifier>();
            messageFlow       = Substitute.For <MessageFlowViewModel>();
            sagaWindow        = Substitute.For <SagaWindowViewModel>();
            messageBodyView   = Substitute.For <MessageBodyViewModel>();
            messageProperties = Substitute.For <MessagePropertiesViewModel>();
            view                = Substitute.For <IShellViewStub>();
            headerView          = Substitute.For <MessageHeadersViewModel>();
            sequenceDiagramView = Substitute.For <SequenceDiagramViewModel>();
            settingsProvider    = Substitute.For <ISettingsProvider>();
            licenseManager      = Substitute.For <AppLicenseManager>();
            logWindow           = Substitute.For <LogWindowViewModel>();
            settingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            app = Substitute.For <IAppCommands>();
            commandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(
                app,
                windowManager,
                endpointExplorer,
                messageList,
                () => Substitute.For <ServiceControlConnectionViewModel>(),
                () => Substitute.For <LicenseMessageBoxViewModel>(),
                statusbarManager,
                eventAggregator,
                workNotifier,
                licenseManager,
                messageFlow,
                sagaWindow,
                messageBodyView,
                headerView,
                sequenceDiagramView,
                settingsProvider,
                messageProperties,
                logWindow,
                commandLineArgParser);

            ((IViewAware)shell).AttachView(view);
        }
        public void TestInitialize()
        {
            windowManager = Substitute.For<WindowManagerEx>();
            endpointExplorer = Substitute.For<EndpointExplorerViewModel>();
            messageList = Substitute.For<MessageListViewModel>();
            statusbarManager = Substitute.For<StatusBarManager>();
            eventAggregator = Substitute.For<IEventAggregator>();
            workNotifier = Substitute.For<IWorkNotifier>();
            messageFlow = Substitute.For<MessageFlowViewModel>();
            sagaWindow = Substitute.For<SagaWindowViewModel>();
            messageBodyView = Substitute.For<MessageBodyViewModel>();
            messageProperties = Substitute.For<MessagePropertiesViewModel>();
            view = Substitute.For<IShellViewStub>();
            headerView = Substitute.For<MessageHeadersViewModel>();
            sequenceDiagramView = Substitute.For<SequenceDiagramViewModel>();
            settingsProvider = Substitute.For<ISettingsProvider>();
            licenseManager = Substitute.For<AppLicenseManager>();
            logWindow = Substitute.For<LogWindowViewModel>();
            settingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            app = Substitute.For<IAppCommands>();
            commandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(
                        app,
                        windowManager,
                        endpointExplorer,
                        messageList,
                        () => Substitute.For<ServiceControlConnectionViewModel>(),
                        () => Substitute.For<LicenseRegistrationViewModel>(),
                        statusbarManager,
                        eventAggregator,
                        workNotifier,
                        licenseManager,
                        messageFlow,
                        sagaWindow,
                        messageBodyView,
                        headerView,
                        sequenceDiagramView,
                        settingsProvider,
                        messageProperties,
                        logWindow,
                        commandLineArgParser);

            ((IViewAware)shell).AttachView(view);
        }
Esempio n. 31
0
        public override void initState()
        {
            base.initState();
            StatusBarManager.statusBarStyle(false);
            this._focusNode     = new FocusNode();
            this._selectedIndex = 0;
            SchedulerBinding.instance.addPostFrameCallback(_ => {
                if (this.widget.viewModel.searchKeyword.Length > 0 ||
                    this.widget.viewModel.searchArticleIds.Count > 0 ||
                    this.widget.viewModel.searchUserIds.Count > 0 ||
                    this.widget.viewModel.searchTeamIds.Count > 0)
                {
                    this.widget.actionModel.clearSearchResult();
                }

                this.widget.actionModel.fetchPopularSearch();
            });
        }
        public void TestInitialize()
        {
            WindowManager = Substitute.For<WindowManagerEx>();
            EndpointExplorer = Substitute.For<EndpointExplorerViewModel>();
            MessageList = Substitute.For<MessageListViewModel>();
            StatusbarManager = Substitute.For<StatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<MessageFlowViewModel>();
            SagaWindow = Substitute.For<SagaWindowViewModel>();
            MessageBodyView = Substitute.For<MessageBodyViewModel>();
            MessageProperties = Substitute.For<MessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            HeaderView = Substitute.For<MessageHeadersViewModel>();
            SequenceDiagramView = Substitute.For<SequenceDiagramViewModel>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<AppLicenseManager>();
            LogWindow = Substitute.For<LogWindowViewModel>();
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            CommandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(
                        App,
                        WindowManager,
                        EndpointExplorer,
                        MessageList,
                        () => Substitute.For<ServiceControlConnectionViewModel>(),
                        () => Substitute.For<LicenseRegistrationViewModel>(),
                        StatusbarManager,
                        EventAggregator,
                        LicenseManager,
                        MessageFlow,
                        SagaWindow,
                        MessageBodyView,
                        HeaderView,
                        SequenceDiagramView,
                        SettingsProvider,
                        MessageProperties,
                        LogWindow,
                        CommandLineArgParser);

            ((IViewAware)shell).AttachView(View);
        }