Пример #1
0
 private void Start()
 {
     widget = GetComponent <TreeWidget>();
     widget.onShow.AddListener(OnShow);
     lobby = Lobby.instance;
     lobby.onConnectionChange.AddListener(UpdateUI);
     loginPanel.onLogin = OnLogin;
     start_btn.onClick.AddListener(StartGame);
 }
Пример #2
0
 public void Home()
 {
     print("Home");
     if (root.GetHashCode() == currentWidget.GetHashCode())
     {
         return;
     }
     currentWidget.Hide();
     currentWidget = root;
     currentWidget.Show();
 }
Пример #3
0
    public void Back()
    {
        print("Back");
        if (root.GetHashCode() == currentWidget.GetHashCode())
        {
            return;
        }

        currentWidget.Hide();
        currentWidget = currentWidget.parent;
        currentWidget.Show();
    }
Пример #4
0
    public void Navigate(int i)
    {
        print($"Navigate {i}");
        if (currentWidget.childs.Count <= i)
        {
            print("theres no such a child");
            return;
        }

        currentWidget.Hide();
        currentWidget = currentWidget.childs[i];
        currentWidget.Show();
    }
 private string CallNewTree(string Configuration)
 {
     try
     {
         EndpointSettings set = Newtonsoft.Json.JsonConvert.DeserializeObject<EndpointSettings>(Configuration);
         GetTreeObject TreeObj = new GetTreeObject() { Configuration = set };
         TreeWidget tw = new TreeWidget(TreeObj, null);
         return tw.GetTreeforCache(TreeObj.Configuration.Locale);
     }
     catch (Exception)
     {
         return null;
     }
 }
Пример #6
0
    private void Start()
    {
        var widgets = GetComponentsInChildren <TreeWidget>();

        foreach (var w in widgets)
        {
            if (w.parent)
            {
                w.parent.AddChild(w);
            }
            w.Hide();
        }
        currentWidget = root;
        currentWidget.Show();
    }
Пример #7
0
 private string CallNewTree(string Configuration)
 {
     try
     {
         EndpointSettings set     = Newtonsoft.Json.JsonConvert.DeserializeObject <EndpointSettings>(Configuration);
         GetTreeObject    TreeObj = new GetTreeObject()
         {
             Configuration = set
         };
         TreeWidget tw = new TreeWidget(TreeObj, null);
         return(tw.GetTreeforCache(TreeObj.Configuration.Locale));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Пример #8
0
        public ActionResult GetTreeLocale()
        {
            try
            {
                SessionQuery query = SessionQueryManager.GetSessionQuery(Session);

                EndpointSettings set = query._endpointSettings;
                GetTreeObject TreeObj = new GetTreeObject() { Configuration = set };
                TreeWidget treeWidget = new TreeWidget(TreeObj, null);
                string ret = treeWidget.GetTreeforCache(System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName);

                return CS.ReturnForJQuery(ret);
            }
            catch (Exception ex)
            {
                return CS.ReturnForJQuery(ex.Message);
            }
        }
Пример #9
0
        public ActionResult GetTree()
        {
            try
            {
                // Get parameter
                GetTreeObject PostDataArrived = CS.GetPostData<GetTreeObject>(this.Request);
                PostDataArrived.Configuration.Locale = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;

                TreeWidget treeWidget = new TreeWidget(PostDataArrived, connectionStringSetting.ConnectionString);
                SessionImplObject ret = treeWidget.GetTree();

                // Clear session on change ws
                Session[SESSION_KEY] = null;

                /*NUOVO */
                var query = new SessionQuery { CurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture };
                if (SessionQueryManager.SessionQueryExistsAndIsValid(Session))
                {
                    query = SessionQueryManager.GetSessionQuery(Session);
                }
                else
                {
                    query = new SessionQuery { CurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture };
                    SessionQueryManager.SaveSessionQuery(Session, query);
                }
                query._endpointSettings = PostDataArrived.Configuration;

                // Clear sessionQueryManager
                ISdmxObjects obj = ret.SdmxObject;

                // Get categories - first without annotations
                IList<ICategorySchemeObject> categoriesWithAnnotation = new List<ICategorySchemeObject>();
                IList<ICategorySchemeObject> categoriesWithoutAnnotation = new List<ICategorySchemeObject>();

                foreach (var categoryScheme in obj.CategorySchemes)
                {
                    if (categoryScheme.Annotations.Count > 0 && categoryScheme.Annotations[0].FromAnnotation() == CustomAnnotationType.CategorySchemeNodeOrder)
                    {
                        categoriesWithAnnotation.Add(categoryScheme);
                    }
                    else
                    {
                        categoriesWithoutAnnotation.Add(categoryScheme);
                    }
                }

                IEnumerable<ICategorySchemeObject> categoriesWithAnnotationOrderedBy = categoriesWithAnnotation.OrderBy(category => Convert.ToInt64(category.Annotations[0].ValueFromAnnotation()));

                IEnumerable<ICategorySchemeObject> categories = categoriesWithoutAnnotation.Concat(categoriesWithAnnotationOrderedBy);

                //Get dataflows
                ISet<IDataflowObject> dataflows = obj.Dataflows;

                // Get categorisations - first without annotations
                IList<ICategorisationObject> categorisationsWithAnnotation = new List<ICategorisationObject>();
                IList<ICategorisationObject> categorisationsWithoutAnnotation = new List<ICategorisationObject>();

                foreach (var categorisation in obj.Categorisations)
                {
                    if (categorisation.Annotations.Count > 0 && categorisation.Annotations[0].FromAnnotation() == CustomAnnotationType.CategorySchemeNodeOrder)
                    {
                        categorisationsWithAnnotation.Add(categorisation);
                    }
                    else
                    {
                        categorisationsWithoutAnnotation.Add(categorisation);
                    }
                }

                IEnumerable<ICategorisationObject> categorisationsWithAnnotationOrderedBy = categorisationsWithAnnotation.OrderBy(categ => Convert.ToInt64(categ.Annotations[0].ValueFromAnnotation()));

                IEnumerable<ICategorisationObject> categorisations = categorisationsWithoutAnnotation.Concat(categorisationsWithAnnotationOrderedBy);

                query.InitializeDataflowMap(dataflows);

                // Get dsds
                ISet<IDataStructureObject> dataStructure = obj.DataStructures;
                query.ResetDsds();
                query.Dsds = dataStructure;

                query.SetDataflowTree(categories, dataflows, categorisations, dataStructure);

                /*FINE NUOVO*/

                /*old*/
                return CS.ReturnForJQuery(ret.SavedTree);
                //return CS.ReturnForJQuery(query._dataflowTreeList.GetJSTree());
            }
            catch (Exception ex)
            {
                return CS.ReturnForJQuery(ex.Message);
            }
        }
Пример #10
0
 public void AddChild(TreeWidget child)
 {
     childs.Add(child);
 }