상속: TersoSolutions.Jetstream.SDK.Application.Messages.JetstreamEvent
        /// <summary>
        /// Event handler for the NewWindow event.
        /// </summary>
        /// <param name="sender">Events Service</param>
        /// <param name="e">The NewWindow event args</param>
        private void JetstreamService_NewWindow(object sender, NewWindowEventArgs e)
        {
            // lock so we process all events in order
            lock (_newWindowLock)
            {
                foreach (TersoSolutions.Jetstream.SDK.Application.Messages.JetstreamEvent m in e.Messages)
                {
                    try
                    {
                        Debug.WriteLine("Jetstream Message: " + m.EventType);

                        // now we can deserialize the XML message into the appropriate message
                        switch (m.EventType.Trim().ToLower())
                        {
                        case "aggregateevent":
                        {
                            AE.Jetstream message = (AE.Jetstream)m;
                            ProcessAggregateEvent(message);
                            break;
                        }

                        case "commandcompletionevent":
                        {
                            CCE.Jetstream message = (CCE.Jetstream)m;
                            ProcessCommandCompletionEvent(message);
                            break;
                        }

                        case "commandqueuedevent":
                        {
                            CQE.Jetstream message = (CQE.Jetstream)m;
                            ProcessCommandQueuedEvent(message);
                            break;
                        }

                        case "devicefailureevent":
                        {
                            DFE.Jetstream message = (DFE.Jetstream)m;
                            ProcessDeviceFailureEvent(message);
                            break;
                        }

                        case "devicerestoreevent":
                        {
                            DRE.Jetstream message = (DRE.Jetstream)m;
                            ProcessDeviceRestoreEvent(message);
                            break;
                        }

                        case "heartbeatevent":
                        {
                            HE.Jetstream message = (HE.Jetstream)m;
                            ProcessHeartbeatEvent(message);
                            break;
                        }

                        case "logentryevent":
                        {
                            LEE.Jetstream message = (LEE.Jetstream)m;
                            ProcessLogEntryEvent(message);
                            break;
                        }

                        case "logicaldeviceaddedevent":
                        {
                            LDAE.Jetstream message = (LDAE.Jetstream)m;
                            ProcessLogicalDeviceAddedEvent(message);
                            break;
                        }

                        case "logicaldeviceremovedevent":
                        {
                            LDRE.Jetstream message = (LDRE.Jetstream)m;
                            ProcessLogicalDeviceRemovedEvent(message);
                            break;
                        }

                        case "objectevent":
                        {
                            OE.Jetstream message = (OE.Jetstream)m;
                            ProcessObjectEvent(message);
                            break;
                        }

                        case "sensorreadingevent":
                        {
                            SRE.Jetstream message = (SRE.Jetstream)m;
                            ProcessSensorReadingEvent(message);
                            break;
                        }

                        default:
                        {
                            ProcessUnknownMessage(m.ToString());
                            break;
                        }
                        }
                    }
                    catch (Exception ex)
                    {
                        EventLog.WriteEntry("JetstreamSDK",
                                            ex.Message + "\n" + ex.StackTrace);
                    }
                }
            }
        }
 /// <summary>
 /// Method for processing a new <paramref name="aggregateEvent"/>
 /// </summary>
 /// <param name="aggregateEvent">
 /// Deserialized AggregateEvent message in the xsd.exe object model.
 /// </param>
 protected virtual void ProcessAggregateEvent(AE.Jetstream aggregateEvent)
 {
 }
        public void AggregateEventTest()
        {
            try
            {
                AE.JetstreamHeader agHeader = new AE.JetstreamHeader();
                AE.Jetstream aggregateEvent = new AE.Jetstream();
                AE.JetstreamAggregateEvent evnt = new AE.JetstreamAggregateEvent();
                AE.JetstreamAggregateEventDeviceExtensionList agEvntDevList = new AE.JetstreamAggregateEventDeviceExtensionList();
                AE.JetstreamAggregateEventActionEPCLists agEvntActEpcList = new AE.JetstreamAggregateEventActionEPCLists();

                AE.JetstreamAggregateEventDeviceExtensionListDeviceExtension[] deExtn = new AE.JetstreamAggregateEventDeviceExtensionListDeviceExtension[1];
                deExtn[0] = new AE.JetstreamAggregateEventDeviceExtensionListDeviceExtension { Name = "WindName" + LogicalDeviceId, Value = "Value" + LogicalDeviceId };

                AE.JetstreamAggregateEventActionEPCListsActionEPCListEPC[] epclst = new AE.JetstreamAggregateEventActionEPCListsActionEPCListEPC[1];
                epclst[0] = new AE.JetstreamAggregateEventActionEPCListsActionEPCListEPC { Value = "Value" + LogicalDeviceId };

                // System.Xml.XmlAttribute[] AnyAttr =new Xml.XmlAttribute();
                AE.JetstreamAggregateEventActionEPCListsActionEPCListType typ;
                typ = AE.JetstreamAggregateEventActionEPCListsActionEPCListType.ADD;

                AE.JetstreamAggregateEventActionEPCListsActionEPCList[] epcActn = new AE.JetstreamAggregateEventActionEPCListsActionEPCList[1];
                epcActn[0] = new AE.JetstreamAggregateEventActionEPCListsActionEPCList { EPC = epclst, Type = typ };

                # region Window Service Code

                agHeader.LogicalDeviceId = LogicalDeviceId;
                agHeader.EventTime = DateTime.Now;
                aggregateEvent.Header = agHeader;
                aggregateEvent.AggregateEvent = evnt;
                aggregateEvent.AggregateEvent.DeviceExtensionList = agEvntDevList;
                aggregateEvent.AggregateEvent.ActionEPCLists = agEvntActEpcList;
                aggregateEvent.AggregateEvent.DeviceExtensionList.DeviceExtension = deExtn;
                aggregateEvent.AggregateEvent.ActionEPCLists.ActionEPCList = epcActn;

                string passRfid = "";
                string logicalDeviceId = aggregateEvent.Header.LogicalDeviceId;
                DateTime receiveDate = aggregateEvent.Header.EventTime;

                // collect and record the PassRfid value associated with this event
                if (aggregateEvent.AggregateEvent.DeviceExtensionList.DeviceExtension != null)
                {
                    foreach (var deviceExtension in aggregateEvent.AggregateEvent.DeviceExtensionList.DeviceExtension)
                    {
                        if (deviceExtension.Name == "PassRfid") passRfid = deviceExtension.Value;
                    }
                }

                // process each of the EPC actions
                if (aggregateEvent.AggregateEvent.ActionEPCLists.ActionEPCList != null)
                {
                    foreach (var epcList in aggregateEvent.AggregateEvent.ActionEPCLists.ActionEPCList)
                    {
                        if (epcList.Type == AE.JetstreamAggregateEventActionEPCListsActionEPCListType.ADD)
                        {
                            // collect and record each of the ADD operations
                            foreach (var epc in epcList.EPC)
                            {
                                //JetstreamEventRepository.RecordInventory(logicalDeviceId, epc.Value, "In", receiveDate, passRfid);
                            }
                        }
                        else
                        {
                            // collect and record each of the REMOVE operations
                            foreach (var epc in epcList.EPC)
                            {
                                //JetstreamEventRepository.RecordInventory(logicalDeviceId, epc.Value, "Out", receiveDate, passRfid);
                            }
                        }
                    }
                }

                #endregion
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }