Exemplo n.º 1
0
        public static Action Switch <T>(this ICellAccessor cell, T val, Dictionary <T, Action> cases)
        {
            Action action = ~(Action)0;

            cases.TryGetValue(val, out action);
            return(action);
        }
Exemplo n.º 2
0
        public static Action ForEach <T>(this ICellAccessor cell, IEnumerable <T> collection, System.Action <T> action)
        {
            foreach (var t in collection)
            {
                action(t);
            }

            return(~(Action)0);
        }
Exemplo n.º 3
0
        public static Action Do(this ICellAccessor cell, params System.Action[] actions)
        {
            foreach (var action in actions)
            {
                action();
            }

            return(~(Action)0);
        }
 private IEnumerable <string> _GetEdgeType(ICellAccessor cell, long to)
 {
     foreach (var field in cell.SelectFields <List <long> >("GraphEdge"))
     {
         if (field.Value.Contains(to))
         {
             yield return(field.Key);
         }
     }
 }
Exemplo n.º 5
0
        public static Action Switch <T>(this ICellAccessor cell, T val, Dictionary <T, Func <Action> > cases)
        {
            Func <Action> func = null;

            if (cases.TryGetValue(val, out func))
            {
                return(func());
            }
            else
            {
                return(~(Action)0);
            }
        }
Exemplo n.º 6
0
        private bool _check_attribute(ICellAccessor cell, string attributeKey, string attributeValue)
        {
            if (attributeKey == null)
            {
                return(true);
            }

            if (attributeValue == null)
            {
                return(cell.GetFieldDescriptors().Any(
                           fd =>
                           fd.Attributes.ContainsKey(attributeKey)));
            }
            else
            {
                return(cell.GetFieldDescriptors().Any(
                           fd =>
                {
                    string val;
                    return (fd.Attributes.TryGetValue(attributeKey, out val) && attributeValue == val);
                }));
            }
        }
            public void SaveCell(CellAccessOptions writeAheadLogOptions, long cellId, int index)
            {
                ICellAccessor c = Cache.Get(index);

                Global.LocalStorage.SaveGenericCell(writeAheadLogOptions, cellId, c);
            }
            public void SaveCell(long cellId, int index)
            {
                ICellAccessor c = Cache.Get(index);

                Global.LocalStorage.SaveGenericCell(cellId, c);
            }
            public int UseCell(long cellId, CellAccessOptions options, string cellType)
            {
                ICellAccessor c = Global.LocalStorage.UseGenericCell(cellId, options, cellType);

                return(Cache.Put(c));
            }
            public int UseCell(long cellId)
            {
                ICellAccessor c = Global.LocalStorage.UseGenericCell(cellId);

                return(Cache.Put(c));
            }
Exemplo n.º 11
0
        public static T Cast <T>(this ICellAccessor accessor) where T : ICellAccessor
        {
            var cell_group = accessor as IFanoutSearchCellAccessor;

            return(cell_group.Cast <T>());
        }
Exemplo n.º 12
0
 public static TOut Let <TIn, TOut>(this ICellAccessor cell, TIn t, Func <TIn, TOut> closure)
 {
     return(closure(t));
 }
Exemplo n.º 13
0
        public static int CA_Use_2(long cellId, CellAccessOptions options)
        {
            ICellAccessor c = Global.LocalStorage.UseGenericCell(cellId, options);

            return(Cache.Put(c));
        }