public static Action AuditTechnologiesChanges(
            IEnumerable <IDiscoveredObject> discoveredObjects,
            int nodeId)
        {
            if (!BusinessLayerSettings.Instance.EnableTechnologyPollingAssignmentsChangesAuditing)
            {
                return((Action)(() => {}));
            }
            Dictionary <string, ITechnology> technologies = TechnologyManager.Instance.TechnologyFactory.Items().ToDictionary <ITechnology, string, ITechnology>((Func <ITechnology, string>)(k => k.get_TechnologyID()), (Func <ITechnology, ITechnology>)(v => v), (IEqualityComparer <string>)StringComparer.Ordinal);
            Dictionary <string, string>      dictionary1  = TechnologyManager.Instance.TechnologyPollingFactory.Items().Where <ITechnologyPolling>((Func <ITechnologyPolling, bool>)(tp => technologies.ContainsKey(tp.get_TechnologyID()))).ToDictionary <ITechnologyPolling, string, string>((Func <ITechnologyPolling, string>)(k => k.get_TechnologyPollingID()), (Func <ITechnologyPolling, string>)(v => technologies[v.get_TechnologyID()].get_TargetEntity()), (IEqualityComparer <string>)StringComparer.Ordinal);
            IEnumerable <IDiscoveredObjectWithTechnology> objectWithTechnologies = ((IEnumerable)discoveredObjects).OfType <IDiscoveredObjectWithTechnology>();
            List <TechnologyPollingAssignment>            changedAssignments     = new List <TechnologyPollingAssignment>();

            using (IEnumerator <IDiscoveredObjectWithTechnology> enumerator = objectWithTechnologies.GetEnumerator())
            {
                while (((IEnumerator)enumerator).MoveNext())
                {
                    IDiscoveredObjectWithTechnology current = enumerator.Current;
                    if (dictionary1.ContainsKey(current.get_TechnologyPollingID()) && "Orion.Nodes".Equals(dictionary1[current.get_TechnologyPollingID()], StringComparison.Ordinal))
                    {
                        int num1 = nodeId;
                        TechnologyPollingAssignment pollingAssignment1 = TechnologyManager.Instance.TechnologyPollingFactory.GetAssignments(current.get_TechnologyPollingID(), new int[1]
                        {
                            num1
                        }).FirstOrDefault <TechnologyPollingAssignment>();
                        int  num2       = pollingAssignment1 == null ? 0 : (pollingAssignment1.get_Enabled() ? 1 : 0);
                        bool isSelected = ((IDiscoveredObject)current).get_IsSelected();
                        int  num3       = isSelected ? 1 : 0;
                        if (num2 != num3)
                        {
                            List <TechnologyPollingAssignment> pollingAssignmentList = changedAssignments;
                            TechnologyPollingAssignment        pollingAssignment2    = new TechnologyPollingAssignment();
                            pollingAssignment2.set_TechnologyPollingID(current.get_TechnologyPollingID());
                            pollingAssignment2.set_NetObjectID(num1);
                            pollingAssignment2.set_Enabled(isSelected);
                            pollingAssignmentList.Add(pollingAssignment2);
                        }
                    }
                }
            }
            return((Action)(() =>
            {
                if (changedAssignments.Count == 0)
                {
                    return;
                }
                Dictionary <string, ITechnologyPolling> dictionary2 = TechnologyManager.Instance.TechnologyPollingFactory.Items().ToDictionary <ITechnologyPolling, string, ITechnologyPolling>((Func <ITechnologyPolling, string>)(k => k.get_TechnologyPollingID()), (Func <ITechnologyPolling, ITechnologyPolling>)(v => v), (IEqualityComparer <string>)StringComparer.Ordinal);
                TechnologyPollingIndicator pollingIndicator = new TechnologyPollingIndicator();
                using (List <TechnologyPollingAssignment> .Enumerator enumerator = changedAssignments.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        TechnologyPollingAssignment current = enumerator.Current;
                        pollingIndicator.ReportTechnologyPollingAssignmentIndication(dictionary2[current.get_TechnologyPollingID()], new int[1]
                        {
                            current.get_NetObjectID()
                        }, (current.get_Enabled() ? 1 : 0) != 0);
                    }
                }
            }));
        }