Пример #1
0
        public static async Task <IActionResult> GetCommentsFromThread(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "video/{parentId}/comments")]
            HttpRequest request,
            ExecutionContext context,
            TraceWriter traceWriter,
            string parentId)
        {
            var             appsettings    = new AppSettings(context);
            IYouTubeDataApi youTubeDataApi = new YouTubeDataApi(appsettings.YouTubeApiSettings);

            var            part          = request.Query.GetQueryParamValue("part");
            var            pageToken     = request.Query.GetQueryParamValue("pageToken");
            var            textFormatStr = request.Query.GetQueryParamValue("textFormat");
            TextFormatEnum textFormat    = TextFormatEnum.PlainText;

            TextFormatEnum.TryParse(textFormatStr, out textFormat);

            var commentsListRequest = youTubeDataApi.GetCommentListRequest(part, parentId, textFormat, pageToken);

            commentsListRequest.MaxResults = 100;
            var comments = await commentsListRequest.ExecuteAsync();

            return(new OkObjectResult(comments));
        }
Пример #2
0
 public static void SetUltraColumnFormat(UltraGridColumn column, TextFormatEnum textFormat)
 {
     SetUltraColumnFormat(column, TextFormats[textFormat]);
 }
Пример #3
0
 private void MaskTypeChanged(TextFormatEnum newMask)
 {
     this.SetMaskFormat(newMask);
 }
Пример #4
0
        private void SetMaskFormat(TextFormatEnum newMask)
        {
            switch (newMask)
            {
            case TextFormatEnum.Currency:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = currencyMask;
                break;

            case TextFormatEnum.NaturalQuantity:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = naturalQuantityMask;
                break;

            case TextFormatEnum.RealQuantity:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = realQuantityMask;
                break;

            case TextFormatEnum.Rate:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = rateMask;
                break;

            case TextFormatEnum.Percentage:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = percentageMask;
                break;

            case TextFormatEnum.NoLimitPercentage:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = noLimitPercentageMask;
                break;

            case TextFormatEnum.FileSize:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = this.fileSizeSubmask + this.measurementFileUnit;
                break;

            case TextFormatEnum.Integer:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Right;
                this.sumeValue.InputMask             = integerMask;
                break;

            case TextFormatEnum.PhoneNumber:
                this.sumeValue.DisplayMode           = MaskMode.IncludeBoth;
                this.sumeValue.Appearance.TextHAlign = HAlign.Left;
                this.sumeValue.InputMask             = phoneNumberMask;
                break;

            default:
                break;
            }
        }
Пример #5
0
 public Item(string text, TextFormatEnum format)
 {
     Text    = text;
     Format  = format;
     Actions = ImmutableList <ILink> .Empty;
 }