coll = new List();
coll.Add("First line on flow document");
coll.Add("Second line on flow document");
coll.Add("Third line on flow document");
// Create a FlowDocument using string collection
var flowDoc = UIHelper.Instance.CreateFlowDocumentWithContent(teControl, coll, "Back Link", true, true);
// Set the current terminal content with the flow document content
UIHelper.Instance.SetTerminalContent(UIHelper.Instance.CurrentTEControl, flowDoc, false);
]]>
{
CoreHelper.Instance.SendHostCommand(textBox.Text, UIHelper.Instance.CurrentTEControl, true);
};
stackPanel.Children.Add(textBlock);
stackPanel.Children.Add(textBox);
stackPanel.Children.Add(button);
// Set stackpanel as content of dialog window
dialogWindow.Content = stackPanel;
// Show Dialog window
dialogWindow.Show();
]]>
UIHelper.Instance.AddMessageInTerminal("Message on click of context menu", UIHelper.Instance.CurrentTEControl, true);
// Add UIElement as a child of the InlineUIContainer
inlineUIContainer.Child = button;
//Add new inlineUIContainer to the current cursor position on TEControl
UIHelper.Instance.AddTerminalUIContent(UIHelper.Instance.CurrentTEControl, inlineUIContainer);
]]>
UIHelper.Instance.AddMessageInTerminal
("Message on click of context menu", teControl, true)));
// Create a SmartMenuItem
var item = new SmartMenuItem
{
Name = "MyTitle",
Header = "My Menu Item",
Keyword = "title",
Command = contextMenuCommand
};
// Call UIHelper method for adding the SmartMenuItem to the ContextMenu of TEControl
UIHelper.Instance.AddItemToTerminalContextMenu(teControl, item);
]]>
UIHelper.Instance.ShowMessageBox("Message from Custom Toolbar"));
// Set the default content
button.ButtonContentDefault = "CUR";
// Set the default content
button.ButtonContentSelected = button.ButtonContentDefault;
//Set the Hover button content
button.ButtonContentHover = new TextBlock(new Bold(new Run("CUR")));
// Set the tooltip
button.ToolTip = "Show a message box";
button.Content = "CUR";
UIHelper.Instance.CurrentSmartTerminalWindow.CustomToolbar.Add(button);
]]>
{
CoreHelper.Instance.SendHostCommand(textBox.Text, UIHelper.Instance.CurrentTEControl, true);
};
stackPanel.Children.Add(textBlock);
stackPanel.Children.Add(textBox);
stackPanel.Children.Add(button1);
Grid.SetRow(stackPanel, 1);
Grid.SetColumn(stackPanel, 1);
grid.Children.Add(stackPanel);
button.View = grid;
UIHelper.Instance.CurrentSmartTerminalWindow.CommandToolbar.Add(button);
]]>
{ infoMessage, errorMessage, warningMessage };
// Display messages in the AlertBox in PNRViewer Control
SmartAlertsHelper.Instance.PushMessage(messagesCollection, true, true);
]]>
{
UIHelper.Instance.ShowMessageBox
(string.Format("Changing from WorkArea: {0}", UIHelper.Instance.CurrentTEControl.Connection.HostUserSettings.CurrentWorkArea)
);
};
// Hookup a handler to OnWorkareaChanged event.
CoreHelper.Instance.OnWorkareaChanged += (s, e) => {
UIHelper.Instance.ShowMessageBox
(string.Format("Changed to WorkArea: {0}", UIHelper.Instance.CurrentTEControl.Connection.HostUserSettings.CurrentWorkArea)
);
};
// Change to WorkArea B
CoreHelper.Instance.SendHostCommand("SB", UIHelper.Instance.CurrentTEControl, true, false);
]]>
{
// Get the current booking file if available.
BookingFile bookingFile =
PnrHelper.Instance.RetrieveCurrentBookingFile(
UIHelper.Instance.CurrentTEControl.Connection);
// Check if booking file exists or not.
if (string.IsNullOrEmpty(bookingFile.RecordLocator))
{
UIHelper.Instance.ShowMessageBox("No booking file available");
}
else
{
// Get the CommunicationFactory associated with the Current Terminal
var factory =
UIHelper.Instance.CurrentTEControl.Connection.CommunicationFactory as
GalileoDesktopFactory;
// For adding Remark to the Booking File create an instance of BookingFileRemark class
BookingFileRemark bookingFileRemark =
new BookingFileRemark(string.Format("RMK1-{0}:RMK2-{1}", textBox1.Text,
textBox2.Text));
bookingFileRemark.RemarkType = RemarkType.General;
// Calling GeneralRemarkAdd method for adding General Remark
factory.GeneralRemarkAdd(bookingFileRemark);
// Refresh the booking file.
PnrHelper.Instance.RefreshCurrentBookingFile();
}
};
Ellipse ellipse1 = new Ellipse { Width = 20, Height = 20, StrokeThickness = 2, Stroke = new SolidColorBrush(Colors.Black), Fill = new SolidColorBrush(Colors.Gray), };
Ellipse ellipse2 = new Ellipse { Width = 20, Height = 20, StrokeThickness = 2, Stroke = new SolidColorBrush(Colors.Black), Fill = new SolidColorBrush(Colors.DarkGray), };
Ellipse ellipse3 = new Ellipse { Width = 20, Height = 20, StrokeThickness = 2, Stroke = new SolidColorBrush(Colors.Black), Fill = new SolidColorBrush(Colors.LightGray), };
// Create an instance of SmartPnrCustomToolbarButton.
SmartPnrCustomToolbarButton smartAlertsButton = new SmartPnrCustomToolbarButton();
// Add a style.
smartAlertsButton.Style = (Style)smartAlertsButton.FindResource("PnrCustomToolbarPopup");
// Set the default content
smartAlertsButton.ButtonContentDefault = ellipse1;
// Set the default content
smartAlertsButton.ButtonContentSelected = ellipse2;
//Set the Hover button content
smartAlertsButton.ButtonContentHover = ellipse3;
// Set the tooltip
smartAlertsButton.ToolTip = "Add Custom Remarks";
smartAlertsButton.Content = ellipse1;
smartAlertsButton.View = grid;
// Get the current TE Control
var teControl = UIHelper.Instance.CurrentSmartTerminalWindow;
// Add the instance of SmartPnrCustomToolbarButton to the existing collection of PnrCustomToolbar
teControl.PnrCustomToolbar.Add(smartAlertsButton);
]]>
HELP FS· to send the command to the host";
// Set the message in the terminal
UIHelper.Instance.ShowMessageInTerminal(message, currentTEControl);
// Highlight the the current terminal control FlowDocument
UIHelper.Instance.AutoHighlight(currentTEControl.TerminalRTB.Document);
]]>
UIHelper.Instance.ShowMessageBox("You clicked the new menu item");
// Add the new SmartMenuItem to the tools menu
UIHelper.Instance.SetMenuItemInToolsMenu(menuItem, UIHelper.Instance.CurrentSmartpointUserControl);
// Find and open the parent popup
var parentMenuItem = (MenuItem)menuItem.Parent;
parentMenuItem.IsSubmenuOpen = true;
// Change the colour of the added item
menuItem.FindVisualChildren().First().Background = new SolidColorBrush(Colors.Red);
menuItem.Foreground = new SolidColorBrush(Colors.White);
]]>
remark).Where(remark => remark.SegmentNumber.HasValue).ToList();
// If any associated remark available in the booking.
if (remarks.Any())
{
var remarkToModify = remarks.First();
var associatedSegment = bookingFile.Segments[remarkToModify.SegmentNumber.Value - 1];
remarkToModify.Text = string.Format("MODIFIED ASSOCIATED REMARK {0}", remarkToModify.Number);
// Call AssociatedRemarkModify for modifying the remark in the booking file.
desktopFactory.AssociatedRemarkModify(remarkToModify, associatedSegment);
// Commit the changes to the booking file.
desktopFactory.EndBookingFile("AgentA", EndTransactEmailAction.None, true);
// Refresh the booking file to reflect added remarks.
PnrHelper.Instance.RefreshCurrentBookingFile();
}
]]>
remark).Where(remark => remark.SegmentNumber.HasValue).ToList();
// If any associated remark available in the booking.
if (remarks.Any())
{
// get the remark to delete.
var remarkToDelete = remarks.First();
var segment = bookingFile.Segments[remarkToDelete.SegmentNumber.Value - 1];
// Call AssociatedRemarkDelete for deleting the remark from the booking file.
desktopFactory.AssociatedRemarkDelete(remarkToDelete, segment);
// Commit the changes to the booking file.
desktopFactory.EndBookingFile("AgentA", EndTransactEmailAction.None, true);
// Refresh the booking file to reflect added remarks.
PnrHelper.Instance.RefreshCurrentBookingFile();
}
]]>
ir.Category == "FT").Select(ir => ir).ToList();
if (remarks.Any())
{
// Clear any previous transaction.
desktopFactory.ClearTransaction();
var remarkToDelete = remarks.First();
// Add remark to the transaction.
desktopFactory.AddNodeToTransaction(remarkToDelete, TransactionAction.Delete);
// Send the request to host for deleting the remarks.
desktopFactory.SendTransactionRequest();
// Commit the changes to the booking file.
desktopFactory.EndBookingFile("AgentA", EndTransactEmailAction.None, true);
// Refresh the booking file to reflect added remarks.
PnrHelper.Instance.RefreshCurrentBookingFile();
}
]]>
UIHelper.Instance.ShowMessageBox("hello"));
UIHelper.Instance.RegisterQuickCommand(quickCommand);
]]>
hostResponse = new List();
string searchDate = DateTime.Now.AddDays(25).ToDDMMMFormatString();
string command = string.Format("ZFSATL{0}BOS;", searchDate);
hostResponse.AddRange(communicationFactory.SendTerminalCommand(command));
while (!hostResponse.Last().Equals(">"))
{
if (hostResponse.Last().Equals(")>"))
{
hostResponse.RemoveAt(hostResponse.Count - 1);
}
hostResponse.AddRange(communicationFactory.SendTerminalCommand("MR"));
}
if (hostResponse.Last().Equals(">"))
{
hostResponse.RemoveAt(hostResponse.Count - 1);
}
if (hostResponse.Count > 0)
{
ReadOnlyCollection response = hostResponse.AsReadOnly();
SmartParagraph paragraph = new SmartParagraph();
// Create a SmartSpanHighlight object for every host response line received.
// If text in any line is returned with SOM and tabstop character then
// SmartSpanHighlight class will convert that text into TabStop entry.
foreach (Travelport.Smartpoint.Controls.SmartSpanHighlight span in
response
.Select(hostResponseLine =>
new Travelport.Smartpoint.Controls.SmartSpanHighlight
{ Text = hostResponseLine }))
{
paragraph.Inlines.Add(span);
paragraph.Inlines.Add(new System.Windows.Documents.LineBreak());
}
UIHelper.Instance.SetTerminalContent(UIHelper.Instance.CurrentTEControl, paragraph, true);
}
]]>
response = new List
{
"Tab stop entries sample",
"---------------------------",
"",
"",
string.Format("Get PCC and Workarea information {0}{1}{2}", CoreHelper.Instance.SOM, "OP/W*", CoreHelper.Instance.TABSTOP),
string.Format("Retrieve current booking file {0}{1}{2}", CoreHelper.Instance.SOM, "*R", CoreHelper.Instance.TABSTOP),
};
SmartParagraph paragraph = new SmartParagraph();
// Create a SmartSpanHighlight object for every host response line received.
// If text in any line is returned with SOM and tabstop character then
// SmartSpanHighlight class will convert that text into TabStop entry.
foreach (Travelport.Smartpoint.Controls.SmartSpanHighlight span
in response.Select(
sampleResponseLine =>
new Travelport.Smartpoint.Controls.SmartSpanHighlight { Text = sampleResponseLine }))
{
paragraph.Inlines.Add(span);
paragraph.Inlines.Add(new System.Windows.Documents.LineBreak());
}
UIHelper.Instance.SetTerminalContent(UIHelper.Instance.CurrentTEControl, paragraph, true);
]]>
routes = new Collection();
var request = new LowCostFareSearch();
var route = new AirAvailabilitySearch("ATL", "BOS", DateTime.Now.AddDays(15));
request.Routing.Add(route);
request.Passengers.Add(new Person(PassengerType.Adult));
var response = factory.GetLowCostFares(request);
StringBuilder strb = new StringBuilder();
if (response.FareQuotes != null && response.FareQuotes.Count > 0)
{
strb.AppendLine("Total FareQuotes = " + response.FareQuotes.Count);
}
else
{
strb.AppendLine("No valid fare found");
}
MessageBox.Show(strb.ToString());
]]>
segments = new Collection();
DateTime futureDate = DateTime.Now.AddDays(50);
//Departure Date
DateTime departureDate = new DateTime(futureDate.Year, futureDate.Month, futureDate.Day, 8, 40, 0);
//Arrival Date
DateTime arrivalDate = new DateTime(futureDate.Year, futureDate.Month, futureDate.Day, 9, 50, 0);
//create a segment object for passive sell
AirSegment segment = new AirSegment(
new AirVendor("U2"), //AirVendor
11, //Flight number
new IataLocation("LTN", LocationType.Airport), // Origin
new IataLocation("EDI", LocationType.Airport), // Destination
"I", // Class of service
departureDate, // Departure date and time
arrivalDate, // Arrival date and time
AirSegmentRequestStatus.Passive, // Passive indicator
null // Connecting segment
);
// Get the request code based on the GDS type
string requestCode = UIHelper.Instance.CurrentTEControl.Connection.ConnectionType.Gds == Gds.Galileo ? "AK" : "GK";
segment.RequestCode = requestCode;
//adding segment to segment collection
segments.Add(segment);
//Get the communication factory object for the current terminal
SessionedCommunicationFactory hostFactory = UIHelper.Instance.CurrentTEControl.Connection.CommunicationFactory;
//Call BookAirSegments() method for selling the segment.
//This method takes all segments to sell and number of passengers
hostFactory.BookAirSegments(segments, 1);
//Refresh the booking file after adding the segment
PnrHelper.Instance.RefreshCurrentBookingFile();
]]>