Пример #1
0
        /// <summary>
        /// Show the dialog
        /// </summary>
        /// <param name="title">The title to display for this dialog</param>
        /// <param name="parentContext">The parent contextual to the new object to add</param>
        /// <param name="itemType">The type of new item to suggest in the dialog</param>
        /// <param name="dialogStyle">The layout display style</param>
        /// <returns>The dialog user's choice (will either be OK or Cancel)</returns>
        public DialogResult ShowDialog(string title, ILuaEditDocumentGroup parentContext,
                                       NewItemTypes itemType, NewItemDialogStyle dialogStyle)
        {
            string location = parentContext != null?Path.GetDirectoryName(parentContext.FileName) : string.Empty;

            return(this.ShowDialog(title, parentContext, location, itemType, dialogStyle));
        }
Пример #2
0
        /// <summary>
        /// Show the dialog
        /// </summary>
        /// <param name="title">The title to display for this dialog</param>
        /// <param name="parentContext">The parent contextual to the new object to add</param>
        /// <param name="location">The location directory to suggest</param>
        /// <param name="itemType">The type of new item to suggest in the dialog</param>
        /// <param name="dialogStyle">The layout display style</param>
        /// <returns>The dialog user's choice (will either be OK or Cancel)</returns>
        public DialogResult ShowDialog(string title, ILuaEditDocumentGroup parentContext, string location,
                                       NewItemTypes itemType, NewItemDialogStyle dialogStyle)
        {
            this.DialogStyle           = dialogStyle;
            this.Text                  = title;
            btnAdd.Text                = parentContext == null ? "OK" : "Add";
            _parentContext             = parentContext;
            _itemType                  = itemType;
            lvwNewItems.SmallImageList = DocumentFactory.Instance.DocumentSmallImages;
            lvwNewItems.LargeImageList = DocumentFactory.Instance.DocumentLargeImages;
            txtLocation.Text           = location;
            FillList();

            if (lvwNewItems.Items.Count > 0)
            {
                lvwNewItems.Items[0].Selected = true;
            }

            return(this.ShowDialog(FrameworkManager.Instance.MainDialog));
        }
Пример #3
0
 /// <summary>
 /// Show the dialog
 /// </summary>
 /// <param name="title">The title to display for this dialog</param>
 /// <param name="itemType">The type of new item to suggest in the dialog</param>
 /// <param name="dialogStyle">The layout display style</param>
 /// <returns>The dialog user's choice (will either be OK or Cancel)</returns>
 public DialogResult ShowDialog(string title, NewItemTypes itemType, NewItemDialogStyle dialogStyle)
 {
     return(this.ShowDialog(title, null, itemType, dialogStyle));
 }