コード例 #1
0
        public static ONActionCacheItem Get(string componentType, string className)
        {
            ONActionCacheItem lActionCacheItem = null;
            string lXml = "<Class>" + className + "</Class>";

            if (Cache.ContainsKey(lXml))
                lActionCacheItem = Cache[lXml];

            if (lActionCacheItem == null)
            {
                lActionCacheItem = new ONActionCacheItem(componentType, className);
                if (lActionCacheItem.Load())
                    Cache.Add(lXml, lActionCacheItem);
            }

            return lActionCacheItem;
        }
コード例 #2
0
        public static ONActionCacheItem Get(string componentType, string className)
        {
            ONActionCacheItem lActionCacheItem = null;
            string            lXml             = "<Class>" + className + "</Class>";

            if (Cache.ContainsKey(lXml))
            {
                lActionCacheItem = Cache[lXml];
            }

            if (lActionCacheItem == null)
            {
                lActionCacheItem = new ONActionCacheItem(componentType, className);
                if (lActionCacheItem.Load())
                {
                    Cache.Add(lXml, lActionCacheItem);
                }
            }

            return(lActionCacheItem);
        }
コード例 #3
0
        /// <summary>
        /// Controls the triggers of the model object
        /// </summary>
        public void CheckTriggers()
        {
            foreach (KeyValuePair <ONOid, ONAction> lDictionaryEntry in ModifiedClass)
            {
                ONAction lAction = lDictionaryEntry.Value;

                ONActionCacheItem lActionCacheItem = ONActionCacheItem.Get("Action", lAction.ClassName);
                lActionCacheItem.InvoqueTriggers(lAction, new object[] { lDictionaryEntry.Key });

                ONInstance lInstance = (lDictionaryEntry.Key as ONOid).GetInstance(lAction.OnContext);
                foreach (ONInstance lNetInstance in lInstance.GetFacets())
                {
                    if (((object)lNetInstance != null) && (lNetInstance.ClassName != lAction.Instance.ClassName))
                    {
                        // Create action class
                        ONAction lNetAction = ONContext.GetComponent_Action(lNetInstance.ClassName, lNetInstance.OnContext);
                        lNetAction.Instance = lNetInstance;
                        ONActionCacheItem lNetActionCacheItem = ONActionCacheItem.Get("Action", lNetInstance.ClassName);
                        lNetActionCacheItem.InvoqueTriggers(lNetAction, new object[] { lNetInstance.Oid });
                    }
                }
            }
        }