Ejemplo n.º 1
0
 private void _PostModCaching(GUIMod module)
 {
     module.UpdateIsCached();
     Main.Instance.HideWaitDialog(true);
     // User might have selected another row. Show current in tree.
     UpdateModContentsTree(SelectedModule.ToCkanModule(), true);
 }
        void AddRemoveFaseCommand_Executed(object prm)
        {
            FaseCyclusModuleViewModel fcmvm = prm as FaseCyclusModuleViewModel;

            SelectedFaseCyclus = fcmvm;
            if (fcmvm.CanBeAddedToModule && !fcmvm.IsInModule)
            {
                ModuleFaseCyclusModel mfcm = new ModuleFaseCyclusModel();
                mfcm.FaseCyclus = fcmvm.Define;
                ModuleFaseCyclusViewModel mfcvm = new ModuleFaseCyclusViewModel(mfcm);
                mfcvm.FaseCyclusNaam = fcmvm.Naam;
                SelectedModule.Fasen.Add(mfcvm);
                SelectedModule.Fasen.BubbleSort();
            }
            else if (fcmvm.IsInModule)
            {
                // Use custom method instead of Remove method:
                // it removes based on Define instead of reference
                SelectedModule.RemoveFase(fcmvm.Define);
                SelectedModule.Fasen.BubbleSort();
            }
            foreach (FaseCyclusModuleViewModel _fcmvm in Fasen)
            {
                _fcmvm.UpdateModuleInfo();
            }
        }
Ejemplo n.º 3
0
        void AddRemoveFaseCommand_Executed(object prm)
        {
            FaseCyclusModuleViewModel fcmvm = prm as FaseCyclusModuleViewModel;

            SelectedFaseCyclus = fcmvm;
            if (SelectedModule != null)
            {
                if (fcmvm.CanBeAdded && !fcmvm.IsIn)
                {
                    ModuleFaseCyclusModel mfcm = new ModuleFaseCyclusModel();
                    mfcm.FaseCyclus = fcmvm.Naam;
                    ModuleFaseCyclusViewModel mfcvm = new ModuleFaseCyclusViewModel(mfcm);
                    SelectedModule.Fasen.Add(mfcvm);
                    SelectedModule.Fasen.BubbleSort();
                }
                else if (fcmvm.IsIn)
                {
                    // Use custom method instead of Remove method:
                    // it removes based on Define instead of reference
                    SelectedModule.RemoveFase(fcmvm.Naam);
                    SelectedModule.Fasen.BubbleSort();
                }
            }
            else if (SelectedModuleFase != null)
            {
                if (fcmvm.CanBeAdded && !fcmvm.IsIn)
                {
                    ModuleFaseCyclusAlternatiefModel afcm = new ModuleFaseCyclusAlternatiefModel();
                    afcm.FaseCyclus = fcmvm.Naam;
                    SelectedModuleFase.Alternatieven.Add(new ModuleFaseCyclusAlternatiefViewModel(afcm));
                    SelectedModuleFase.Alternatieven.BubbleSort();
                }
                else if (fcmvm.IsIn)
                {
                    // Use custom method instead of Remove method:
                    // it removes based on Define instead of reference
                    var rafcm = SelectedModuleFase.Alternatieven.FirstOrDefault(x => x.FaseCyclus == fcmvm.Naam);
                    if (rafcm != null)
                    {
                        SelectedModuleFase.Alternatieven.Remove(rafcm);
                    }
                    SelectedModuleFase.Alternatieven.BubbleSort();
                }
            }
            foreach (FaseCyclusModuleViewModel _fcmvm in Fasen)
            {
                if (SelectedModuleFase != null ||
                    _Controller.ModuleMolen.Modules.Any(x => x.Fasen.Any(x2 => x2.FaseCyclus == _fcmvm.Naam)))
                {
                    _fcmvm.HasModule = true;
                }
                else
                {
                    _fcmvm.HasModule = false;
                }
                _fcmvm.UpdateModuleInfo();
            }
            MessengerInstance.Send(new ControllerDataChangedMessage());
        }
Ejemplo n.º 4
0
        private void _PostModCaching(CkanModule module)
        {
            Main.Instance.HideWaitDialog(true);

            SelectedModule?.UpdateIsCached();
            UpdateModContentsTree(module, true);
            Main.Instance.RecreateDialogs();
        }
Ejemplo n.º 5
0
        private List <DNNArticleInfo> GetDNNList()
        {
            var    ctl     = new DNNArticleController();
            string modules = "";

            modules = !MultiModules?SelectedModule.ToString(CultureInfo.InvariantCulture) : SelectedModules;

            int displaynumber = 64000;
            //if (!string.IsNullOrEmpty(Convert.ToString(_settings[MySettings.RssDisplayNumber])))
            //{
            //    displaynumber = int.Parse(Convert.ToString(_settings[MySettings.RssDisplayNumber]));
            //}
            FeaturedDisplayType featured = FeaturedType(_settings);

            var condition = new SearchCondition();

            condition.SearchKey = "";
            condition.portalid  = _selectedPortalID;
            condition.modules   = modules;
            if (!string.IsNullOrEmpty(SelectedCategory))
            {
                condition.categories.Add(SelectedCategory);
            }

            condition.activeType   = DisplayType.All;
            condition.ApprovedType = ApprovedDisplayType.All;
            condition.recent       = -1;
            condition.featuredType = featured;
            //condition.CreatedByUserID = uid;
            condition.BeginDate = Null.NullDate;
            condition.EndDate   = Null.NullDate;

            // Return ctl.GetTopArticlesBySQL(SelectedPortalID, modules, SelectedCategory, "publishdate desc", displaynumber, DisplayType.ActivedOnly, ApprovedDisplayType.ApprovedOnly, -1, featured, uid, Me.CheckPermission, -1, Null.NullDate, Null.NullDate)
            // return ctl.GetPageArticlesBySQL(condition, "publishdate desc", -1, uid, CheckPermission, 0, displaynumber);

            if (DataCache.GetCache("DNNARSS-" + SelectedModule + "_" + SelectedCategory) != null)
            {
                return((List <DNNArticleInfo>)DataCache.GetCache("DNNARSS-" + SelectedModule + "_" + SelectedCategory));
            }

            var lst = ctl.GetPageArticlesBySQL(condition, "publishdate desc", -1, -1, true, 0, displaynumber);

            //DataCache.SetCache("DNNARSS-" + SelectedModule + "_" + SelectedCategory, lst, TimeSpan.FromDays(1));
            return(lst);
        }
Ejemplo n.º 6
0
 private void ContentsOpenButton_Click(object sender, EventArgs e)
 {
     Utilities.ProcessStartURL(manager.Cache.GetCachedFilename(SelectedModule.ToModule()));
 }