public void CmdPrepareData()
        {
            try
            {
                LocalData.MaxLevel    = LocalData.dynamicList.Max(x => x.Level);
                LocalData.MinLevel    = LocalData.dynamicList.Min(x => x.Level);
                LocalData.LevelsCount = LocalData.MaxLevel - LocalData.MinLevel + 1;

                int k = 0;

                foreach (TreeItem item in LocalData.dynamicList.OrderBy(x => x.SequenceNumber))
                {
                    k++;
                    item.SequenceNumber = (double)k;

                    item.Level             = item.Level - LocalData.MinLevel + 1;
                    item.IsLastItemInLevel = LocalTreeFunctions.CmdCheckIfItemIsLastInThisLevel(item.ID);
                    item.IsVisible         = true;
                    item.IsExpanded        = true;
                    item.HasChildren       = LocalData.dynamicList.Any(x => x.ParentID == item.ID);
                }



                //LocalData.dynamicList.Single(x => x.ID == 5).IsExpanded = false;
                //LocalData.dynamicList.Single(x => x.ID == 6).IsVisible = false;
                //LocalData.dynamicList.Single(x => x.ID == 7).IsVisible = false;
            }
            catch (Exception ex)
            {
                LocalTreeFunctions.PrintError(ex.Message, MethodBase.GetCurrentMethod());
                //LocalFunctions.DisplayMessage(ex.ToString(), MethodBase.GetCurrentMethod());
            }
        }
Ejemplo n.º 2
0
        public void CmdPrepareData()
        {
            try
            {
                LocalData.MaxLevel    = SourceList.Max(x => x.Level);
                LocalData.MinLevel    = SourceList.Min(x => x.Level);
                LocalData.LevelsCount = LocalData.MaxLevel - LocalData.MinLevel + 1;

                int k = 0;

                foreach (TreeItem item in SourceList.OrderBy(x => x.SequenceNumber))
                {
                    k++;
                    item.SequenceNumber = (double)k;

                    item.Level             = item.Level - LocalData.MinLevel + 1;
                    item.IsLastItemInLevel = LocalTreeFunctions.CmdCheckIfItemIsLastInThisLevel(SourceList, item.ID);
                    item.IsVisible         = true;
                    item.IsExpanded        = true;
                    item.HasChildren       = SourceList.Any(x => x.ParentID == item.ID);
                }
            }
            catch (Exception ex)
            {
                LocalTreeFunctions.PrintError(ex.Message, MethodBase.GetCurrentMethod());
            }
        }
Ejemplo n.º 3
0
        public void CmdLoadData()
        {
            try
            {
                SourceList = SourceList.OrderBy(x => x.SequenceNumber).ToList();

                CmdPrepareData();
            }
            catch (Exception ex)
            {
                LocalTreeFunctions.PrintError(ex.Message, MethodBase.GetCurrentMethod());
            }
        }
        public void CmdLoadData()
        {
            try
            {
                PublicDataTree.dynamicOriginalList = PublicDataTree.dynamicOriginalList.OrderBy(x => x.SequenceNumber).ToList();
                LocalData.dynamicList = new List <TreeItem>();
                //  LocalData.dynamicList = PublicData.dynamicOriginalList.OrderBy(x => x.SequenceNumber).ToList();

                foreach (TreeItem item in PublicDataTree.dynamicOriginalList.OrderBy(x => x.SequenceNumber).ToList())
                {
                    LocalData.dynamicList.Add(item);
                }


                CmdPrepareData();
            }
            catch (Exception ex)
            {
                LocalTreeFunctions.PrintError(ex.Message, MethodBase.GetCurrentMethod());
                //LocalFunctions.DisplayMessage(ex.ToString(), MethodBase.GetCurrentMethod());
            }
        }