Help with AbstractInfo & AbstractInfoProvider

Jiří Vrabec asked on October 5, 2015 20:52

Hello,

I would like to ask yuo for some help with AbstractInfoProvider & AbstractInfo class. I'm currentlu new in Kentico and I got some project (from our contractor - they are really good in this) where this classes is usely to use. But I can't find any explanation what this is for. Please, can you send me some more help about this classes, what is it for, how to use it, dependecies in system....

Thank you. Jiri

Sample example what I don't understand what is it about and where i can't find standart help :

using CMS.Base; using CMS.DataEngine; using CMS.Helpers; using System; using System.Collections.Generic; using System.Linq; using System.Web;

namespace EBIZ.Integration.CRM { public class CRMContext : AbstractContext

Recent Answers


Martin Danko answered on October 7, 2015 14:03 (last edited on October 7, 2015 14:34)

Full code:

using CMS.Base; 
using CMS.DataEngine; 
using CMS.Helpers; 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web;

namespace EBIZ.Integration.CRM
{
    public class CRMContext : AbstractContext<CRMContext>
    {
        private CRMSystemType mCrmSystemType;

        public static CRMSystemType CRMSystemType
        {
            get
            {
                CRMContext current = ContextContainer<CRMContext>.Current;
                CRMSystemType crmSystemType = current.mCrmSystemType;
                if (crmSystemType == null)
                {
                    if (Enum.TryParse<CRMSystemType>(SettingsKeyInfoProvider.GetStringValue("EBIZMembershipCRMSystemType"), out crmSystemType))
                    {
                        current.mCrmSystemType = crmSystemType;
                    }
                    else
                    {
                        current.mCrmSystemType = CRM.CRMSystemType.NoCRM;
                    }
                }

                return crmSystemType;
            }
        }

        public static bool AllowKeyUserPromotion
        {
            get
            {
                return CRMSystemType == CRM.CRMSystemType.NoCRM;
            }
        }
    }
}
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.