<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ManageScope &#187; Engineering</title>
	<atom:link href="http://www.managescope.com/category/engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.managescope.com</link>
	<description>Unleash Organizational Intelligence</description>
	<lastBuildDate>Mon, 09 Jan 2012 17:56:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Strong product recommendation: Awesomium and AwesomiumSharp</title>
		<link>http://www.managescope.com/2011/09/awesomium/</link>
		<comments>http://www.managescope.com/2011/09/awesomium/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 17:13:34 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Product Recommends]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=1138</guid>
		<description><![CDATA[We do a lot of WPF/Silverlight development here at ManageScope and we&#8217;ve been working with the Facebook C# SDK in *****, our new product that&#8217;s inflight. And yes &#8212; no comment. We recently ran into an issue with WPF&#8217;s WebBrowser not handling #&#8217;s introduced by Facebook in URIs during the authentication process. There&#8217;s been some [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin: 5px;" title="Awesomium and Awesomium Sharp" src="http://awesomium.com/wp-content/uploads/header_home5.jpg" alt="" width="346" height="235" />We do a lot of WPF/Silverlight development here at ManageScope and we&#8217;ve been working with the Facebook C# SDK in *****, our new product that&#8217;s inflight. And yes &#8212; no comment.</p>
<p>We recently ran into an issue with WPF&#8217;s WebBrowser not handling #&#8217;s introduced by Facebook in URIs during the authentication process. There&#8217;s been some good discussion on workarounds &#8230; host Winforms (which for WPF proponents like me is disappointing) &#8230; distribute your FB app secret and use &#8220;code&#8221; instead of &#8220;token&#8221; on responsetype and then exchange the code for a token. Smart thinking, but I wasn&#8217;t really satisfied with either solution.</p>
<p>So for community commentary and/or usage, I thought we&#8217;d share what we did to resolve this issue. We decided to use AwesomiumSharp and Awesomium&#8217;s WebControl in-place of the WebBrowser control from Microsoft.</p>
<p>A little background &#8230; when you&#8217;re using WebBrowser in WPF, you&#8217;re using Internet Explorer. There are many great products from Microsoft, but I&#8217;ve never included Internet Explorer among them. Not only do I have to use a browser I&#8217;m not fond of, but I&#8217;m stuck using whatever version of IE the user has installed on their deck. Not a great experience if you have users like we do who thought a recent upgrade from IE6 was awesome (just poking fun, guys!).</p>
<p>Awesomium on the other hand uses the Chromium project as its basis. And for those of you who are Chrome users, you know the elegance and speed that Chromium provides since you&#8217;re using the same foundation. And these kind and extremely talented gentlemen at Awesomium have also worked to provide a .NET wrapper around this Chromium base as well as a pre-rolled WebControl that replaces the functionality of WebBrowser. There are a ton of great things to say about this product &#8230; but they say it better <a href="http://www.awesomium.com">here</a>.</p>
<p>Long story short, the issue went away immediately and we were getting our access token without distributing our app secret or hosting the Winform&#8217;s browser. Not to mention we got a better control for creating integrated client and Internet experiences and we&#8217;re using something other than IE under the hood. If you&#8217;re developing in WPF, check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2011/09/awesomium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: Clamr! 2010 enables calling from Outlook with Gmail Chat!</title>
		<link>http://www.managescope.com/2011/07/new-release-clamr-2010-enables-calling-from-outlook-with-gmail-chat/</link>
		<comments>http://www.managescope.com/2011/07/new-release-clamr-2010-enables-calling-from-outlook-with-gmail-chat/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 21:18:08 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Clamr!]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Features]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=1132</guid>
		<description><![CDATA[The best calling, texting and file transfer solution for Outlook 2010 just got even better. We&#8217;ve just released a new version of Clamr! 2010 that allows you to use Gmail Chat as your phone for calling! No need for a separate phone number &#8211; e.g. Skype, mobile, desk &#8211; and no reason to leave Outlook [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mail.google.com/mail/help/chat.html"><img class="alignleft size-medium wp-image-1133" style="margin-left: 5px; margin-right: 5px;" title="GMail Chat" src="http://www.managescope.com/wp-content/uploads/2011/07/GMail-Chat-220x300.jpg" alt="" width="220" height="300" /></a>The best calling, texting and file transfer solution for Outlook 2010 just got even better. We&#8217;ve just released a new version of Clamr! 2010 that allows you to use Gmail Chat as your phone for calling! No need for a separate phone number &#8211; e.g. Skype, mobile, desk &#8211; and no reason to leave Outlook 2010 and your keyboard in order to actually take the call.</p>
<p>Download the latest version of <a href="http://www.clamr.com">Clamr! 2010</a> on the Download &amp; Buy page. Install the new client and service. Enable your Gmail Chat (click the photo to go to the Gmail Chat instructions site) and then set your forwarding number in Clamr! 2010 Options to &#8220;Gmail Chat &#8212; username@gmail.com&#8221;.</p>
<p>Now all your calls will be handled with Gmail Chat (for free, we might add) and you can use your computer speakers and microphone to handle your calls.</p>
<p>Also &#8212; for those of you who use non-US date formats locally &#8230; we now support non-US date formats as well.</p>
<p>Enjoy the sweetness of Clamr! And stay tuned as we add more features and functionality &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2011/07/new-release-clamr-2010-enables-calling-from-outlook-with-gmail-chat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with errors &#8230;</title>
		<link>http://www.managescope.com/2010/08/dealing-with-errors/</link>
		<comments>http://www.managescope.com/2010/08/dealing-with-errors/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 16:39:44 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Operations]]></category>
		<category><![CDATA[Organizational Intelligence]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=1029</guid>
		<description><![CDATA[Dealing with error gracefully is the mark of a mature organization. This article is a very interesting discussion with a Google search executive about how Google deals with error from anorganizational and technological perspective.]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-784 alignleft" style="margin-top: 2px; margin-bottom: 2px; margin-left: 5px; margin-right: 5px;" title="Our Motto" src="http://www.managescope.com/wp-content/uploads/2010/06/Our-Motto-150x150.png" alt="" width="150" height="150" /></p>
<p>Dealing with error gracefully is the mark of a mature organization. This <a href="http://www.slate.com/blogs/blogs/thewrongstuff/">article</a> is a very interesting discussion with a Google search executive about how Google deals with error from anorganizational and technological perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2010/08/dealing-with-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Multiple Notifications in SharePoint</title>
		<link>http://www.managescope.com/2010/07/sending-multiple-notifications-in-sharepoint/</link>
		<comments>http://www.managescope.com/2010/07/sending-multiple-notifications-in-sharepoint/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 20:18:31 +0000</pubDate>
		<dc:creator>Carlos Gonzalez</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Operations]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=1010</guid>
		<description><![CDATA[In Sharepoint there are many ways of notifying a user when an item gets updated on a list. 1. Setting up an alert. 2. Subscribing to an RSS Feed. 3. Using workflow via the List Settings, Sharepoint Designer or Visual Studio. All these mechanisms have their pros and cons, but there is one thing that is not supported by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.managescope.com/wp-content/uploads/2010/07/imgres.jpg"><img class="alignright size-full wp-image-1011" title="Sharepoint 2007" src="http://www.managescope.com/wp-content/uploads/2010/07/imgres.jpg" alt="" width="134" height="125" /></a></p>
<p>In Sharepoint there are many ways of notifying a user when an item gets updated on a list.</p>
<p>1. Setting up an alert.</p>
<p>2. Subscribing to an RSS Feed.</p>
<p>3. Using workflow via the List Settings, Sharepoint Designer or Visual Studio.</p>
<p>All these mechanisms have their pros and cons, but there is one thing that is not supported by any of them: Sending a notification to users when they are set up in a multi-choice person list within the SAME list. Additionally, 1 and 2 above require the user to set this up manually on their own, while 3  is much more complicated and has limitations. I chose to write my own Event Receiver in order to accomplish this task.</p>
<p>I won&#8217;t go into the details of creating an Event Receiver in Sharepoint and publishing it, since there is already a lot of documentation on this on the internet. In my example, the List Name is called &#8220;MyDocs&#8221; and the field that contains the users is called &#8220;Notifiers&#8221; (note: this field can contains a multiple users).</p>
<p><span style="font-family: 'Times New Roman'; line-height: normal; font-size: small;"> </span></p>
<pre style="word-wrap: break-word; white-space: pre-wrap;">    public class MyDocsItemEventReceiver : SPItemEventReceiver
    {

        public override void ItemUpdated(SPItemEventProperties properties)
        {
            base.ItemUpdated(properties);
            DisableEventFiring();

            try
            {
                SPListItem myDocsItem = properties.ListItem;
                var notifiers = myDocsItem["Notifiers"] as SPFieldUserValueCollection;
                SendEmailToNotifiers(notifiers);
            }
            finally
            {
                EnableEventFiring();
            }

        }
        private void SendEmailToNotifiers(SPFieldUserValueCollection _notifiers)
        {

            if (_notifiers != null)
            {
                List&lt;string&gt; _notifierList = new List&lt;string&gt;();

                foreach (SPFieldUserValue _notifier in _notifiers)
                {
                    if (!string.IsNullOrEmpty(_notifier.User.Email))
                        _notifierList.Add(_notifier.User.Email.Trim());
                }

                if (_notifierList.Count &gt; 0)
                {
                    SmtpClient _smtpClient = new SmtpClient();
                    _smtpClient.Host = "email_server_name";
                    _smtpClient.Port = 25;
                    _smtpClient.EnableSsl = false;

                    MailMessage _mailMessage = new MailMessage();

                    foreach (string _reviewer in _notifierList)
                    {
                        _mailMessage.To.Add(new MailAddress(_reviewer));
                    }

                    _mailMessage.From = new MailAddress("fromaddress@company.com");
                    _mailMessage.Subject = "the subject line";
                    _mailMessage.Body = "the body of the email";

                    _smtpClient.Send(_mailMessage);
                }
            }

        }
}</pre>
<div id="_mcePaste">You will need to import &#8220;System.Net.Mail&#8221; and get the mail server/port info, but it gives you the basis of accomplishing a very flexible solution for sending emails from an updated list. A possible use is to send notifications from Project Server 2007 when Issues/Risks are updated. The Event Receiver above will send emails to the users that are defined in the list item itself without having to create another list for lookup or managing a sharepoint group which usually required elevated privileges.</div>
<div>Enjoy!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2010/07/sending-multiple-notifications-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharepoint (WSS/MOSS) Auditing VIEW On List Items</title>
		<link>http://www.managescope.com/2009/08/sharepoint-wssmoss-auditing-view-on-list-items/</link>
		<comments>http://www.managescope.com/2009/08/sharepoint-wssmoss-auditing-view-on-list-items/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 01:07:36 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Organizational Intelligence]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=983</guid>
		<description><![CDATA[Recently I had a request from a client to log/audit when a user clicks on anything on a Sharepoint site. At first I thought, this will be easy, I will just turn on Auditing and select to log all VIEWs on all Items and then produce a report based on the Audit log. Well, things [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had a request from a client to log/audit when a user clicks on anything on a Sharepoint site. At first I thought, this will be easy, I will just turn on Auditing and select to log all VIEWs on all Items and then produce a report based on the Audit log. Well, things were not that simple.</p>
<p>It appears that Sharepoint logs VIEWs for Document Libraries very well, but fails miserably for logging VIEWs on every other type of Item, including Picture Libraries (this is true for WSS and MOSS). Basically, Sharepoint logs the List that the Item is contained in, but there is no logging as to the actual Item that was clicked on. So after Googling around bit I found that there was very little information on how to get around this and wanted to post a solution that works for most Items, but still fails for certain ones, e.g. Discussion Items for one. Maybe someone else here can enhance this solution to grab the missing ones.</p>
<p>My solution involves a custom HttpModule (not an HttpHandler), that inspects the IIS requests and if can load the Sharepoint context, Site, List and Item, then it manually adds the Audit Entry via the Sharepoint Object Model. This approach is only needed for non Document Libraries, since the regular Sharepoint Auditing does a better job at logging these types of Items.</p>
<p>The code for the HttpModule is below. You will need to do a bit of research on how to deploy an HttpModule, but there is plenty of information on this on the web. Essentially, you will need to compile this, strong name it, deploy it to the GAC and add an entry to the web.config of the Sharepoint site you wish to Audit.</p>
<p>Enjoy!</p>
<pre>Imports System.Web
Imports Microsoft.SharePoint

Public Class AuditViewHttpModule
    Implements IHttpModule

    Public Sub Dispose() Implements System.Web.IHttpModule.Dispose

    End Sub

    Public Sub Init(ByVal context As System.Web.HttpApplication) _
    Implements System.Web.IHttpModule.Init

        AddHandler context.PreRequestHandlerExecute, _
        AddressOf Application_PreRequestHandlerExecute
    End Sub

    Private Sub Application_PreRequestHandlerExecute( _
        ByVal _source As Object, ByVal e As EventArgs)

        Dim _application As HttpApplication = Nothing
        Dim _context As HttpContext = Nothing

        Try

            _application = CType(_source, HttpApplication)
            _context = _application.Context

            Dim _site As SPSite = SPContext.Current.Site
            Dim _list As SPList = SPContext.Current.List
            Dim _item As SPListItem = SPContext.Current.ListItem

            If Not _site Is Nothing Then
                If Not _list Is Nothing Then
                    If Not _item Is Nothing Then
                        If _
                        _list.BaseTemplate &lt;&gt; _
                        SPListTemplateType.DocumentLibrary _
                        Then

                            _list.Audit.WriteAuditEvent( _
                            SPAuditEventType.View, "", "")
                        End If
                    End If
                End If
            End If

        Catch ex As Exception
            ' handle the error otherwise your
            ' sharepoint pages will crash!
        End Try
    End Sub

End Class</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2009/08/sharepoint-wssmoss-auditing-view-on-list-items/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Xceed DataGrid WPF Mouse Single Click Event</title>
		<link>http://www.managescope.com/2009/05/xceed-datagrid-wpf-mouse-single-click-event/</link>
		<comments>http://www.managescope.com/2009/05/xceed-datagrid-wpf-mouse-single-click-event/#comments</comments>
		<pubDate>Fri, 29 May 2009 01:10:45 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Xbap]]></category>
		<category><![CDATA[Xceed]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=988</guid>
		<description><![CDATA[Have you been trying to find the event that fires when you select a single record from the Xceed DataGrid? It doesn’t exist! You can play around with the MouseDown event a bit, but it doesn’t quite do the trick since this fires when the scrollbar is pressed and has some other weird side effects. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you been trying to find the event that fires when you select a single record from the Xceed DataGrid? It doesn’t exist! You can play around with the MouseDown event a bit, but it doesn’t quite do the trick since this fires when the scrollbar is pressed and has some other weird side effects. Other Events are worse.</p>
<p>Our developers (including myself) were banging our head up against the wall with this problem until we found a pretty reliable way of capturing when the user single clicks on a record on the DataGrid. I cannot answer why most WPF controls don’t have the Mouse Single Click Event, but this functionality should have been better exposed since it has so many useful applications.  This one is a gem, so please comment if you found this article useful in your project.</p>
<p>Enjoy!</p>
<pre>Private Sub myDataGridControl_PropertyChanged _
(ByVal sender As Object, _
ByVal e As System.ComponentModel.PropertyChangedEventArgs)
Handles myDataGridControl.PropertyChanged

    If e.PropertyName = "GlobalSelectedItems" Then
        'myDataGridControl.SelectedItem was clicked!
    End If

End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2009/05/xceed-datagrid-wpf-mouse-single-click-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xceed DataGrid WPF Object Data Binding</title>
		<link>http://www.managescope.com/2009/04/xceed-datagrid-wpf-object-data-binding/</link>
		<comments>http://www.managescope.com/2009/04/xceed-datagrid-wpf-object-data-binding/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 01:19:43 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Xbap]]></category>
		<category><![CDATA[Xceed]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=995</guid>
		<description><![CDATA[Many of the examples that are provided for the Xceed DataGrid involve binding directly to a database table source, so I wanted to give an example of how easy it is to bind to an Object. Xceed DataGrid makes excellent use of the WPF binding and thus only needs it’s ItemsSource property to be set [...]]]></description>
			<content:encoded><![CDATA[<p>Many of the examples that are provided for the Xceed DataGrid involve binding directly to a database table source, so I wanted to give an example of how easy it is to bind to an Object. Xceed DataGrid makes excellent use of the WPF binding and thus only needs it’s ItemsSource property to be set to a data source that implements IEnumerable.</p>
<p>Guess what? By default, all Generic Lists in the .Net framework are compatible data sources. To show how easy it is to bind the Xceed datagrid to a Generic List of Objects, I have created a sample project (which you can <a href="http://www.managescope.com/downloads/XceedTest.zip" target="_self">download</a>) that does essentially 3 things:</p>
<p>1. Declares a class named: MyRecord with 4 public properties (First, Last, Title and Phone).<br />
2. Defines a function that creates a Generic List of MyRecord objects, sets temp data for each object and returns the new Generic List of MyRecord objects.<br />
3. In the New() method of the Window that contains the DataGrid, we simply set the ItemsSource to the Generic List of MyRecord objects.</p>
<p>Enjoy!</p>
<pre>Class Window1 

    Public Sub New()

        InitializeComponent()

        DataGridControl1.ItemsSource = GetMyRecords()

    End Sub

    Private Function GetMyRecords() As List(Of MyRecord)
        Dim MyRecords As New List(Of MyRecord)

        Dim _myRecord As MyRecord

        _myRecord = New MyRecord
        _myRecord.First = "Carlos"
        _myRecord.Last = "Gonzalez"
        _myRecord.Title = "Managing Director"
        _myRecord.Phone = "213-555-1212"
        MyRecords.Add(_myRecord)

        _myRecord = New MyRecord
        _myRecord.First = "Vivien"
        _myRecord.Last = "Dracon"
        _myRecord.Title = "Managing Director"
        _myRecord.Phone = "213-777-1212"
        MyRecords.Add(_myRecord)

        _myRecord = New MyRecord
        _myRecord.First = "John"
        _myRecord.Last = "Doe"
        _myRecord.Title = "Developer"
        _myRecord.Phone = "213-111-1212"
        MyRecords.Add(_myRecord)

        _myRecord = New MyRecord
        _myRecord.First = "Jane"
        _myRecord.Last = "Doe"
        _myRecord.Title = "Sales"
        _myRecord.Phone = "213-999-1212"
        MyRecords.Add(_myRecord)

        _myRecord = New MyRecord
        _myRecord.First = "Bill"
        _myRecord.Last = "Gates"
        _myRecord.Title = "Retired"
        _myRecord.Phone = "213-222-1212"
        MyRecords.Add(_myRecord)

        Return MyRecords
    End Function

    Private Class MyRecord
        Private _first As String
        Private _last As String
        Private _title As String
        Private _phone As String

        Public Property First()
            Get
                Return _first
            End Get
            Set(ByVal value)
                _first = value
            End Set
        End Property

        Public Property Last()
            Get
                Return _last
            End Get
            Set(ByVal value)
                _last = value
            End Set
        End Property

        Public Property Title()
            Get
                Return _title
            End Get
            Set(ByVal value)
                _title = value
            End Set
        End Property

        Public Property Phone()
            Get
                Return _phone
            End Get
            Set(ByVal value)
                _phone = value
            End Set
        End Property
    End Class

End Class</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2009/04/xceed-datagrid-wpf-object-data-binding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sharepoint/WSS &#8211; Getting a list of files in a folder</title>
		<link>http://www.managescope.com/2009/03/sharepointwss-getting-a-list-of-files-in-a-folder/</link>
		<comments>http://www.managescope.com/2009/03/sharepointwss-getting-a-list-of-files-in-a-folder/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 01:22:50 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=999</guid>
		<description><![CDATA[Recently I had a request from a client to upload a random set of files on a user’s desktop folder into a SharePoint folder. This part of it was not tricky since you can use the System.Net.WebClient.UploadFile() method to accomplish the task. The problem I encountered was that the UploadFile() method does not check for [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had a request from a client to upload a random set of files on a user’s desktop folder into a SharePoint folder. This part of it was not tricky since you can use the System.Net.WebClient.UploadFile() method to accomplish the task. The problem I encountered was that the UploadFile() method does not check for an existing file with the same name on the specified SharePoint folder.</p>
<p>For this reason, I created a custom function that returns to me the list of files in a SharePoint Folder. I could then use this to warn the user if a file with the same name already exists on the SharePoint folder and have him/her take a manual action.  The function uses the SharePoint List Web Service GetListItems() method and parses the XML in order to get the files in the folder queried.</p>
<p>Enjoy!</p>
<pre>
<div id="_mcePaste"><span style="font-family: 'Times New Roman'; line-height: normal; white-space: normal; font-size: small;">
<pre style="word-wrap: break-word; white-space: pre-wrap;">Private Function GetListOfFilesInSPFolder(ByVal listsWS As WebSvcLists.Lists, _
         ByVal folderPath As String) As List(Of String)
        Dim _files As List(Of String) = New List(Of String)

        ' set up xml  doc for getting list of files under a folder
        Dim doc As XmlDocument = New XmlDocument()
        Dim queryOptions As XmlElement = doc.CreateElement("QueryOptions")
        queryOptions.InnerXml = "&lt;Folder&gt;" &amp; folderPath &amp; "&lt;/Folder&gt;"

        ' get the list of files
        Dim listItemsNode As XmlNode = listsWS.GetListItems( _
        WssDocumentLibraryRootFolder, Nothing, _
        Nothing, Nothing, Nothing, queryOptions, Nothing)

        Dim xmlResultsDoc As XmlDocument = New XmlDocument()
        xmlResultsDoc.LoadXml(listItemsNode.OuterXml)
        Dim ns As XmlNamespaceManager = New XmlNamespaceManager(xmlResultsDoc.NameTable)
        ns.AddNamespace("z", "#RowsetSchema")

        For Each row As XmlNode In xmlResultsDoc.SelectNodes("//z:row", ns)
            _files.Add(row.Attributes("ows_LinkFilename").Value)
        Next

        Return _files
End Function</pre>
<p></span></div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2009/03/sharepointwss-getting-a-list-of-files-in-a-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate Certificate Install for XBAP Applications</title>
		<link>http://www.managescope.com/2009/03/automate-certificate-install-for-xbap-applications/</link>
		<comments>http://www.managescope.com/2009/03/automate-certificate-install-for-xbap-applications/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 00:57:16 +0000</pubDate>
		<dc:creator>ManageScope</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Xbap]]></category>

		<guid isPermaLink="false">http://www.managescope.com/?p=973</guid>
		<description><![CDATA[An XBAP application is a WPF application that is targeted to work under the security sandbox within a browser. Because of these restrictions, there is very little you can do to interact with the local computer running the code or even access other web services outside of your main server. XBAP gets around this by [...]]]></description>
			<content:encoded><![CDATA[<p>An XBAP application is a WPF application that is targeted to work under the security sandbox within a browser. Because of these restrictions, there is very little you can do to interact with the local computer running the code or even access other web services outside of your main server. XBAP gets around this by allowing you to mark your application as full or partial trust. The following post gives a pretty good overview of how to set up a project to do this:</p>
<h4>Setup XBAP Project Full Trust</h4>
<p>Although this all works, the part of setting up the user’s browser to accept the trust needed by your application is a bit complicated for the average user to follow. For this reason, I wanted to provide a bit of source code that you can use to create an automated program to install the required certificate on the user’s computer.</p>
<p>All that you have to do is place the pfx file you created via Visual Studio on a server that your users will have access to. The user will only need to download a zip file that contains an executable and run it. This executable will automate the work of installing your certificate on their computer which should make your application richer with full trust and make the barrier of entry for a novice user to start using your XBAP application a lot lower.</p>
<p>Enjoy!</p>
<pre>using System;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Windows.Forms;

namespace CertInstall
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //we will use the web client to download the pfx file
//from the server for installation on the local machine
                WebClient webClient = new WebClient();

                // if you need to pass credentials, this is how you do that
                //webClient.Credentials =
new System.Net.NetworkCredential("username", "password");

                byte[] certBytes =
webClient.DownloadData("http://HostName/TheCertKey.pfx");

                if (certBytes.Length &gt; 0)
                {
                    Console.WriteLine("Begin ....");
                    createCert(StoreName.TrustedPublisher, certBytes);
                    createCert(StoreName.Root, certBytes);
                    createCert(StoreName.My, certBytes);
                    Console.WriteLine("Finished ....");
                }
                else
                {
                    Console.WriteLine("error.");
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + Environment.NewLine +
ex.StackTrace);
            }
        }

        private static void createCert(StoreName storageName,
byte[] certBytes)
        {
            // this is the password you used for the pfx file
//when you created it
            X509Certificate2 cert =
new X509Certificate2(certBytes, "pfxpassword");
            X509Store store =
new X509Store(storageName, StoreLocation.CurrentUser);
            store.Open(OpenFlags.MaxAllowed);
            store.Add(cert);
            store.Close();
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.managescope.com/2009/03/automate-certificate-install-for-xbap-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

