Home

This document is a cache from http://www.spidertg.com/cmsv5/images/stories/eBook_Libarary/Developer/Putting%20SharePoint%20to%20Work%20for%20You.pdf


Putting Share Point toWorkfor You

Document source : www.spidertg.com


The configuration program uses the names of the Site Collection and Document Library as input parameters and
gives you the ability to configure the Audit level of each individual document in the Library.
The OnLoad event in the program calls a routine that uses the names of Site Collection and Library to fill the
Document ComboBox. Bear in mind that the code is only to explain the concepts of Audit programming and it is
not sufficient for production code (doesn't have any type of validation of try/catch statements, for example).
The possible event types can be found in the SPAuditMaskType enumeration, and using a loop can be displayed
onscreen:
for (int
intCounter = 0; intCounter <
Enum.GetNames(typeof(SPAuditMaskType)).Count();
intCounter++)
{
clbAudit.Items.Add(Enum.GetNames(typeof(SPAuditMaskType))
.ElementAt(intCounter));
}
'clbAudt' is a control of the type 'System.Windows.Forms.CheckedListBox'. When one document has been chosen,
the change event of the ComboBox calls the routine to read all the selected Audits and to show them onscreen:
SPSite mySite = new SPSite(txtMySiteURL.Text);
SPWeb myWeb = mySite.OpenWeb();
SPList myList = myWeb.Lists[txtLibraryName.Text];
SPListItem myItem = myList.Items.GetItemById(Convert.ToInt32
(ddlDocs.SelectedIndex + 1));
if ((int)myItem.Audit.AuditFlags == -1)
{
clbAudit.SetItemChecked(0, true);
}
else
{
string myAuditBin = DecimalToBin((int)myItem.Audit.AuditFlags);
if (string.IsNullOrEmpty(myAuditBin) == false)
{
for (int intCounter = myAuditBin.ToString().Length - 1;
intCounter >= 0; intCounter--)
{
int myInversor = myAuditBin.ToString().Length -
intCounter;
if (myAuditBin.ToString().Substring(intCounter, 1) == "1"
)
clbAudi.SetItemChecked(myInversor, true);
}
}
else
clbAudit.SetItemChecked(15, true);
}
After creating the objects to contain the Site, Web, Listm and Document information, the 'AuditFlags' property
10
Putting SharePoint to Work for You, an Internet.com Developer eBook. Copyright 2008, Jupitermedia Corp.
Putting SharePoint to Work for You
[
]







Summary :

The configuration program uses the names of the Site Collection and Document Library as input parameters and gives you the ability to configure the Audit level of each individual document in the Library. if (string.IsNullOrEmpty(myAuditBin) == false) { for (int intCounter = myAuditBin.ToString().Length - 1;


Tags : intcounter,document,library,int,true,site,eent,audit,collection,putting,else,names,combobox





Terms    |    Link pdf-search-files.com    |    Site Map
   |    Content Removal Notice   
   |    Contact   

All books are the property of their respective owners.
Please respect the publisher and the author for their creations if their books copyrighted