Exemplo n.º 1
0
        public int[] EnableDisableAssignments(
            string technologyPollingID,
            bool enable,
            int[] netObjectIDs = null)
        {
            if (string.IsNullOrEmpty(technologyPollingID))
            {
                throw new ArgumentNullException(nameof(technologyPollingID));
            }
            ITechnologyPolling technologyPolling = this.GetTechnologyPolling(technologyPollingID);

            int[] netObjectsInstanceIDs = (netObjectIDs == null ? technologyPolling.EnableDisableAssignment(enable) : technologyPolling.EnableDisableAssignment(enable, netObjectIDs)) ?? new int[0];
            TechnologyPollingFactory.log.DebugFormat("{0} TechnologyPolling:'{1}' of Technology:'{2}' on NetObjects:'{3}'", new object[4]
            {
                enable ? (object)"Enabled" : (object)"Disabled",
                (object)technologyPollingID,
                (object)technologyPolling.get_TechnologyID(),
                netObjectsInstanceIDs == null ? (object)"" : (object)string.Join <int>(",", (IEnumerable <int>)netObjectsInstanceIDs)
            });
            if (enable)
            {
                using (IEnumerator <ITechnologyPolling> enumerator = this.ItemsByTechnology(technologyPolling.get_TechnologyID()).GetEnumerator())
                {
                    while (((IEnumerator)enumerator).MoveNext())
                    {
                        ITechnologyPolling current = enumerator.Current;
                        if (!technologyPollingID.Equals(current.get_TechnologyPollingID(), StringComparison.Ordinal))
                        {
                            int[] numArray = current.EnableDisableAssignment(false, netObjectsInstanceIDs) ?? new int[0];
                            TechnologyPollingFactory.log.DebugFormat("{0} TechnologyPolling:'{1}' of Technology:'{2}' on NetObjects:'{3}'", new object[4]
                            {
                                (object)"Disabled",
                                (object)current.get_TechnologyPollingID(),
                                (object)current.get_TechnologyID(),
                                numArray == null ? (object)"" : (object)string.Join <int>(",", (IEnumerable <int>)numArray)
                            });
                        }
                    }
                }
            }
            if (BusinessLayerSettings.Instance.EnableTechnologyPollingAssignmentsChangesAuditing)
            {
                this.changesIndicator.ReportTechnologyPollingAssignmentIndication(technologyPolling, netObjectsInstanceIDs, enable);
            }
            return(netObjectsInstanceIDs);
        }
Exemplo n.º 2
0
        // Token: 0x0600041F RID: 1055 RVA: 0x0001BFFC File Offset: 0x0001A1FC
        public int[] EnableDisableAssignments(string technologyPollingID, bool enable, int[] netObjectIDs = null)
        {
            if (string.IsNullOrEmpty(technologyPollingID))
            {
                throw new ArgumentNullException("technologyPollingID");
            }
            ITechnologyPolling technologyPolling = this.GetTechnologyPolling(technologyPollingID);

            int[] array = (netObjectIDs == null) ? technologyPolling.EnableDisableAssignment(enable) : technologyPolling.EnableDisableAssignment(enable, netObjectIDs);
            array = (array ?? new int[0]);
            TechnologyPollingFactory.log.DebugFormat("{0} TechnologyPolling:'{1}' of Technology:'{2}' on NetObjects:'{3}'", new object[]
            {
                enable ? "Enabled" : "Disabled",
                technologyPollingID,
                technologyPolling.TechnologyID,
                (array == null) ? "" : string.Join <int>(",", array)
            });
            if (enable)
            {
                foreach (ITechnologyPolling technologyPolling2 in this.ItemsByTechnology(technologyPolling.TechnologyID))
                {
                    if (!technologyPollingID.Equals(technologyPolling2.TechnologyPollingID, StringComparison.Ordinal))
                    {
                        int[] array2 = technologyPolling2.EnableDisableAssignment(false, array);
                        array2 = (array2 ?? new int[0]);
                        TechnologyPollingFactory.log.DebugFormat("{0} TechnologyPolling:'{1}' of Technology:'{2}' on NetObjects:'{3}'", new object[]
                        {
                            "Disabled",
                            technologyPolling2.TechnologyPollingID,
                            technologyPolling2.TechnologyID,
                            (array2 == null) ? "" : string.Join <int>(",", array2)
                        });
                    }
                }
            }
            if (BusinessLayerSettings.Instance.EnableTechnologyPollingAssignmentsChangesAuditing)
            {
                this.changesIndicator.ReportTechnologyPollingAssignmentIndication(technologyPolling, array, enable);
            }
            return(array);
        }