コード例 #1
0
        /// <summary>
        /// Otvara privremenu instancu dijaloga i sinhrono ceka rezultat
        /// </summary>
        /// <param name="platform">Platforma na kojoj se prikazuje dijalog</param>
        /// <param name="targetObject">Objekat koi se edituje</param>
        /// <param name="spec">Property za koji se edituje ovaj objekat</param>
        /// <param name="hostTitle">Naslov host->property objekta</param>
        /// <param name="title">todo: describe title parameter on openMessageBox</param>
        /// <param name="description">todo: describe description parameter on openMessageBox</param>
        /// <returns>Kolekcija rezultata</returns>
        public static T openMessageBox <T>(IPlatform platform, String title, String description, params T[] spec)
        {
            var dialog = new dialogMessageBoxWithOptions <T>(platform, title, description, spec);

            T defVal = (T)spec.ToList().getFirstSafe();

            var format = new dialogFormatSettings(dialogStyle.redDialog, dialogSize.mediumBox);

            var res = dialog.open(platform, format);

            T output = res.getResultObject <T>(defVal);

            return(output);
        }
コード例 #2
0
        /// <summary>
        /// Opens the dialog menu asking user to choose from options
        /// </summary>
        /// <typeparam name="T">Option type</typeparam>
        /// <param name="options">List of available options</param>
        /// <param name="title">The title to show</param>
        /// <param name="description">The description to show</param>
        /// <param name="style">The style to use for dialog box rendering</param>
        /// <param name="size">The size of the dialog box</param>
        /// <returns>Answer</returns>
        public static T openDialogWithOptions <T>(T[] options, String title = "", String description = "", dialogStyle style = dialogStyle.blueDialog, dialogSize size = dialogSize.mediumBox)
        {
            if (title == "")
            {
                title = "Select option";
            }
            if (description == "")
            {
                description = "Please select one of the " + typeof(T).Name.imbTitleCamelOperation(true).ToLower() + "";
            }
            dialogMessageBoxWithOptions <T> dialog = new dialogMessageBoxWithOptions <T>(aceCommons.platform, title, description, options);
            var response = dialog.open(aceCommons.platform, new dialogFormatSettings(style, size));

            return(response.getResultObject <T>(options.First()));
        }