Esempio n. 1
0
        /// <summary>IExplorerViewElement interface.</summary>
        public void SetExplorerView(ExplorerView view)
        {
            // early out
            if (this.m_explorerView == view)
            {
                return;
            }

            // unhook
            if (this.m_subsView != null)
            {
                this.m_subsView.onModPageChanged.RemoveListener(DisplayPageNumber);
            }
            if (this.m_explorerView != null)
            {
                this.m_explorerView.onModPageChanged.RemoveListener(DisplayPageNumber);
            }

            // assign
            this.m_subsView     = null;
            this.m_explorerView = view;

            // hook
            if (this.m_explorerView != null)
            {
                this.m_explorerView.onModPageChanged.AddListener(DisplayPageNumber);
                this.DisplayPageNumber(this.m_explorerView.modPage);
            }
            else
            {
                this.DisplayPageNumber(null);
            }
        }
Esempio n. 2
0
        // ---------[ INITIALIZATION ]---------
        /// <summary>Collects and sets view on ISubscriptionsViewElements.</summary>
        protected virtual void Start()
        {
            #if UNITY_EDITOR
            SubscriptionsView[] nested = this.gameObject.GetComponentsInChildren <SubscriptionsView>(true);
            if (nested.Length > 1)
            {
                SubscriptionsView nestedView = nested[1];
                if (nestedView == this)
                {
                    nestedView = nested[0];
                }

                Debug.LogError("[mod.io] Nesting SubscriptionsViews is currently not supported due to the"
                               + " way ISubscriptionsViewElement component parenting works."
                               + "\nThe nested SubscriptionsViews must be removed to allow SubscriptionsView functionality."
                               + "\nthis=" + this.gameObject.name
                               + "\nnested=" + nestedView.gameObject.name,
                               this);
                return;
            }
            #endif

            // assign view elements to this
            var viewElementChildren = this.gameObject.GetComponentsInChildren <ISubscriptionsViewElement>(true);
            foreach (ISubscriptionsViewElement viewElement in viewElementChildren)
            {
                viewElement.SetSubscriptionsView(this);
            }

            // get page
            this.DisplayProfiles(null);
            this.Refresh();
        }
        /// <summary>ISubscriptionsViewElement interface.</summary>
        public void SetSubscriptionsView(SubscriptionsView view)
        {
            // early out
            if (this.m_view == view)
            {
                return;
            }

            // assign
            this.m_view = view;

            this.SetSubscriptionsViewSortMethod();
        }
        private void FindViews()
        {
            if (this.m_viewsFound)
            {
                return;
            }

            this.m_explorerView      = GetComponentInChildren <ExplorerView>(true);
            this.m_subscriptionsView = GetComponentInChildren <SubscriptionsView>(true);
            this.m_inspectorView     = GetComponentInChildren <InspectorView>(true);
            this.m_loginDialog       = GetComponentInChildren <LoginDialog>(true);
            this.m_viewsFound        = true;
        }
Esempio n. 5
0
        private void FindViews()
        {
            if (this.m_viewsFound)
            {
                return;
            }

            this.m_explorerView      = GetComponentInChildren <ExplorerView>(true);
            this.m_subscriptionsView = GetComponentInChildren <SubscriptionsView>(true);
            this.m_inspectorView     = GetComponentInChildren <InspectorView>(true);
            this.m_loginDialog       = GetComponentInChildren <LoginDialog>(true);
            this.m_messageDialog     = GetComponentInChildren <MessageDialog>(true);
            this.m_reportDialog      = GetComponentInChildren <ReportDialog>(true);
            this.m_viewsFound        = true;

            this.m_views = this.gameObject.GetComponentsInChildren <IBrowserView>(true);
        }
        /// <summary>ISubscriptionsViewElement interface.</summary>
        public void SetSubscriptionsView(SubscriptionsView view)
        {
            // early out
            if (this.m_subscriptionsView == view)
            {
                return;
            }

            // unhook
            if (this.m_explorerView != null)
            {
                this.m_explorerView.onRequestFilterChanged.RemoveListener(UpdateInputField);

                this.GetComponent <InputField>().onEndEdit.RemoveListener(SetExplorerViewFilter);
            }
            if (this.m_subscriptionsView != null)
            {
                this.m_subscriptionsView.onNameFieldFilterChanged.RemoveListener(UpdateInputField);

                this.GetComponent <InputField>().onValueChanged.RemoveListener(SetSubscriptionsViewFilter);
            }

            // assign
            this.m_explorerView      = null;
            this.m_subscriptionsView = view;

            // hook
            if (this.m_subscriptionsView != null)
            {
                this.m_subscriptionsView.onNameFieldFilterChanged.AddListener(UpdateInputField);
                this.UpdateInputField(this.m_subscriptionsView.nameFieldFilter);

                this.GetComponent <InputField>().onValueChanged.AddListener(SetSubscriptionsViewFilter);
            }
            else
            {
                this.UpdateInputField(string.Empty);
            }
        }