/// <summary>
            /// Creates a custom appointment edit dialog.
            /// </summary>
            /// <returns></returns>
            public override NTopLevelWindow CreateEditDialog()
            {
                NSchedule schedule = (NSchedule)GetFirstAncestor(NSchedule.NScheduleSchema);
                NWindow   window   = schedule != null ? schedule.OwnerWindow : null;

                // Create a dialog window
                NTopLevelWindow dialog = NApplication.CreateTopLevelWindow(NWindow.GetFocusedWindowIfNull(window));

                dialog.SetupDialogWindow("Appointment with Image Editor", true);

                NStackPanel stack = new NStackPanel();

                stack.FillMode = ENStackFillMode.Last;
                stack.FitMode  = ENStackFitMode.Last;

                // Add an image box with the image
                NImageBox imageBox = new NImageBox((NImage)NSystem.SafeDeepClone(Image));

                stack.Add(imageBox);

                // Add property editors for some of the appointment properties
                NDesigner designer = NDesigner.GetDesigner(this);
                NList <NPropertyEditor> editors = designer.CreatePropertyEditors(this,
                                                                                 SubjectProperty,
                                                                                 StartProperty,
                                                                                 EndProperty);

                for (int i = 0; i < editors.Count; i++)
                {
                    stack.Add(editors[i]);
                }

                // Add a button strip with OK and Cancel buttons
                NButtonStrip buttonStrip = new NButtonStrip();

                buttonStrip.InitOKCancelButtonStrip();
                stack.Add(buttonStrip);

                dialog.Content = new NUniSizeBoxGroup(stack);

                return(dialog);
            }
            public override NWidget CreateWidget(NCountry country)
            {
                // Create a dock panel
                NStackPanel stack = new NStackPanel();

                stack.Padding = new NMargins(3);
                stack.Tag     = country;

                // Create the flag image box and the country name label
                NLabel countryLabel = new NLabel(country.Name);

                countryLabel.VerticalPlacement = ENVerticalPlacement.Center;
                countryLabel.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, 10, ENFontStyle.Bold);

                NImageBox imageBox = new NImageBox((NImage)NSystem.SafeDeepClone(country.Flag));

                imageBox.VerticalPlacement   = ENVerticalPlacement.Center;
                imageBox.HorizontalPlacement = ENHorizontalPlacement.Left;

                NPairBox pairBox = new NPairBox(imageBox, countryLabel);

                pairBox.Spacing = 3;
                stack.Add(pairBox);

                // Create the capital label
                NLabel capitalLabel = new NLabel("Capital: " + country.Capital);

                stack.Add(capitalLabel);

                // Create the currency label
                NLabel currencyLabel = new NLabel("Currency: " + country.CurrencyName + ", " +
                                                  country.CurrencyCode);

                stack.Add(currencyLabel);

                return(stack);
            }