Tutorial by Examples: ga

ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); GroupCollection collGroup = clientContext.Web.SiteGroups; Group oGroup = collGroup.GetById(7); UserCollection collUser = oGroup.Users; clientContext.Load(collUser); clientContext.ExecuteQuer...
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); GroupCollection collGroup = clientContext.Web.SiteGroups; clientContext.Load(collGroup); clientContext.Load(collGroup, groups => groups.Include( group => group.Users)); ...
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection "); GroupCollection collGroup = clientContext.Web.SiteGroups; Group oGroup = collGroup.GetById(6); UserCreationInformation userCreationInfo = new UserCreationInformation(); userCreationInfo.Email ...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); Web oWebsite = clientContext.Web; BasePermissions permissions = new BasePermissions(); permissions.Set(PermissionKind.CreateAlerts); permissions.Set(PermissionKind.ManageAlerts); RoleDefi...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection/MyWebSite"); Web oWebsite = clientContext.Web; Principal oUser = oWebsite.SiteUsers.GetByLoginName(@"DOMAIN\alias"); RoleDefinition oRoleDefinition = oWebsite.RoleDefinitions.GetByName...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection/MyWebSite"); Web oWebsite = clientContext.Web; GroupCreationInformation groupCreationInfo = new GroupCreationInformation(); groupCreationInfo.Title = "My New Group"; groupCreationInfo.D...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("MyList"); int itemId = 3; ListItem oListItem = oList.Items.GetById(itemId); oListItem.BreakRoleInheritance(false); User oUser = clientContext.Web.SiteUsers.GetByLoginNam...
string urlWebsite = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(urlWebsite); Web oWebsite = clientContext.Web; List oList = oWebsite.Lists.GetByTitle("My List"); UserCustomActionCollection collUserCustomAction = oList.UserCustom...
string urlWebsite = "http://MyServer/sites/SiteCollection"; ClientContext clientContext = new ClientContext(urlWebsite); Web oWebsite = clientContext.Web; List oList = oWebsite.Lists.GetByTitle("My List"); UserCustomActionCollection collUserCustomAction = oList.UserCustomAc...
string urlWebsite = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(urlWebsite); Web oWebsite = clientContext.Web; UserCustomActionCollection collUserCustomAction = oWebsite.UserCustomActions; UserCustomAction oUserCustomAction = collUserCu...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); File oFile = oClientContext.Web.GetFileByServerRelativeUrl("Default.aspx"); LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(PersonalizationScope.Shared); ...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); File oFile = oClientContext.Web.GetFileByServerRelativeUrl("/sites/MySiteCollection/SitePages/Home.aspx "); LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(P...
In the most basic form, it is possible to select a single variable from a table by calling the object's get_var method passing in an SQL query. global $wpdb; $user = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE user_email='[email protected]'" ); It is very important to note that...
To create a Grails application, use the grails create-app command. The following command creates a Grails application, named myapp in the current directory: grails create-app fancy-app Running it, is as simple as visiting the, newly created, application directory: cd fancy-app and then grai...
Initializing std::array<T, N>, where T is a scalar type and N is the number of elements of type T If T is a scalar type, std::array can be initialized in the following ways: // 1) Using aggregate-initialization std::array<int, 3> a{ 0, 1, 2 }; // or equivalently std::array<int, 3...
Bad Example: var location = dbContext.Location .Where(l => l.Location.ID == location_ID) .SingleOrDefault(); return location; Since the above code is simply returning an entity without modifying or adding it, we can avoid tracking cost. Good Ex...
assert ['cat', 'dog', 'fish']*.length() == [3, 3, 4] Note that when mixing types in the collection if the method not exists on some of the elements, a groovy.lang.MissingMethodException could be thrown: ['cat', 'dog', 'fish',3]*.length() // it throws groovy.lang.MissingMethodException: No sign...
class Vector { double x double y } def points = [ new Vector(x: 10, y: -5), new Vector(x: -17.5, y: 3), new Vector(x: -3.3, y: -1) ] assert points*.x == [10, -17.5, -3.3] Note: The * is optional. We could also write the above statement as in the below line and Groov...
To run a command in a shell, in which you required buffered output (i.e. it is not a stream), use child_process.exec. For example, if you wanted to run the command cat *.js file | wc -l, with no options, that would look like this: const exec = require('child_process').exec; exec('cat *.js file | w...
If you are looking to run a file, such as an executable, use child_process.execFile. Instead of spawning a shell like child_process.exec would, it will directly create a new process, which is slightly more efficient than running a command. The function can be used like so: const execFile = require(...

Page 43 of 137