Пример #1
0
        // Returns the node itself cast to ContentList if it's a ContentList, or the
        // ContentList containing the node.
        public static ContentList GetContentListForNode(Node n)
        {
            ContentList result = n as ContentList;

            if (result == null && n != null)
            {
                result = n.LoadContentList() as ContentList;
            }

            return(result);
        }
Пример #2
0
 public SlotTable(Dictionary <string, List <string> > bindings)
 {
     _slotTable    = new Dictionary <DataType, List <int> >();
     _currentSlots = new Dictionary <DataType, int>();
     foreach (DataType dataType in Enum.GetValues(typeof(DataType)))
     {
         _slotTable.Add(dataType, new List <int>());
         _currentSlots.Add(dataType, -1);
     }
     foreach (string key in bindings.Keys)
     {
         foreach (string binding in bindings[key])
         {
             DataType dataType;
             int      ordinalNumber;
             ContentList.DecodeBinding(binding, out dataType, out ordinalNumber);
             _slotTable[dataType].Add(ordinalNumber);
         }
     }
 }