private void Init()
        {
            if (IPageParent != null)
            {
                IPageParent.SetBusy(true, string.Empty);
            }
            mWorder         = new BackgroundWorker();
            mWorder.DoWork += (s, de) =>
            {
                LoadAvaliableObject();
            };
            mWorder.RunWorkerCompleted += (s, re) =>
            {
                mWorder.Dispose();

                this.ComboBoxOrg.SelectedIndex = 0;
                DisplayControl();

                if (IPageParent != null)
                {
                    IPageParent.SetBusy(false, string.Empty);
                }
            };
            mWorder.RunWorkerAsync();
        }
Пример #2
0
        private void Init()
        {
            try
            {
                TvManagers.ItemsSource = mRootItem.Children;

                mRootItem.Children.Clear();
                mListCtlObjects.Clear();
                mListCtledUserIDs.Clear();

                if (PageParent != null)
                {
                    PageParent.SetBusy(true, string.Empty);
                }
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += (s, de) =>
                {
                    LoadCtledUserIDs();
                    LoadCtlOrg(mRootItem, -1);
                };
                worker.RunWorkerCompleted += (s, re) =>
                {
                    worker.Dispose();

                    if (PageParent != null)
                    {
                        PageParent.SetBusy(false, string.Empty);
                    }
                    if (mRootItem.Children.Count > 0)
                    {
                        mRootItem.Children[0].IsExpanded = true;
                    }
                    mRootItem.IsChecked = false;
                    SetCheckState();
                };
                worker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }