示例#1
0
        private bool ClearTable(TriggerReader reader)
        {
            var var = reader.ReadVariableTable();

            var.Clear();
            return(true);
        }
示例#2
0
        private bool GetTableKeyIntoVar(TriggerReader reader)
        {
            var var  = reader.ReadVariableTable();
            var key  = reader.ReadString();
            var into = reader.ReadVariable(true);

            into.Value = var[key];
            return(true);
        }
示例#3
0
        private bool PutNumIntoTable(TriggerReader reader)
        {
            var var   = reader.ReadVariableTable(true);
            var value = reader.ReadNumber();
            var key   = reader.ReadString();

            var.Add(key, value);
            return(true);
        }
示例#4
0
        private bool GetAllLoadedLibrariesIntoTable(TriggerReader reader)
        {
            var table = reader.ReadVariableTable(true);

            foreach (var lib in reader.Page.Libraries)
            {
                table.Add(lib.GetType().Name);
            }
            return(true);
        }
示例#5
0
        private bool ForEntryInTable(TriggerReader reader)
        {
            var table = reader.ReadVariableTable();
            var var   = reader.ReadVariable(true);

            if (!table.Next(out object keyVal))
            {
                reader.Page.RemoveVariable(var);
                return(false);
            }
            var.Value = keyVal;
            return(true);
        }
示例#6
0
        private bool ForKeyValueInTable(TriggerReader reader)
        {
            var table = reader.ReadVariableTable();
            var key   = reader.ReadVariable(true);
            var val   = reader.ReadVariable(true);

            if (!table.Next(out object keyVal))
            {
                reader.Page.RemoveVariable(key);
                reader.Page.RemoveVariable(val);
                return(false);
            }
            key.Value = table.ActiveIndexer;
            val.Value = keyVal;
            return(true);
        }
示例#7
0
        private bool GetAllTimeZones(TriggerReader reader)
        {
            var table = reader.ReadVariableTable(true);

            try
            {
                foreach (var tz in TimeZoneInfo.GetSystemTimeZones())
                {
                    table.Add(tz.DisplayName, tz.Id);
                }
            }
            catch (Exception ex)
            {
                Logger.Debug <Timers>(ex);
                reader.Page.RemoveVariable(table);
                return(false);
            }
            return(true);
        }
示例#8
0
 private bool CreateTable(TriggerReader reader)
 {
     reader.ReadVariableTable(true);
     return(true);
 }