<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msdnvietnam.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Silverlight Tip of the Day #20 – How to Increase your Isolated Storage Quota.</title><link>http://msdnvietnam.net/wikis/silverlighttips/silverlight-tip-of-the-day-20-how-to-increase-your-isolated-storage-quota.aspx</link><description>Các mẹo khi lập trình SilverLight</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Silverlight Tip of the Day #20 – How to Increase your Isolated Storage Quota.</title><link>http://msdnvietnam.net/wikis/silverlighttips/silverlight-tip-of-the-day-20-how-to-increase-your-isolated-storage-quota.aspx</link><pubDate>Wed, 15 Jul 2009 03:47:42 GMT</pubDate><guid isPermaLink="false">019a604b-fb74-42d5-8a6d-7cedfb08f61c:64</guid><dc:creator>Nguyễn Thị Như Quỳnh</dc:creator><comments>http://msdnvietnam.net/wikis/silverlighttips/silverlight-tip-of-the-day-20-how-to-increase-your-isolated-storage-quota/comments.aspx</comments><description>Current revision posted to SilverLight programming tip tricks by Nguyễn Thị Như Quỳnh on 7/15/2009 11:47:42 AM&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mỗi ứng dụng mặc định được 1 MB cho việc lưu trữ dữ
liệu trong Isolated
Storage nơi m&amp;agrave; server c&amp;oacute; thể lưu trữ những dữ liệu đặc biệt của client tr&amp;ecirc;n m&amp;aacute;y
clients. Nhưng điều g&amp;igrave; sẽ xảy ra nếu bạn cần kh&amp;ocirc;ng gian lưu trữ nhiều hơn 1 MB?
May mắn thay, đối tượng IsolatedStorageFile đ&amp;atilde; c&amp;oacute; cung cấp một phương thức gọi
l&amp;agrave; IncreaseQuotaTo(), cho ph&amp;eacute;p 1 server tăng dung lượng lưu trữ dữ liệu tr&amp;ecirc;n
m&amp;aacute;y user. &lt;/p&gt;
&lt;p&gt;Bạn c&amp;oacute; thể
nh&amp;igrave;n thấy danh s&amp;aacute;ch c&amp;aacute;c ứng dụng sử dụng IsolatedStorage tr&amp;ecirc;n hộp thoại của
bạn. Để l&amp;agrave;m điều n&amp;agrave;y:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click chuột phải l&amp;ecirc;n bất k&amp;igrave; ứng dụng Silverlight n&amp;agrave;o v&amp;agrave;
     từ menu hiện ra chọn lựa chọn duy nhất : &amp;quot;Silverlight Configuration&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/WindowsLiveWriter/TipoftheDay20HowtoIncreasetheIsolatedSt_C31A/SC_2.png" width="162" height="27" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Khi click
v&amp;agrave;o lựa chọn duy nhất ấy, sẽ l&amp;agrave;m xuất hiện hộp thoại Silverlight
Configuration &lt;/p&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/image_thumb%5B1%5D_vGtLjA.png" width="514" height="363" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Click v&amp;agrave;o tab cuối c&amp;ugrave;ng &amp;quot;Application
Storage&amp;quot; v&amp;agrave; bạn sẽ nh&amp;igrave;n thấy danh s&amp;aacute;ch của tất cả c&amp;aacute;c websites đang sử dụng Isolated
Storage tr&amp;ecirc;n m&amp;aacute;y của bạn.&amp;nbsp; Kh&amp;ocirc;ng gian lưu
trữ hiện thời của mỗi ứng dụng được sử dụng cũng như l&amp;agrave; dung lượng giới hạn được
cho ph&amp;eacute;p cho mỗi ứng dụng cũng được hiển thị trong danh s&amp;aacute;ch n&amp;agrave;y.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/image_thumb%5B3%5D_wxWwPw.png" width="514" height="403" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;C&amp;ograve;n demo của ch&amp;uacute;ng ta sẽ hiển thị 3
mảng th&amp;ocirc;ng tin sau:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Kh&amp;ocirc;ng gian đang được sử dụng&lt;/li&gt;
&lt;li&gt;Kh&amp;ocirc;ng gian hiện c&amp;oacute; thể sử dụng&lt;/li&gt;
&lt;li&gt;Dung lượng giới hạn hiện c&amp;oacute;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;T&amp;ocirc;i đ&amp;atilde; th&amp;ecirc;m v&amp;agrave;o 1 textbox &amp;nbsp;nơi m&amp;agrave; bạn c&amp;oacute; thể chứa số bytes m&amp;agrave; bạn muốn
tăng dung lượng giới hạn. Bằng việc click v&amp;agrave;o button, n&amp;oacute; sẽ l&amp;agrave;m việc cần thiết
l&amp;agrave; gọi IncreaseQuotaTo() để tăng dung lượng giới hạn.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;***Ch&amp;uacute; &amp;yacute;&lt;/b&gt;: Bạn cần phải gọi h&amp;agrave;m n&amp;agrave;y từ một sự kiện của user th&amp;iacute; dụ
như button click. V&amp;igrave; l&amp;iacute; do bảo mật, việc gọi IncreaseQuotaTo() trực tiếp sẽ tự
động được trả về &amp;nbsp;false nếu user kh&amp;ocirc;ng
nhanh ch&amp;oacute;ng thực hiện việc gọi. &lt;/p&gt;
&lt;p&gt;Sau đ&amp;acirc;y l&amp;agrave; cửa sổ của ứng dụng beta
m&amp;agrave; ch&amp;uacute;ng ta đang tạo:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/WindowsLiveWriter/TipoftheDay20HowtoIncreasetheIsolatedSt_C31A/3_thumb.png" width="424" height="156" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Khi
bạn chấp nhận một gi&amp;aacute; trị v&amp;agrave; click v&amp;agrave;o button bạn sẽ nhận được hộp thoại sau:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/WindowsLiveWriter/TipoftheDay20HowtoIncreasetheIsolatedSt_C31A/4_thumb.png" width="430" height="199" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Nếu
bạn click yes, bạn sẽ nhận được kết quả sau:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://silverlight.net/blogs/msnow/WindowsLiveWriter/TipoftheDay20HowtoIncreasetheIsolatedSt_C31A/4_thumb.png" width="429" height="180" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;N&amp;agrave;o
b&amp;acirc;y giờ h&amp;atilde;y nh&amp;igrave;n v&amp;agrave;o code XAML trong trang Page.xaml m&amp;agrave; ch&amp;uacute;ng ta sử dụng để tạo
giao diện n&amp;agrave;y:&lt;/p&gt;
&lt;div style="border:1px solid gray;margin:20px 0px 10px;padding:4px;overflow:auto;font-size:8pt;width:97.5%;cursor:text;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;
&lt;div style="border-style:none;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&amp;lt;UserControl x:Class=&lt;span style="color:#006080;"&gt;&amp;quot;IncreaseIsolatedStorage.Page&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;    xmlns=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;    xmlns:x=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;    Width=&lt;span style="color:#006080;"&gt;&amp;quot;800&amp;quot;&lt;/span&gt; Height=&lt;span style="color:#006080;"&gt;&amp;quot;600&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&amp;lt;Grid x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; Background=&lt;span style="color:#006080;"&gt;&amp;quot;White&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;    &amp;lt;Canvas Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;SpacedUsed&amp;quot;&lt;/span&gt; &amp;gt;Current Spaced Used=&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;SpaceAvaiable&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;&amp;gt;Current Space Available=&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;CurrentQuota&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;40&amp;quot;&lt;/span&gt;&amp;gt;Current Quota=&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;NewSpace&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;70&amp;quot;&lt;/span&gt;&amp;gt;New space (&lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; bytes) to request=&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &amp;lt;TextBox Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;255&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;70&amp;quot;&lt;/span&gt; Width=&lt;span style="color:#006080;"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;SpaceRequest&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;365&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;70&amp;quot;&lt;/span&gt; Width=&lt;span style="color:#006080;"&gt;&amp;quot;60&amp;quot;&lt;/span&gt;&amp;gt;(1048576 = 1 MB)&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &amp;lt;Button Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; Content=&lt;span style="color:#006080;"&gt;&amp;quot;Increase Storage&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                Width=&lt;span style="color:#006080;"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; Height=&lt;span style="color:#006080;"&gt;&amp;quot;50&amp;quot;&lt;/span&gt; Click=&lt;span style="color:#006080;"&gt;&amp;quot;Button_Click&amp;quot;&lt;/span&gt;&amp;gt;                &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &amp;lt;/Button&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &amp;lt;TextBlock Canvas.Left=&lt;span style="color:#006080;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color:#006080;"&gt;&amp;quot;160&amp;quot;&lt;/span&gt; x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;Results&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;    &amp;lt;/Canvas&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&amp;lt;/Grid&amp;gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;V&amp;agrave; code ph&amp;iacute;a sau của ch&amp;uacute;ng ta:&lt;/p&gt;
&lt;div style="border:1px solid gray;margin:20px 0px 10px;padding:4px;overflow:auto;font-size:8pt;width:97.5%;cursor:text;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;
&lt;div style="border-style:none;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Net;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Documents;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Input;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Media;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Media.Animation;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows.Shapes;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.IO.IsolatedStorage;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;namespace&lt;/span&gt; SilverlightApplication11&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;{&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;partial&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Page : UserControl&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;    {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Page()&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            InitializeComponent();&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            SetStorageData();&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SetStorageData()&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;            &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                SpacedUsed.Text     = &lt;span style="color:#006080;"&gt;&amp;quot;Current Spaced Used = &amp;quot;&lt;/span&gt;+(isf.Quota - isf.AvailableFreeSpace).ToString() +&lt;span style="color:#006080;"&gt;&amp;quot; bytes&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                SpaceAvaiable.Text  = &lt;span style="color:#006080;"&gt;&amp;quot;Current Space Available=&amp;quot;&lt;/span&gt; + isf.AvailableFreeSpace.ToString() + &lt;span style="color:#006080;"&gt;&amp;quot; bytes&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                CurrentQuota.Text   = &lt;span style="color:#006080;"&gt;&amp;quot;Current Quota=&amp;quot;&lt;/span&gt; + isf.Quota.ToString() + &lt;span style="color:#006080;"&gt;&amp;quot; bytes&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; IncreaseStorage(&lt;span style="color:#0000ff;"&gt;long&lt;/span&gt; spaceRequest)&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;            &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                &lt;span style="color:#0000ff;"&gt;long&lt;/span&gt; newSpace = isf.Quota + spaceRequest; &lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt; == isf.IncreaseQuotaTo(newSpace))&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                    {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                        Results.Text = &lt;span style="color:#006080;"&gt;&amp;quot;Quota successfully increased.&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                    }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                    &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                    {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                        Results.Text = &lt;span style="color:#006080;"&gt;&amp;quot;Quota increase was unsuccessfull.&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                    }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; (Exception e)&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                    Results.Text = &lt;span style="color:#006080;"&gt;&amp;quot;An error occured: &amp;quot;&lt;/span&gt;+e.Message;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                SetStorageData();&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;        {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;            &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            {&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;                &lt;span style="color:#0000ff;"&gt;long&lt;/span&gt; spaceRequest = Convert.ToInt64(SpaceRequest.Text);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;                IncreaseStorage(spaceRequest);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;            }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;            &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; { &lt;span style="color:#008000;"&gt;// User put bad data in text box &lt;span style="color:#000000;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;        }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:#f4f4f4;"&gt;    }&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;background-color:white;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Thank you, 
  &lt;br /&gt;--Mike Snow&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>
