Esempio n. 1
0
        /// <summary>
        /// 加载项目数据
        /// </summary>
        public static void LoadData()
        {
            List <Anoicess.Anoicess.Anoicess> Child = new List <Anoicess.Anoicess.Anoicess>();

            Child = mMAIN.GetAllChild();

            //获取项目尺寸
            double ItemSize = ApplicationInformations.Anything.AppInfoOperations.GetItemSize();

            //开始加载数据
            foreach (Anoicess.Anoicess.Anoicess ai in Child)
            {
                ItemData itemdata = new ItemData(ai);

                listOfInnerData.Add(itemdata);

                Item item = new Item(itemdata);

                item.Click += Item_Click;

                FindAndInsert(item);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="wnd_"></param>
        /// <param name="wp"></param>
        public static void InitializeData(MainWindow wnd_)
        {
            //保存主窗体相关信息
            WindowMain            = wnd_;
            WindowMainRect.left   = (int)wnd_.Left;
            WindowMainRect.right  = (int)(wnd_.Left + wnd_.ActualWidth);
            WindowMainRect.top    = (int)wnd_.Top;
            WindowMainRect.bottom = (int)(wnd_.Top + wnd_.ActualHeight);

            //创建进度窗体实例
            wndProgressBar wndpb = new wndProgressBar("Loading data", "Please wait...", mMAIN.GetAllChild().Count);

            //wnd_.Opacity = 0.000001;
            wnd_.WindowState = System.Windows.WindowState.Normal;

            int ChildCount = mMAIN.GetAllChild().Count;

            //获取项目尺寸
            double ItemSize = ApplicationInformations.Anything.AppInfoOperations.GetItemSize();

            //开始加载数据
            for (int i = 0; i < ChildCount; i++)
            {
                ItemData itemdata = new ItemData(mMAIN.GetAllChild()[i]);

                listOfInnerData.Add(itemdata);

                Item item = new Item(itemdata.ID, itemdata.Name, itemdata.Icon_imagesource, ItemSize, itemdata.TagName);

                item.Path = itemdata.Path;

                item.RefItemData = itemdata;

                item.Margin = new System.Windows.Thickness(5);

                item.Click += Item_Click;

                //wp.Children.Add(item);

                FindAndInsert(item);

                wndpb.Increase();

                //wnd_.Opacity = (double)((double)i / (double)ChildCount);
            }



            wnd_.Opacity = ApplicationInformations.Anything.AppInfoOperations.GetMaxOpacity();


            List <string> tmp = mKeywordRecent.ReadAllString();

            if (tmp != null)
            {
                listOfRecentKeyword = tmp;
            }

            LoadSE();

            TipPublic.Show();

            wndpb.Increase();
        }