Tags » .NET

Delegates

When learning about a new technique/tool, I think is it is important to ask the following questions:

  1. Why i.e. what problem does this technique I’m trying to learn about solve?
  2. 536 more words
.NET

Delegates and Events series

For a very long time, I have been what JP Boodhoo describes as being a “consumer developer” i.e. I’ve been using frameworks e.g. ASP.NET MVC, Castle Windsor, etc and generally programming at a “high level of abstraction”. 136 more words

.NET

Exchange ActiveSync

Exchange ActiveSync devices can be configures to allow users to work in remote locations with high-latency or low-bandwidth networks. It allows users to access and reply to email messages and access calendars even when they are offline. 17 more words

SharePoint

ng-grid selected row does not clear on refreshing grid data

To resolve this, i have done it this way for now:

Snippet

$scope.getFileContent();
                        $timeout(function() { $(".selected").removeClass("selected");
                        $scope.selectedItems = [];
            }, 1);
But the issue with this is that thought the css is clearing out fine, meaning that the selected row gets deselected, but the selected items array does not get cleaned up....so this is clearly not the right solution
.net

Change SharePoint group permissions from code

Is not especially elegant, just “quick and dirty” :)

public static void ChangePermissions(SPSecurableObject subject, SPPrincipal principal, SPRoleType roleType)
{
    SPRoleDefinition roleDefinition = null;
    SPRoleAssignment roleAssignment = subject.RoleAssignments.GetAssignmentByPrincipal(principal);

    if (roleAssignment != null && subject != null)
    {
        switch (subject.GetType().Name)
        {
            case "SPList":
                if (!((SPList)subject).HasUniqueRoleAssignments)
                    ((SPList)subject).BreakRoleInheritance(true,false);
                roleDefinition = ((SPList)subject).ParentWeb.RoleDefinitions.GetByType(roleType);
                break;
            case "SPWeb":
                if (!((SPWeb)subject).HasUniqueRoleAssignments)
                    ((SPWeb)subject).BreakRoleInheritance(true, false);
                roleDefinition = ((SPWeb)subject).RoleDefinitions.GetByType(roleType);
                break;
            case "SPItem":
                if (!((SPItem)subject).HasUniqueRoleAssignments)
                    ((SPItem)subject).BreakRoleInheritance(true, false);
                roleDefinition = ((SPItem)subject).Fields.List.ParentWeb.RoleDefinitions.GetByType(roleType);
                break;
            case "SPListItem":
                if (!((SPListItem)subject).HasUniqueRoleAssignments)
                    ((SPListItem)subject).BreakRoleInheritance(true, false);
                roleDefinition = ((SPListItem)subject).Fields.List.ParentWeb.RoleDefinitions.GetByType(roleType);
                break;
            default:
                break;
        }

        if (roleDefinition != null)
        {
            roleAssignment.RoleDefinitionBindings.RemoveAll();
            roleAssignment.RoleDefinitionBindings.Add(roleDefinition);
            roleAssignment.Update();
        }
    }
}
… 73 more words
SharePoint

Born2Run

It is e-commerce site, where it presents uniquely designed right shoe, the B2R training system is a proven combination of Footwear, Strength Training, Run Programs, and Nutrition. 35 more words

.Net