public void ReportTechnologyPollingAssignmentIndication( ITechnologyPolling technologyPolling, int[] netObjectsInstanceIDs, bool enabledStateChangedTo) { if (technologyPolling == null) { throw new ArgumentNullException(nameof(technologyPolling)); } if (netObjectsInstanceIDs == null) { throw new ArgumentNullException(nameof(netObjectsInstanceIDs)); } if (netObjectsInstanceIDs.Length == 0) { return; } ITechnology technology = TechnologyManager.Instance.TechnologyFactory.GetTechnology(technologyPolling.get_TechnologyID()); string netObjectPrefix = NetObjectTypesDAL.GetNetObjectPrefix(this.swisFactory, technology.get_TargetEntity()); string entityName = NetObjectTypesDAL.GetEntityName(this.swisFactory, technology.get_TargetEntity()); Dictionary <int, string> netObjectsCaptions = NetObjectTypesDAL.GetNetObjectsCaptions(this.swisFactory, technology.get_TargetEntity(), netObjectsInstanceIDs); foreach (int objectsInstanceId in netObjectsInstanceIDs) { PropertyBag propertyBag1 = new PropertyBag(); ((Dictionary <string, object>)propertyBag1).Add("InstanceType", (object)"Orion.TechnologyPollingAssignments"); ((Dictionary <string, object>)propertyBag1).Add("InstanceID", (object)objectsInstanceId.ToString()); ((Dictionary <string, object>)propertyBag1).Add("TechnologyPollingID", (object)technologyPolling.get_TechnologyPollingID()); ((Dictionary <string, object>)propertyBag1).Add("Enabled", (object)enabledStateChangedTo); ((Dictionary <string, object>)propertyBag1).Add("TargetEntity", (object)technology.get_TargetEntity()); ((Dictionary <string, object>)propertyBag1).Add("TechPollingDispName", (object)technologyPolling.get_DisplayName()); ((Dictionary <string, object>)propertyBag1).Add("TechnologyDispName", (object)technology.get_DisplayName()); PropertyBag propertyBag2 = propertyBag1; string str; if (netObjectsCaptions.TryGetValue(objectsInstanceId, out str)) { ((Dictionary <string, object>)propertyBag2).Add("NetObjectCaption", (object)str); } if (netObjectPrefix != null) { ((Dictionary <string, object>)propertyBag2).Add("NetObjectPrefix", (object)netObjectPrefix); ((Dictionary <string, object>)propertyBag2).Add((string)KnownKeys.NetObject, (object)string.Format("{0}:{1}", (object)netObjectPrefix, (object)objectsInstanceId)); } if (entityName != null) { ((Dictionary <string, object>)propertyBag2).Add("NetObjectName", (object)entityName); } this.publishManager.Publish(PublishHelper.ConvertIndication((IIndication) new TechnologyPollingAssignmentIndication((IndicationType)2, propertyBag2))); } }
// Token: 0x06000427 RID: 1063 RVA: 0x0001C408 File Offset: 0x0001A608 public void ReportTechnologyPollingAssignmentIndication(ITechnologyPolling technologyPolling, int[] netObjectsInstanceIDs, bool enabledStateChangedTo) { if (technologyPolling == null) { throw new ArgumentNullException("technologyPolling"); } if (netObjectsInstanceIDs == null) { throw new ArgumentNullException("netObjectsInstanceIDs"); } if (netObjectsInstanceIDs.Length == 0) { return; } ITechnology technology = TechnologyManager.Instance.TechnologyFactory.GetTechnology(technologyPolling.TechnologyID); string netObjectPrefix = NetObjectTypesDAL.GetNetObjectPrefix(this.swisFactory, technology.TargetEntity); string entityName = NetObjectTypesDAL.GetEntityName(this.swisFactory, technology.TargetEntity); Dictionary <int, string> netObjectsCaptions = NetObjectTypesDAL.GetNetObjectsCaptions(this.swisFactory, technology.TargetEntity, netObjectsInstanceIDs); foreach (int num in netObjectsInstanceIDs) { PropertyBag propertyBag = new PropertyBag(); propertyBag.Add("InstanceType", "Orion.TechnologyPollingAssignments"); propertyBag.Add("InstanceID", num.ToString()); propertyBag.Add("TechnologyPollingID", technologyPolling.TechnologyPollingID); propertyBag.Add("Enabled", enabledStateChangedTo); propertyBag.Add("TargetEntity", technology.TargetEntity); propertyBag.Add("TechPollingDispName", technologyPolling.DisplayName); propertyBag.Add("TechnologyDispName", technology.DisplayName); PropertyBag propertyBag2 = propertyBag; string value; if (netObjectsCaptions.TryGetValue(num, out value)) { propertyBag2.Add("NetObjectCaption", value); } if (netObjectPrefix != null) { propertyBag2.Add("NetObjectPrefix", netObjectPrefix); propertyBag2.Add(KnownKeys.NetObject, string.Format("{0}:{1}", netObjectPrefix, num)); } if (entityName != null) { propertyBag2.Add("NetObjectName", entityName); } this.indicationReporter.ReportIndication(new TechnologyPollingAssignmentIndication(2, propertyBag2)); } }
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); }
// 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); }