Wednesday, May 16, 2012

Gadget Style WPF Application

I just made this from a Channel 9 Training Video.

Type Here

Code Behind:
Class Window1

Private Sub Window1_MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
End Sub

Private Sub CloseButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles CloseButton.Click
End Sub
End Class

Delete entire SharePoint List Items (VB.NET)

A small problem that i faced, was to delete an entire SPList Items.
Here is the solution.

'Get Context
Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
'Open Web
Dim wb As SPWeb = siteCollection.OpenWeb()
'Get List
Dim spl As SPList = wb.GetList(wb.Url.ToString + "/Lists/YourListNameToDeleteItems")
spl.AllowDeletion = True
    While spl.Items.Count > 0
    End While
'"Update Delete for list items"
Catch ex As Exception
End Try

SOLID Principle

S.O.L.I.D stands for: When expanded the acronyms might seem complicated, but they are pretty simple to grasp. S - Single-responsiblity...