Exemplo n.º 1
0
        public void AddGlobalFunc(dynamic func, string name)
        {
            var s1 = Scopes.ToArray()[0];

            var func_l = new FuncLink();

            func_l.ManagedFunc = func;

            s1.RegisterFunc(func_l);
        }
Exemplo n.º 2
0
        public ArrayImpl ToArray()
        {
            ArrayImpl inArray = new ArrayImpl();

            IValue[] val = _stack.ToArray();
            foreach (var itm in val)
            {
                inArray.Add(itm);
            }
            return(inArray);
        }
Exemplo n.º 3
0
    private static void chkStack動作()
    {
        Gen::Stack <int> st = new System.Collections.Generic.Stack <int>();

        st.Push(0);
        st.Push(1);
        st.Push(2);
        st.Push(3);

        PrintStack(st);

        Gen::Stack <int> st2 = new System.Collections.Generic.Stack <int>(st.ToArray());

        PrintStack(st2);
    }
Exemplo n.º 4
0
        public static string BaseXEncode(long value, string templates)
        {
            ThrowHelper.ArgumentMustNotNegative((value < 0), nameof(value));
            ThrowHelper.ArgumentNull((templates == null), nameof(templates));
            ThrowHelper.ArgumentStringMustNotEmpty((templates.Length == 0), nameof(templates));

            long current = value;

            System.Collections.Generic.Stack <char> result = new System.Collections.Generic.Stack <char>();
            do
            {
                result.Push(templates[(int)(current % templates.Length)]);
                current /= templates.Length;
            }while (current != 0);
            return(new string(result.ToArray()));
        }