Esempio n. 1
0
        /// <summary>
        /// Get an object who contains that variable
        /// </summary>
        /// <param name="variable">The variable</param>
        /// <returns>The datacontainer of the current object</returns>
        public static DataContainer GetObject(AbstractInfo variable)
        {
            string key = DataContainer.AllVariables.FirstOrDefault(k => k.Value == variable).Key;

            key = key.Substring(0, key.LastIndexOf("."));
            return(new DataContainer(key));
        }
Esempio n. 2
0
        /// <summary>
        /// Clones an info
        /// </summary>
        /// <param name="from">Copy from</param>
        /// <param name="to">Copy to</param>
        /// <returns>A new info</returns>
        public static AbstractInfo Clone(string from, string to)
        {
            AbstractInfo vFrom = AllVariables[from];

            if (vFrom == null)
            {
                return(null);
            }
            AllVariables[to] = (AbstractInfo)vFrom.Clone();
            return(AllVariables[to]);
        }