コード例 #1
0
        private void AppendSystemEvent(InlineTrigger inlineTrigger)
        {
            lock (_lockObj)
            {
                var kindOfSystemEvent = inlineTrigger.KindOfSystemEvent;

                if (_nonIndexedSystemEventsInfo.ContainsKey(kindOfSystemEvent))
                {
                    var dict = _nonIndexedSystemEventsInfo[kindOfSystemEvent];

                    if (dict.ContainsKey(inlineTrigger.Holder))
                    {
                        var targetList = dict[inlineTrigger.Holder];

#if DEBUG
                        //Log($"dict[superName].Count = {dict[inlineTrigger.Holder].Count}");
                        //Log($"targetList = {targetList.WriteListToString()}");
#endif
                        var targetLongConditionalHashCode = inlineTrigger.GetLongConditionalHashCode();

#if DEBUG
                        //Log($"targetLongConditionalHashCode = {targetLongConditionalHashCode}");
#endif

                        var itemsWithTheSameLongConditionalHashCodeList = targetList.Where(p => p.GetLongConditionalHashCode() == targetLongConditionalHashCode).ToList();

                        foreach (var itemWithTheSameLongConditionalHashCode in itemsWithTheSameLongConditionalHashCodeList)
                        {
                            targetList.Remove(itemWithTheSameLongConditionalHashCode);
                        }

                        targetList.Add(inlineTrigger);
                    }
                    else
                    {
                        dict[inlineTrigger.Holder] = new List <InlineTrigger>()
                        {
                            inlineTrigger
                        };
                    }
                }
                else
                {
                    _nonIndexedSystemEventsInfo[kindOfSystemEvent] = new Dictionary <StrongIdentifierValue, List <InlineTrigger> >()
                    {
                        { inlineTrigger.Holder, new List <InlineTrigger>()
                          {
                              inlineTrigger
                          } }
                    };
                }
            }
        }
コード例 #2
0
        private void AppendLogicConditional(InlineTrigger inlineTrigger)
        {
            lock (_lockObj)
            {
                if (_nonIndexedLogicConditionalsInfo.ContainsKey(inlineTrigger.Holder))
                {
                    var targetList = _nonIndexedLogicConditionalsInfo[inlineTrigger.Holder];

#if DEBUG
                    //Log($"_nonIndexedLogicConditionalsInfo[superName].Count = {_nonIndexedLogicConditionalsInfo[inlineTrigger.Holder].Count}");
                    //Log($"targetList = {targetList.WriteListToString()}");
#endif
                    var targetLongConditionalHashCode = inlineTrigger.GetLongConditionalHashCode();

#if DEBUG
                    //Log($"targetLongConditionalHashCode = {targetLongConditionalHashCode}");
#endif

                    var itemsWithTheSameLongConditionalHashCodeList = targetList.Where(p => p.GetLongConditionalHashCode() == targetLongConditionalHashCode).ToList();

#if DEBUG
                    //Log($"itemsWithTheSameLongConditionalHashCodeList = {itemsWithTheSameLongConditionalHashCodeList.WriteListToString()}");
#endif

                    foreach (var itemWithTheSameLongConditionalHashCode in itemsWithTheSameLongConditionalHashCodeList)
                    {
                        targetList.Remove(itemWithTheSameLongConditionalHashCode);
                    }

                    targetList.Add(inlineTrigger);
                }
                else
                {
                    _nonIndexedLogicConditionalsInfo[inlineTrigger.Holder] = new List <InlineTrigger>()
                    {
                        inlineTrigger
                    };
                }
            }
        }