Esempio n. 1
0
        /// <summary>
        /// Sends back to the originator
        /// </summary>
        /// <param name="sourceMessage">Original Message to reply to</param>
        /// <param name="TargetMessage">New message to be sent to originator</param>
        /// <param name="IncludeLocalNode">if true the message will be sent to localhost</param>
        /// <returns></returns>
        public bool SendToOriginator(TSM sourceMessage, TSM TargetMessage, bool IncludeLocalNode)
        {
            if (sourceMessage == null || TargetMessage == null)
            {
                return(false);
            }
            TargetMessage.SID = sourceMessage.SID;
            Guid tOrg = sourceMessage.GetOriginator();

            if (tOrg == Guid.Empty)
            {
                return(false);
            }
            TargetMessage.GRO = sourceMessage.ORG;
            Guid tOriginatorThing = sourceMessage.GetOriginatorThing();

            if (tOriginatorThing != Guid.Empty)
            {
                TargetMessage.OWN = tOriginatorThing.ToString();
            }
            if (IncludeLocalNode)
            {
                TheBaseAssets.LocalHostQSender.SendQueued(TheBaseAssets.MyScopeManager.AddScopeID("CDE_SYSTEMWIDE;" + FNI, null, ref sourceMessage.SID, true, false), TargetMessage, false, TheBaseAssets.MyServiceHostInfo.MyDeviceInfo.DeviceID, "CDE_SYSTEMWIDE", RS, null); //GRSI: rare
            }
            return(MyQSender.SendQueued(TheBaseAssets.MyScopeManager.AddScopeID("CDE_SYSTEMWIDE;" + tOrg, null, ref sourceMessage.SID, true, false), TargetMessage, false, tOrg, "CDE_SYSTEMWIDE", RS, null));                                                                  //GRSI: rare
        }