What are the various class files that are being used in SharePoint?

Visual Web Parts
  • Derived: System.Web.UI.UserControl
  • Imports: Microsoft.SharePoint / Microsoft.SharePoint.WebControls
Web Parts
  • Derived: System.Web.UI.WebControls.WebParts.WebPart
  • Imports: Microsoft.SharePoint / Microsoft.SharePoint.WebControls
  • Methods:
    • protected override void CreateChildControls()
      This method is used to create the controls to be displayed
    • public override void RenderControl(HtmlTextWriter writer)
      This method is used to render the controls within the page
Mobile Web Parts
  • Derived: Microsoft.SharePoint.WebPartPages.WebPartMobileAdapter
  • Imports: Microsoft.SharePoint / Microsoft.SharePoint.WebControls / Microsoft.SharePoint.WebPartPages
  • Methods:
    • protected override void CreateControlsForSummaryView()
      This method is used to create and render the controls within the mobile view page
Timer Jobs
  • Derived: Microsoft.SharePoint.Administration.SPJobDefinition
  • Imports: Microsoft.SharePoint / Microsoft.SharePoint.Administration
  • Methods:
    • public < classname >() : base()
    • public < classname >(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType)
    • public < classname >(string jobName, SPWebApplication webApplication) : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)
    • public override void Execute(Guid contentDbIds)
      This method is used to write the code that will be executed when the timer job is called.
Feature.EventReceiver
  • Derived: Microsoft.SharePoint.SPFeatureReceiver
  • Imports: Microsoft.SharePoint / Microsoft.SharePoint.Administration / Microsoft.SharePoint.Security
  • Methods: (the first two methods are generally used)
    • public override void FeatureActivated(SPFeatureReceiverProperties properties)
      This method is called when the feature is activated and used to initialize the timer job and create the schedule which can be either SPWeeklySchedule, SPDailySchedule, SPMonthlySchedule, SPYearlySchedule, SPHourlySchedule, SPMinuteSchedule.
    • public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
      This method is called when the timer job is being deactivated so that the instance of the timer job is deleted
    • public override void FeatureInstalled(SPFeatureReceiverProperties properties)
    • public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
    • public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)
Event Receivers
  • Derived: SPListEventReceiver / SPItemEventReceiver
  • Imports: Microsoft.SharePoint
  • Methods:
  • public override void ItemAdded(SPItemEventProperties properties)
Use of Microsoft.SharePoint.Utilities class
  • SPUtility.SendEmail()
  • SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime)
    • The method takes a DateTime parameter and returns the date in the format to be used in the CAML query
Use of FullTextSqlQuery class
  • Imports: Microsoft.Office.Server / Microsoft.Office.Server.Search / Microsoft.Office.Server.Search.Query
    • // Generating the fulltextsqlquery //
    • FullTextSqlQuery sqlQuery = new FullTextSqlQuery(spSite);
    • sqlQuery.QueryText = searchQuery.Trim();
    • sqlQuery.ResultTypes = ResultType.RelevantResults;
    • sqlQuery.RowLimit = 500;

    • // Getting the search results //
    • ResultTableCollection resultCollection = sqlQuery.Execute();
    • ResultTable resultTable = resultCollection[ResultType.RelevantResults];
    • dt.Load(resultTable, LoadOption.OverwriteChanges);
Use of UserProfileManager class
  • Imports: Microsoft.Office.Server / Microsoft.Office.Server.UserProfiles
    • UserProfileManager profileManager = new UserProfileManager(context); 
    • //Loop through all the user profiles 
    • foreach (UserProfile currentProfile in profileManager) 
    •      //There is always a display name 
    •      resultsLabel.Text += "User: " + currentProfile.DisplayName + "<br />"; 
    •      //Be careful to avoid null errors 
    •      if (currentProfile["Department"].Value != null) 
    •      { 
    •            //There is a department listed so display it 
    •            resultsLabel.Text += "Department: " + currentProfile["Department"].Value.ToString() + "<br /><br />"; 
    •      }

Comments

Popular posts from this blog

jQuery Basics

What is the difference between a Page Layout and Master Page in SharePoint?

Accessing data from SharePoint 2010 to an ASP.NET application