Framework Libraries

Sidvall.* projects are Framework libraries that are used by the generated code. Sidvall.dll is a portable library that enables base functionality.

  1: // File Management
  2: var files = Sidvall.SystemContext.Current.FileSystemManager.GetFilesAsync(@"c:\", null, IO.SearchOption.AllDirectories, true);
  3: // Mail Management
  4: Sidvall.SystemContext.Current.SmtpClientManager.Send(new string[] { "mailaddress1" }, "Subject", "Body", false);
  5: // Serialization
  6: var json = Sidvall.Serialization.SerializerManager.Current.SerializeObject(files);
  7: // Global Cache
  8: Sidvall.SystemContext.Current.CacheManager.AddOrUpdate("key", 5, "region", new System.TimeSpan(1000));
  9: // REST client
 10: var restClient = Sidvall.SystemContext.Current.HttpClientFactory.GetHttpClient();
 11: var response = await restClient.GetAsync("url");
 12: // SOAP client
 13: var soapClient = Sidvall.SystemContext.Current.SoapClientFactory.GetSoapClient();
 14: response = await soapClient.SendSoapAsync("url", "content", "action");
 15: // Transaction
 16: using (var transaction = Sidvall.SystemContext.Current.TransactionScopeFactory.GetTransactionScope())
 17: {
 18:   transaction.Complete();
 19: }
 20: // Authentication
 21: var authenticationClient = Sidvall.SystemContext.Current.AuthenticationManager.GetAuthenticationClient("STS address");
 22: var token = await authenticationClient.RequestResourceOwnerPasswordAsync("username", "password");
 23: // Log on dialog
 24: var authorizeResponse = Sidvall.UI.SystemContext.Current.DialogManager.LogOn("STS address", "ClientId", "response type", "ClientRedirectAddress", "scopes",
 25:   "state", "nonce", "logOnHint", "authenticationContextReferences", "responseMode", null);
 26: // Authorization
 27: var principal = Sidvall.SystemContext.Current.PrincipalProvider.CurrentPrincipal;
 28: var isAuthorized = Sidvall.SystemContext.Current.AuthorizationManager.IsAuthorized(principal, "resource", "action");
 29: isAuthorized = await Sidvall.SystemContext.Current.AuthorizationManager.IsAuthorizedAsync(principal, "resource", "action", null, "resource item id");
 30: // Logging
 31: Sidvall.SystemContext.Current.LogManager.Write("Message", Sidvall.Logging.LogCategories.WebApi, Logging.EventType.Information, "info");
 

Last edited Feb 18, 2015 at 9:29 AM by sidwall, version 6