Beispiel #1
0
        //Dictionary<string, Expl_User_Global_Set> _data;

        public void InitGlobal(string setName, EnumGlobalSetModuleType?moduleNameForUse = EnumGlobalSetModuleType.HierarchyTree,
                               EnumNameRequestModalType modalType = EnumNameRequestModalType.GlobalModal, FrameworkElement source = null)
        {
            _setName = setName;

            _moduleNameForUse = moduleNameForUse;
            _modalParent      = source;
            _modalType        = modalType;

            btnReload.Visibility = Visibility.Visible;

            //Окончательно переводим наборы в глобальную таблицу
            Dictionary <string, List <string> > d = null;

            if (Manager.Config.FreeSets != null && !string.IsNullOrEmpty(setName))
            {
                Manager.Config.FreeSets.TryGetValue(setName, out d);
                //if (!Manager.Config.FreeSets.TryGetValue(setName, out d) || d == null)
                //{
                //    d = new Dictionary<string, List<string>>();
                //    Manager.Config.FreeSets[setName] = d;
                //}
            }

            cbIsGlobalSet.Visibility = Visibility.Visible;
            Task.Factory.StartNew(() =>
            {
                try
                {
                    var globalSet = ARM_Service.EXPL_Get_GlobalSets(Manager.User.User_ID, _moduleNameForUse);
                    if (globalSet == null)
                    {
                        return;
                    }
                    Dispatcher.BeginInvoke((Action)(() => InitGlobal(d, globalSet)), DispatcherPriority.Background);
                }
                catch
                {
                    // ignored
                }
            });
        }