protected AbstractObjectDefinition(SerializationInfo info, StreamingContext context)
        {
            constructorArgumentValues = (ConstructorArgumentValues)info.GetValue("constructorArgumentValues", typeof(ConstructorArgumentValues));
            propertyValues            = (MutablePropertyValues)info.GetValue("propertyValues", typeof(MutablePropertyValues));
            eventHandlerValues        = (EventValues)info.GetValue("eventHandlerValues", typeof(EventValues));
            methodOverrides           = (MethodOverrides)info.GetValue("methodOverrides", typeof(MethodOverrides));
            resourceDescription       = info.GetString("resourceDescription");
            isSingleton = info.GetBoolean("isSingleton");
            isPrototype = info.GetBoolean("isPrototype");
            isLazyInit  = info.GetBoolean("isLazyInit");
            isAbstract  = info.GetBoolean("isAbstract");
            scope       = info.GetString("scope");
            role        = (ObjectRole)info.GetValue("role", typeof(ObjectRole));

            var objectTypeName = info.GetString("objectTypeName");

            objectType = objectTypeName != null?Type.GetType(objectTypeName) : null;

            autowireMode      = (AutoWiringMode)info.GetValue("autowireMode", typeof(AutoWiringMode));
            dependencyCheck   = (DependencyCheckingMode)info.GetValue("dependencyCheck", typeof(DependencyCheckingMode));
            dependsOn         = (IList <string>)info.GetValue("dependsOn", typeof(IList <string>));
            autowireCandidate = info.GetBoolean("autowireCandidate");
            primary           = info.GetBoolean("primary");
            qualifiers        = (IDictionary <string, AutowireCandidateQualifier>)info.GetValue("qualifiers", typeof(IDictionary <string, AutowireCandidateQualifier>));
            initMethodName    = info.GetString("initMethodName");
            destroyMethodName = info.GetString("destroyMethodName");
            factoryMethodName = info.GetString("factoryMethodName");
            factoryObjectName = info.GetString("factoryObjectName");
        }
        public override void AfterSave()
        {
            base.AfterSave();

            if (string.IsNullOrEmpty(EntityFolderID))
            {
                throw new Exception("EntityFolderID not found");
            }

            Folder folder = new ORM <Folder>().Fetch(EntityFolderID);
            OPCServerFolderBehaviorData ext = folder?.GetExtensionData <OPCServerFolderBehaviorData>();

            if (ext != null)
            {
                if (Disabled)
                {
                    OPCEngine.RemoveEventGroup(ext.Url, ext.AgentId, Id);
                }
                else
                {
                    OpcEventGroup eventGroup = new OpcEventGroup
                    {
                        Paths      = EventValues?.Select(y => y.PathToValue).ToArray() ?? new string[0],
                        EventId    = Id,
                        Deadband   = Deadband,
                        UpdateRate = UpdateRate
                    };
                    OPCEngine.AddOrUpdateEventGroup(ext.Url, ext.AgentId, eventGroup);
                }
            }
        }
 /// <summary>
 /// Creates a new instance of the
 /// <see cref="Spring.Objects.Factory.Support.AbstractObjectDefinition"/>
 /// class.
 /// </summary>
 /// <remarks>
 /// <p>
 /// This is an <see langword="abstract"/> class, and as such exposes no
 /// public constructors.
 /// </p>
 /// </remarks>
 protected AbstractObjectDefinition(ConstructorArgumentValues arguments, MutablePropertyValues properties)
 {
     constructorArgumentValues =
         (arguments != null) ? arguments : new ConstructorArgumentValues();
     propertyValues =
         (properties != null) ? properties : new MutablePropertyValues();
     eventHandlerValues = new EventValues();
     DependsOn          = StringUtils.EmptyStrings;
 }
Esempio n. 4
0
        /// <summary>
        /// Creates a new instance of the
        /// <see cref="Spring.Objects.Factory.Support.AbstractObjectDefinition"/>
        /// class.
        /// </summary>
        /// <param name="other">
        /// The object definition used to initialise the member fields of this
        /// instance.
        /// </param>
        /// <remarks>
        /// <p>
        /// This is an <see langword="abstract"/> class, and as such exposes no
        /// public constructors.
        /// </p>
        /// </remarks>
        protected AbstractObjectDefinition(IObjectDefinition other)
        {
            AssertUtils.ArgumentNotNull(other, "other");
            OverrideFrom(other);

            AbstractObjectDefinition aod = other as AbstractObjectDefinition;

            if (aod != null)
            {
                if (aod.HasObjectType)
                {
                    ObjectType = other.ObjectType;
                }
                else
                {
                    ObjectTypeName = other.ObjectTypeName;
                }
                MethodOverrides = new MethodOverrides(aod.MethodOverrides);
                DependencyCheck = aod.DependencyCheck;
            }
            ParentName = other.ParentName;
            IsAbstract = other.IsAbstract;
//            IsSingleton = other.IsSingleton;
            Scope      = other.Scope;
            Role       = other.Role;
            IsLazyInit = other.IsLazyInit;
            ConstructorArgumentValues
                               = new ConstructorArgumentValues(other.ConstructorArgumentValues);
            PropertyValues     = new MutablePropertyValues(other.PropertyValues);
            EventHandlerValues = new EventValues(other.EventHandlerValues);

            InitMethodName      = other.InitMethodName;
            DestroyMethodName   = other.DestroyMethodName;
            IsAutowireCandidate = other.IsAutowireCandidate;
            IsPrimary           = other.IsPrimary;
            CopyQualifiersFrom(aod);
            if (other.DependsOn.Count > 0)
            {
                DependsOn = other.DependsOn;
            }
            FactoryMethodName   = other.FactoryMethodName;
            FactoryObjectName   = other.FactoryObjectName;
            AutowireMode        = other.AutowireMode;
            ResourceDescription = other.ResourceDescription;
        }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     currentEvenList = new List<string>();
     evenValuesInstance = this;
     alarmPlugin = AlarmPlugin.GetInstance();
     alarmPlugin.SetDebug(0);
     alarmPlugin.Init();
 }