小编tsi*_*orn的帖子

Silverlight RichTextBox中的XAML标记大小过多

我在silverlight 5应用程序中有一个非常简单的RichTextBox控件.

<RichTextBox x:Name="rtbControl" 
    Height="Auto" 
    ContentChanged="rtbControl_ContentChanged" />
Run Code Online (Sandbox Code Playgroud)

随着数据的更改,我将其捕获到局部变量中,如下所示:

    private void rtbControl_ContentChanged(object sender, ContentChangedEventArgs e)
    {
        RichTextContent = rtbControl.Xaml;
    }
Run Code Online (Sandbox Code Playgroud)

一切都有效.但是,如果我输入几个单词并检查<Paragraph>标记,那就太大了!下面是一个片段.有没有办法在标记中没有所有的排版内容?它为什么存在并且需要它?有没有办法删除它?

<Section xml:space="preserve" HasTrailingParagraphBreakOnPaste="False" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Paragraph FontSize="11" FontFamily="Segoe UI" Foreground="#FF000000" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" 
CharacterSpacing="0" Typography.AnnotationAlternates="0" Typography.EastAsianExpertForms="False" Typography.EastAsianLanguage="Normal" 
Typography.EastAsianWidths="Normal" Typography.StandardLigatures="True" Typography.ContextualLigatures="True" 
Typography.DiscretionaryLigatures="False" Typography.HistoricalLigatures="False" Typography.StandardSwashes="0" Typography.ContextualSwashes="0" 
Typography.ContextualAlternates="True" Typography.StylisticAlternates="0" Typography.StylisticSet1="False" Typography.StylisticSet2="False"
 Typography.StylisticSet3="False" Typography.StylisticSet4="False" Typography.StylisticSet5="False" Typography.StylisticSet6="False" Typography.StylisticSet7="False" 
Typography.StylisticSet8="False" Typography.StylisticSet9="False" Typography.StylisticSet10="False" Typography.StylisticSet11="False" 
Typography.StylisticSet12="False" Typography.StylisticSet13="False" Typography.StylisticSet14="False" Typography.StylisticSet15="False" 
Typography.StylisticSet16="False" Typography.StylisticSet17="False" Typography.StylisticSet18="False" Typography.StylisticSet19="False" 
Typography.StylisticSet20="False" Typography.Capitals="Normal" Typography.CapitalSpacing="False" Typography.Kerning="True" Typography.CaseSensitiveForms="False" 
Typography.HistoricalForms="False" Typography.Fraction="Normal" Typography.NumeralStyle="Normal" Typography.NumeralAlignment="Normal" Typography.SlashedZero="False"
 Typography.MathematicalGreek="False" Typography.Variants="Normal" TextOptions.TextHintingMode="Fixed" TextOptions.TextFormattingMode="Ideal" …
Run Code Online (Sandbox Code Playgroud)

silverlight richtextbox silverlight-5.0

5
推荐指数
1
解决办法
630
查看次数

在Web服务中使用Task.WhenAny()

我有一个需要尽快返回数据的Web服务.我有两个可以查询的来源.我想返回use Task.WhenAny()来查询这些源并返回首先返回的项.当我在我的本地开发环境中运行我的代码时,代码将成功从最快的任务返回数据但是当较慢的任务返回时,它会使我的IIS Express工作进程崩溃并引用空引用异常.

MyService.asmx

<%@ WebService Language="C#" CodeBehind="MyService.asmx.cs" Class="MyWebService.MyService" %>
Run Code Online (Sandbox Code Playgroud)

MyService.asmx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace MyWebService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class MyService : System.Web.Services.WebService
    {
        private WebCore _webService;

        public MyService()
        {
            _webService = new WebCore();
        }


        [WebMethod]
        public …
Run Code Online (Sandbox Code Playgroud)

c# asynchronous web-services task-parallel-library async-await

4
推荐指数
1
解决办法
1224
查看次数

Sustainsys.saml2 生成的元数据的 URL 是什么?

我在 MVC 应用程序中使用sustainsys.saml2 库。我被要求为我的服务提供商 (SP) 应用程序提供元数据。Sustainsys 库为我做这件事吗?我会为我的应用程序元数据提供 IDP 的 URL 是什么?

web.config 元素的维持系统帮助文档说:

配置的元数据部分可用于调整生成的元数据。这些配置选项仅影响元数据的生成方式,不会更改代码的其他行为。

同样,这个生成的元数据的 URL 是什么?我很高兴提供更多信息......我只是不知道我现在不知道什么。

sustainsys-saml2

4
推荐指数
1
解决办法
1090
查看次数