Beispiel #1
0
        /// <summary>
        /// Looping in the list of effects whose value is enumerable
        /// </summary>
        /// <param name="name">Name of variable</param>
        public void ShowVariableProperties(string name)
        {
            var value = VariablesStorageQueries.GetVariableValue(name);
            var count = 0;

            foreach (var item in value as IEnumerable <object> )
            {
                CMD.ShowApplicationMessageToUser($"{count++} )\t{item}");
            }
        }
Beispiel #2
0
 /// <summary>
 /// paste records in records list
 /// </summary>
 /// <param name="name">name of variable</param>
 public void PasteRecords(string name)
 {
     try {
         var records = VariablesStorageQueries.GetVariableValue(name) as IEnumerable <object>;
         foreach (dynamic item in records)
         {
             RecordQueries.AddNewRecord(item.Name, item.Value);
         }
     } catch (Exception e) {
         CMD.ShowApplicationMessageToUser($"message : {e.Message}\nroute : {this.ToString()}", showType: ShowType.DANGER);
     }
 }
Beispiel #3
0
        /// <summary>
        /// paste config to request specified
        /// </summary>
        /// <param name="varName">The variable in which the configuration is stored</param>
        /// <param name="key">request key</param>
        protected void PasteConfig(string varName, string key = null)
        {
            try {
                var request = ProgramStorageQueries.GetRequest(key);

                var config = VariablesStorageQueries.GetVariableValue(varName) as IEnumerable <object>;

                foreach (dynamic item in config)
                {
                    var name  = item.Name as string;
                    var value = item.Value;
                    var prop  = request.GetType().GetProperty(name);
                    prop.SetValue(request, item.Value);
                }
            } catch (Exception e) {
                CMD.ShowApplicationMessageToUser($"message : {e.Message}\nroute : {this.ToString()}", showType: ShowType.DANGER);
            }
        }