public void AddLocationData(WaveMessage msg) { if ((watcher != null) && (watcher.Status == GeoPositionStatus.Ready) && ((DateTimeOffset.UtcNow - watcher.Position.Timestamp) <= maximumDelay)) { msg.AddInt32(DefAgentFieldID.MapLatitude, (int)(watcher.Position.Location.Latitude * DegreesToMicrodegrees)); msg.AddInt32(DefAgentFieldID.MapLongitude, (int)(watcher.Position.Location.Longitude * DegreesToMicrodegrees)); } }
private void SendForm(FormAction trigger, ActionSet actionSet, Node sourceNode, BlockBase sourceBlock, long sourceViewID, bool expectResponse = false) { if (sourceNode != null) { WaveMessage msg = new WaveMessage(); Core.Navigation.Requests.Add(msg, sourceViewID, trigger.Transition, trigger.IsPopUp); if (Core.CSLVersion == WaveCSLVersion.Version5) { msg.AddInt16(NaviAgentFieldID.ActionTypeID, (short)trigger.ActionType); msg.AddBoolean(NaviAgentFieldID.FormRequiresNoWait, trigger.WaitForNode); } else { msg.AddByte(NaviAgentFieldID.ActionRef, (byte)trigger.FormID); } FieldList payload = FieldList.CreateField(NaviAgentFieldID.ActionPayload); payload.AddString(NaviAgentFieldID.FormRequestURL, trigger.FormURL); sourceNode.AttachFormData((short)trigger.FormID, payload); msg.AddFieldList(payload); Core.System.Location.AddLocationData(msg); if (sourceNode.CacheID != null) { msg.AddBinary(MessageOutFieldID.CacheItemID, sourceNode.CacheID.Value.ToByteArray()); } else { msg.AddString(MessageOutFieldID.ItemURI, sourceNode.URI); } if (Core.CSLVersion != WaveCSLVersion.Version5) { msg.AddInt32(NaviAgentFieldID.ActionSetID, actionSet.DefinitionID); } msg.Send(WaveServerComponent.NavigationAgent, NaviAgentMessageID.Action); if (expectResponse) { Core.UI.SignalViewNavigationStart(sourceViewID); } } }