示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var result = default(TonalityMarkingOutputResult);

            using (var client = new TonalityMarkingWcfClient(ENDPOINT_CONFIGURATION_NAME))
            {
                var inputParams = new TonalityMarkingInputParams(this.InputText)
                {
                    InquiriesSynonyms = UseInquiry ? InquiryText.ToTextList() : null,
                };

                result = client.ExecuteTonalityMarking(inputParams);
            }

            var originalText     = this.InputText;
            var offsetsProcessor = new OffsetsProcessor(/*this.InputText*/);

            //var viewInWindowText = (this.ViewInWindow ? (this.InputText + Extensions.HR) : string.Empty);

            resultHtmlDiv.InnerHtml = result.InquiryAllocateStatus.ToHtml(this.UseInquiry, this.InquiryText) +
                                      result.AuthorTonalityMarkingTuple.ToHtml() +
                                      Extensions.HR +
                                      ((this.OutputType == OutputTypeEnum.Xml_Custom && this.ViewInWindow) ? (this.InputText + "<hr/>") : string.Empty) +
                                      result.ToHtml(OutputType, Server, offsetsProcessor, originalText, OffsetCreationXmlType);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var result = default(DigestOutputResult);

            using (var client = new DigestWcfClient(ENDPOINT_CONFIGURATION_NAME))
            {
                var inputParams = new DigestInputParams(this.InputText, InputTextFormat.PlainText)
                {
                    ExecuteTonalityMarking = ExecuteTonalityMarking,
                    InquiriesSynonyms      = UseInquiry ? InquiryText.ToTextList() : null,
                };

                result = client.ExecuteDigest(inputParams);
            }

            var originalText     = this.InputText;
            var offsetsProcessor = new OffsetsProcessor(/*this.InputText*/);

            var viewInWindowText = (this.ViewInWindow ? (this.InputText + Extensions.HR) : string.Empty);

            switch (this.OutputType)
            {
            case OutputTypeEnum.Table:
                resultHtmlDiv.InnerHtml = viewInWindowText +
                                          result.Tuples.ToHtmlTable(Server, offsetsProcessor, originalText, OffsetCreationXmlType);
                break;

            case OutputTypeEnum.Table_And_Xml_Custom_BySent:
                resultHtmlDiv.InnerHtml = viewInWindowText +
                                          result.ToHtmlTableAndXmlCustomBySent(OutputType, Server, offsetsProcessor, originalText, OffsetCreationXmlType);
                break;

            default:
                throw (new ArgumentException(this.OutputType.ToString()));
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var result = default(DigestOutputResult);

            using (var client = new DigestWcfClient(ENDPOINT_CONFIGURATION_NAME))
            {
                var inputParams = new DigestInputParams(this.InputText, InputTextFormat.PlainText)
                {
                    ExecuteTonalityMarking = ExecuteTonalityMarking,
                    InquiriesSynonyms      = UseInquiry ? InquiryText.ToTextList() : null,
                    ObjectAllocateMethod   = this.ObjectAllocateMethod,
                };

                result = client.ExecuteDigest(inputParams);
            }

            var viewInWindowText = (this.ViewInWindow ? (this.InputText + Extensions.HR) : string.Empty);

            switch (this.OutputType)
            {
            case OutputTypeEnum.Xml:
                resultXmlTable.Visible = true;
                resultXmlDiv.Visible   = true;     //this.ViewInWindow;
                resultHtmlDiv.Visible  = false;

                resultXmlDiv.Style[HtmlTextWriterStyle.Height] =
                    (this.ViewInWindow ? (result.Tuples.Any() ? 200 : 100) : (result.Tuples.Any() ? 100 : 25)).ToString() + "px";
                resultXmlDiv.InnerHtml = viewInWindowText +
                                         result.Tuples.ToHtml(Server);

                this.CurrentDigestOutputResult = result;
                break;

            default:
                resultXmlTable.Visible = false;
                resultHtmlDiv.Visible  = true;

                switch (this.OutputType)
                {
                case OutputTypeEnum.Xml_Custom:
                    resultHtmlDiv.InnerHtml = viewInWindowText +
                                              result.ToHtml(OutputType, Server);
                    break;

                case OutputTypeEnum.Table:
                    resultHtmlDiv.InnerHtml = viewInWindowText +
                                              result.Tuples.ToHtml(Server);
                    break;

                case OutputTypeEnum.Table_And_Xml_Custom:
                    resultHtmlDiv.InnerHtml = viewInWindowText +
                                              result.Tuples.ToHtml(Server) +
                                              Extensions.HR +
                                              result.ToHtml(OutputType, Server);
                    break;

                case OutputTypeEnum.Table_And_Xml_Custom_BySent:
                    resultHtmlDiv.InnerHtml = viewInWindowText +
                                              result.ToHtml2(OutputType, Server);
                    break;

                default:
                    throw (new ArgumentException(this.OutputType.ToString()));
                }
                break;
            }
        }