<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3054479</guid>
        <pubDate>Fri, 30 Dec 2011 16:31:39 +0000</pubDate>
        <title>TextBox и строка с &amp;quot;переовдом строк&amp;quot;</title>
        <link>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3054479</link>
        <description><![CDATA[Felan: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=347673&view=findpost&p=3054432'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>IL_Agent &#064; <time class="tag-quote__quoted-time" datetime="2011-12-30T17:55:11+04:00">30.12.11, 13:55</time></span><div class='quote '>А как она возвращается ?</div></div><br>
WCF сервис возвращает XML. Строка - значение одного из элементов.<br>
<br>
Потом этот XML грузится в датасет.<br>
<br>
Потом из датасета я ее беру и присваюваю текстбоксу.<br>
<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=347673&view=findpost&p=3054432'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>IL_Agent &#064; <time class="tag-quote__quoted-time" datetime="2011-12-30T13:55:11+00:00">30.12.11, 13:55</time></span><div class='quote '>Возможно метод, который это делает, как-то преобразует спец. символы.</div></div><br>
Ну например как?<br>
Я же говорю, что смотрю под отладчиком, все наместе. Смотрю я преям перед самым присвоением тестбоксу. Т.е. уже на клиенте и уже ничего с ней потом не происходит.<br>
<br>
Кстати, забыл упомянуть, что если эту строку из под отлачика скопировать в текстовый редактор (пробовал np и np++), то все отображается правильно.<br>
И еще, на эмуляторах тоже все отображается правильно. <br>
<br>
Проблема только на реальных устройствах.]]></description>
        <author>Felan</author>
        <category>.NET: Compact Framework</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3054432</guid>
        <pubDate>Fri, 30 Dec 2011 13:55:11 +0000</pubDate>
        <title>TextBox и строка с &amp;quot;переовдом строк&amp;quot;</title>
        <link>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3054432</link>
        <description><![CDATA[IL_Agent: А как она возвращается ? Возможно метод, который это делает, как-то преобразует спец. символы.]]></description>
        <author>IL_Agent</author>
        <category>.NET: Compact Framework</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3051970</guid>
        <pubDate>Mon, 26 Dec 2011 13:12:19 +0000</pubDate>
        <title>TextBox и строка с &amp;quot;переовдом строк&amp;quot;</title>
        <link>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3051970</link>
        <description><![CDATA[Felan: Я смотрел. Ничего не увидел особенного. Возвращается обычная строка. С обычными &#092;r&#092;n. Если из под отладчика ее скопировать в любой текстовый редактор, то все отображается как положено с переносами.<br><br>Что именно нужно посмотреть?]]></description>
        <author>Felan</author>
        <category>.NET: Compact Framework</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3051916</guid>
        <pubDate>Mon, 26 Dec 2011 11:35:38 +0000</pubDate>
        <title>TextBox и строка с &amp;quot;переовдом строк&amp;quot;</title>
        <link>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3051916</link>
        <description><![CDATA[IL_Agent: Думаю, надо смотреть, что на сервере происходит...]]></description>
        <author>IL_Agent</author>
        <category>.NET: Compact Framework</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3048677</guid>
        <pubDate>Tue, 20 Dec 2011 12:49:13 +0000</pubDate>
        <title>TextBox и строка с &amp;quot;переовдом строк&amp;quot;</title>
        <link>https://forum.sources.ru/index.php?showtopic=347673&amp;view=findpost&amp;p=3048677</link>
        <description><![CDATA[Felan: Странная проблема появилась.<br>
<br>
Есть текст бокс на форме приложения для мобильного устройства.<br>
<br>
Собираю нужную мне строку, которая содержит переводы строк. Примерно так:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;while (prev != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!prev.IsTemperatureNull())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.Insert(0, String.Format(&quot;Temperature: {0} F{1}{1}&quot;, prev.Temperature, Environment.NewLine));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.Insert(0, GetQuestionTextForCoolingCategory(prev));</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;prev = DataContext.Current.GetPrevQuestion(prev, GetNextPrevQuestionMode.InGroup);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.Append(GetQuestionTextForCoolingCategory(lastQuestionRow));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!lastQuestionRow.IsTemperatureNull())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.AppendFormat(&quot;Temperature: {0} F{1}{1}&quot;, lastQuestionRow.Temperature, Environment.NewLine);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lastQuestionRow.Comments = lastQuestionRow.IsCommentsNull() ? sb.ToString() : String.Format(&quot;{0}{1}--{1}{2}&quot;, sb, Environment.NewLine, lastQuestionRow.Comments);</div><div class="code_line">&nbsp;</div><div class="code_line">*******</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_currentComment = DataContext.Current.QuestionRow.Comments;</div><div class="code_line">&nbsp;</div><div class="code_line">*******</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notesTextBox.Text = _currentComment;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
Все работает отлично. В текстбоксе находится строка с переводом строк.<br>
Потом приложение передает эту строку на сервер.<br>
Потом приложение получает эту же строку с сервера.<br>
<br>
И при простом присвоении этой строки:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_currentComment = DataContext.Current.QuestionRow.Comments;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notesTextBox.Text = _currentComment;</div></ol></div></div></div></div><br>
<br>
В тектстбоксе находится одна строка с квадратиками вместо перевода строк. Причем на каждый перевод строки приходится _один_ квадратик.<br>
<br>
Полученная строка, которая находится в _currentComment перед присвоением текстбоксу, под отладчиком выглядит правильно. В ней находятся все &#39;&#092;r&#092;n&#39; в нужных местах.<br>
<br>
Если же перед пресвоением текстбоксу &quot;пересобрать строку&quot; примерно так:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var lines = _currentComment.Replace(Environment.NewLine, &quot;\n&quot;).Split(&#39;\n&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var sb = new StringBuilder(_currentComment.Length * 2);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (var line in lines)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (sb.Length &#62; 0)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.Append(Environment.NewLine);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.Append(line);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notesTextBox.Text = sb.ToString();</div></ol></div></div></div></div><br>
<br>
То все отображается правльно.<br>
<br>
В чем проблема? Как это это лечится нормальными средствами, без извращений?<br>
<br>
Мультилайн у текстбокса стоит... естетственно... AcceptsReturn тоже... хотя я его по всякому пробовал.<br>
<br>
Почему пропадет только один символ? (квадратик то один, значит один правильно обрабатывается)<br>
<br>
Кто может сталкивался?]]></description>
        <author>Felan</author>
        <category>.NET: Compact Framework</category>
      </item>
	
      </channel>
      </rss>
	