public static bool ResetFileVariable(IValueContainerOwnerAccess access, ILogger logger)
        {
            object o = access.Container.GetValue();

            if (o != null && o is IResettable)
            {
                return((o as IResettable).Reset(null));
            }
            return(false);
        }
Exemple #2
0
 public FileVariable(
     IScriptFile file,
     AccessModifier access,
     int line,
     IFileElement parentElement,
     string @namespace,
     string name,
     IValueContainerOwnerAccess variableAccess, int id) :
     base(file, line, parentElement, @namespace, name, access, FileElementType.FileVariable)
 {
     m_variableAccess = variableAccess;
     m_id             = id;
 }
 public static void SetupObjectWithPropertyBlock(ILogger logger, IValueContainerOwnerAccess containerOwner)
 {
     if (containerOwner != null && (containerOwner.Tag as Dictionary <Type, Object>) != null)
     {
         var @object = containerOwner.Container.GetValue(logger) as ISettableFromPropertyBlock;
         if (@object != null)
         {
             var    dict = containerOwner.Tag as Dictionary <Type, Object>;
             object props;
             if (dict != null && dict.TryGetValue(typeof(PropertyBlock), out props) && props is PropertyBlock)
             {
                 @object.Setup(logger, props as PropertyBlock);
             }
         }
     }
 }