Esempio n. 1
0
        /// <summary>
        /// Imports a property registered in GlobalPropertyHelper into the lookup.
        /// </summary>
        public void ImportProperty <T>(string name, Func <T> getter, Action <T> setter = null)
        {
            EnsureNotSaving();

            if (_definedProperties.ContainsKey(name))
            {
                Error(CompilerMessages.PropertyImported, name);
            }

            var ent = GlobalPropertyHelper.RegisterProperty(ContextId, getter, setter);

            _definedProperties.Add(name, ent);
        }
Esempio n. 2
0
        /// <summary>
        /// Imports a property registered in GlobalPropertyHelper into the lookup.
        /// </summary>
        public void ImportProperty <T>(string name, Func <T> getter, Action <T> setter = null)
        {
            if (Options.AllowSave)
            {
                Error(CompilerMessages.ImportIntoSaveableAssembly);
            }

            if (_DefinedProperties.ContainsKey(name))
            {
                Error(CompilerMessages.PropertyImported, name);
            }

            var ent = GlobalPropertyHelper.RegisterProperty(ContextId, getter, setter);

            _DefinedProperties.Add(name, ent);
        }