We developed an ItemEventReceiver to do somthing whenever a list item is added to a list.
In order to register this ItemEventReceiver to a list I created a WinForm application that should run on the MOSS and should register the ItemEventReceiver assembly to the list.
The application has the abbility to add the ItemEventReceiver assembly to any of the list item's available Event Types.
This is a quite simple application:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint;
namespace MOSSListEventRegister
{
public partial class MOSSListEventRegisterForm : Form
{
public MOSSListEventRegisterForm()
{
InitializeComponent();
}
private void MOSSListEventRegisterForm_Load(object sender, EventArgs e)
{
//Fill EventReceiverTypeCheckedListBox
EventReceiverTypeCheckedListBox.Items.Add("ItemAdded");
EventReceiverTypeCheckedListBox.Items.Add("ItemAdding");
EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentAdded");
EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentAdding");
EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentDeleted");
EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentDeleting");
EventReceiverTypeCheckedListBox.Items.Add("ItemCheckedIn");
EventReceiverTypeCheckedListBox.Items.Add("ItemCheckedOut");
EventReceiverTypeCheckedListBox.Items.Add("ItemCheckingIn");
EventReceiverTypeCheckedListBox.Items.Add("ItemCheckingOut");
EventReceiverTypeCheckedListBox.Items.Add("ItemDeleted");
EventReceiverTypeCheckedListBox.Items.Add("ItemDeleting");
EventReceiverTypeCheckedListBox.Items.Add("ItemUpdated");
EventReceiverTypeCheckedListBox.Items.Add("ItemUpdating");
}
private void RegisterButton_Click(object sender, EventArgs e)
{
SPSite site = null;
SPWeb web = null;
SPList myList = null;
try
{
site = new SPSite(SiteURLTextBox.Text);
web = site.OpenWeb();
myList = web.Lists[ListsNameComboBox.SelectedText];
for (int i = 0; i < EventReceiverTypeCheckedListBox.Items.Count; i++)
{
switch (EventReceiverTypeCheckedListBox.Items.ToString())
{
case "ItemAdded":
myList.EventReceivers.Add(SPEventReceiverType.ItemAdded, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemAdding":
myList.EventReceivers.Add(SPEventReceiverType.ItemAdding, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemAttachmentAdded":
myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentAdded, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemAttachmentAdding":
myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentAdding, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemAttachmentDeleted":
myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentDeleted, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemAttachmentDeleting":
myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentDeleting, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemCheckedIn":
myList.EventReceivers.Add(SPEventReceiverType.ItemCheckedIn, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemCheckedOut":
myList.EventReceivers.Add(SPEventReceiverType.ItemCheckedOut, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemCheckingIn":
myList.EventReceivers.Add(SPEventReceiverType.ItemCheckingIn, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemCheckingOut":
myList.EventReceivers.Add(SPEventReceiverType.ItemCheckingOut, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemDeleted":
myList.EventReceivers.Add(SPEventReceiverType.ItemDeleted, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemDeleting":
myList.EventReceivers.Add(SPEventReceiverType.ItemDeleting, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemUpdated":
myList.EventReceivers.Add(SPEventReceiverType.ItemUpdated, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
case "ItemUpdating":
myList.EventReceivers.Add(SPEventReceiverType.ItemUpdating, AssemblyNameTextBox.Text, ClassNameTextBox.Text);
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (site != null)
{
site.Close();
site = null;
}
if (web != null)
{
web.Close();
web = null;
}
}
}
private void GetListsButton_Click(object sender, EventArgs e)
{
SPSite site = null;
SPWeb web = null;
SPList myList = null;
try
{
ListsNameComboBox.Items.Clear();
site = new SPSite(SiteURLTextBox.Text);
web = site.OpenWeb();
foreach (SPList lst in web.Lists)
{
if (!lst.Hidden )
ListsNameComboBox.Items.Add(lst.Title);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (site != null)
{
site.Close();
site = null;
}
if (web != null)
{
web.Close();
web = null;
}
}
}
}
}
Subscribe to RSS Feed
25 comments:
Hi,
The tool seems very interesting, but i am facing problem in creating the ItemReceiverEvent. It will be very helpful if you can send me a code for developing ItemReceiverEvent.
My Code looks like :
public class test : SPItemEventReceiver
{
public override void ItemAdding(SPItemEventProperties properties)
{
SPWeb web = properties.OpenWeb();
Guid ListID = properties.ListId;
int ListItemID = properties.ListItemId;
SPListItem projects = web.Lists[ListID].GetItemById(ListItemID);
string ProjectType = Convert.ToString(projects["ProjectType"]);
if (ProjectType != "Developmant")
{
properties.ErrorMessage = "Some Error";
properties.Cancel = true;
return;
} } }
Hi,
The tool seems very interesting, but i am facing problem in creating the ItemReceiverEvent. It will be very helpful if you can send me a code for developing ItemReceiverEvent.
My Code looks like :
public class test : SPItemEventReceiver
{
public override void ItemAdding(SPItemEventProperties properties)
{
SPWeb web = properties.OpenWeb();
Guid ListID = properties.ListId;
int ListItemID = properties.ListItemId;
SPListItem projects = web.Lists[ListID].GetItemById(ListItemID);
string ProjectType = Convert.ToString(projects["ProjectType"]);
if (ProjectType != "Developmant")
{
properties.ErrorMessage = "Some Error";
properties.Cancel = true;
return;
} } }
Where can i download your nice application?
Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!
An Unreleased Lady GaGa Track was Found this evening with no traces of where it came from.
Some say that it was leaked from GaGa's Record Label's headquarters.
More info at http://ladygagaunreleased.blogspot.com
Free Download of the single at http://tinyurl.com/gagaunreleased
[url=http://tinyurl.com/getvpn][b]Click here to get VPN service![/b][/url]
[b]Anonymous surfing[/b]
Using our service you'll be fully anonymous in the Internet. Hide your IP address, and nobody will know that strange visitor from Germany ( Great Britain, Estonia and so ), is you.
[b]Full access to network[/b]
You can use any services, access any sites and use any software with us. BitTorrent, Skype, Facebook, MySpace, Twitter, Pocker .. we have no restrictions.
[b]Traffic protection[/b]
Don't worry, from this moment all you data will be protected using 256 bit Blowfish encryption algorithm. Nobody can access your internet data.
[b]Wide variety of countries[/b]
You can choose one of over twenty high speed servers located in different parts of the world, from South America coast to islands in Indian Ocean.
Related keywords:
anonymous surfing review
proxy server vpn
anonymous secure surfing
proxy vpn
anonymous vpn free
internet explorer vpn
vpn dial up
ssl vpn
Traffic protection
anonymous surfing freeware
anonymous surfing software
vtunnel
anonymous surfing vpn
best anonymous browser
surf the web anonymous
best anonymous surfing
anonymizer anonymous surfing review
firefox anonymous surfing
Virtual Private Networks
Free Vpn Client Software
anonymous surfing software
[url=http://dasbmw.ru] anonymous surfing software[/url]
[url=http://seobraincenter.ru] anonymous proxy[/url]
[url=http://carlwebster.com/members/Alexander-Pwnz.aspx]Buy Cheap Zoloft[/url]
[url=http://tinyurl.com/getvpn][b]Click here to get VPN service![/b][/url]
[b]Anonymous surfing[/b]
Using our service you'll be fully anonymous in the Internet. Hide your IP address, and nobody will know that strange visitor from Germany ( Great Britain, Estonia and so ), is you.
[b]Full access to network[/b]
You can use any services, access any sites and use any software with us. BitTorrent, Skype, Facebook, MySpace, Twitter, Pocker .. we have no restrictions.
[b]Traffic protection[/b]
Don't worry, from this moment all you data will be protected using 256 bit Blowfish encryption algorithm. Nobody can access your internet data.
[b]Wide variety of countries[/b]
You can choose one of over twenty high speed servers located in different parts of the world, from South America coast to islands in Indian Ocean.
Related keywords:
anonymous surfing review
proxy server vpn
anonymous secure surfing
proxy vpn
anonymous vpn free
internet explorer vpn
vpn dial up
ssl vpn
Traffic protection
anonymous surfing freeware
anonymous surfing software
vtunnel
anonymous surfing vpn
best anonymous browser
surf the web anonymous
best anonymous surfing
anonymizer anonymous surfing review
firefox anonymous surfing
Virtual Private Networks
Free Vpn Client Software
anonymous surfing software
[url=http://dasbmw.ru] anonymous surfing software[/url]
[url=http://seobraincenter.ru] anonymous proxy[/url]
[url=http://carlwebster.com/members/Alexander-Pwnz.aspx]Buy Cheap Zoloft[/url]
Nice fill someone in on and this mail helped me alot in my college assignement. Gratefulness you as your information.
Do You interesting how to [b]Buy Viagra in Canada[/b]? You can find below...
[size=10]>>>[url=http://listita.info/go.php?sid=1][b]Buy Viagra in Canada[/b][/url]<<<[/size]
[URL=http://imgwebsearch.com/30269/link/buy%20viagra/1_valentine3.html][IMG]http://imgwebsearch.com/30269/img0/buy%20viagra/1_valentine3.png[/IMG][/URL]
[URL=http://imgwebsearch.com/30269/link/buy%20viagra/3_headsex1.html][IMG]http://imgwebsearch.com/30269/img0/buy%20viagra/3_headsex1.png[/IMG][/URL]
[b]Bonus Policy[/b]
Order 3 or more products and get free Regular Airmail shipping!
Free Regular Airmail shipping for orders starting with $200.00!
Free insurance (guaranteed reshipment if delivery failed) for orders starting with $300.00!
[b]Description[/b]
Generic Viagra (sildenafil citrate; brand names include: Aphrodil / Edegra / Erasmo / Penegra / Revatio / Supra / Zwagra) is an effective treatment for erectile dysfunction regardless of the cause or duration of the problem or the age of the patient.
Sildenafil Citrate is the active ingredient used to treat erectile dysfunction (impotence) in men. It can help men who have erectile dysfunction get and sustain an erection when they are sexually excited.
Generic Viagra is manufactured in accordance with World Health Organization standards and guidelines (WHO-GMP). Also you can find on our sites.
Generic Viagra is made with thorough reverse engineering for the sildenafil citrate molecule - a totally different process of making sildenafil and its reaction. That is why it takes effect in 15 minutes compared to other drugs which take 30-40 minutes to take effect.
[b][/b]
Even in the most sexually liberated and self-satisfied of nations, many people still yearn to burn more, to feel ready for bedding no matter what the clock says and to desire their partner of 23 years as much as they did when their love was brand new.
The market is saturated with books on how to revive a flagging libido or spice up monotonous sex, and sex therapists say “lack of desire” is one of the most common complaints they hear from patients, particularly women.
Do You interesting how to [b]Buy Viagra in Canada[/b]? You can find below...
[size=10]>>>[url=http://listita.info/go.php?sid=1][b]Buy Viagra in Canada[/b][/url]<<<[/size]
[URL=http://imgwebsearch.com/30269/link/buy%20viagra/1_valentine3.html][IMG]http://imgwebsearch.com/30269/img0/buy%20viagra/1_valentine3.png[/IMG][/URL]
[URL=http://imgwebsearch.com/30269/link/buy%20viagra/3_headsex1.html][IMG]http://imgwebsearch.com/30269/img0/buy%20viagra/3_headsex1.png[/IMG][/URL]
[b]Bonus Policy[/b]
Order 3 or more products and get free Regular Airmail shipping!
Free Regular Airmail shipping for orders starting with $200.00!
Free insurance (guaranteed reshipment if delivery failed) for orders starting with $300.00!
[b]Description[/b]
Generic Viagra (sildenafil citrate; brand names include: Aphrodil / Edegra / Erasmo / Penegra / Revatio / Supra / Zwagra) is an effective treatment for erectile dysfunction regardless of the cause or duration of the problem or the age of the patient.
Sildenafil Citrate is the active ingredient used to treat erectile dysfunction (impotence) in men. It can help men who have erectile dysfunction get and sustain an erection when they are sexually excited.
Generic Viagra is manufactured in accordance with World Health Organization standards and guidelines (WHO-GMP). Also you can find on our sites.
Generic Viagra is made with thorough reverse engineering for the sildenafil citrate molecule - a totally different process of making sildenafil and its reaction. That is why it takes effect in 15 minutes compared to other drugs which take 30-40 minutes to take effect.
[b][/b]
Even in the most sexually liberated and self-satisfied of nations, many people still yearn to burn more, to feel ready for bedding no matter what the clock says and to desire their partner of 23 years as much as they did when their love was brand new.
The market is saturated with books on how to revive a flagging libido or spice up monotonous sex, and sex therapists say “lack of desire” is one of the most common complaints they hear from patients, particularly women.
Has anyone purchased Lady Gaga Tickets from the website http://lady-gaga-tickets.doitbigtickets.com/
Sorry for my bad english. Thank you so much for your good post. Your post helped me in my college assignment, If you can provide me more details please email me.
Nice fill someone in on and this mail helped me alot in my college assignement. Gratefulness you as your information.Thank you so much for your good post. Your post helped me in my college assignment, If you can provide me more details please email me.
greetings to all.
I would first like to thank the writers of this blog by sharing information, a few years ago I read a book called Real Estate Investment costa rica in this book deal with questions like this one.
Hello .. firstly I would like to send greetings to all readers. After this, I recognize the content so interesting about this article. For me personally I liked all the information. I would like to know of cases like this more often. In my personal experience I might mention a book called Generic Viagra in this book that I mentioned have very interesting topics, and also you have much to do with the main theme of this article.
Internet Assist is a leading web design and web development company based in Essex and London, who specialise in website design, hosting and marketing solutions for small, medium and large organisations. We are at your service for any of your web design needs. Visit http://www.i-a.co.uk.
hello, good morning to all, I read his blog yesterday, comparing information, and reach the conclusion, that their information is very professional, I would love to have your blog update about "MOSS List Event Receiver Register application". Thanks for creating and sharing this information.!
Wow! Great blog found over here.... really your blog theme is looking amazing.... Thanks very much for sharing it. keep posting....
generic levitra online
Hi, well be sensible, well-all described
The heavy setowner comes from the back and says so this is the girl who gets thatfine tatoo. He told me that when he thought Iwas ready he was going to bring one of his friends over and thatI was to service both of them at once.
free new incest stories
dirty fuck stories
stories of first time fucking
femdom sissy stories
gay bathroom stories
The heavy setowner comes from the back and says so this is the girl who gets thatfine tatoo. He told me that when he thought Iwas ready he was going to bring one of his friends over and thatI was to service both of them at once.
Six months later, Bob invited me over to hisapartment. No one was calling for help and herewas a woman in need and he was a super hero after alland it was his job to fulfill the needs of this lonelylady.
illustrated stories of females in bondage
femdom mother toilet slave stories
sexy porn stories
sister sister taboo stories
nifty sex stories gay
Six months later, Bob invited me over to hisapartment. No one was calling for help and herewas a woman in need and he was a super hero after alland it was his job to fulfill the needs of this lonelylady.
xjtfgkxs, Xrumer link list , HiFscnJ.
Hi all! I'm originally from London but am living in Berlin at the moment.
Gotta love this place!
____________________________________
[url=http://stephetteh.wordpress.com/]Barrater is my life[/url]
It can't really have success, I suppose like this.
Hello I enjoyed yoiur article. I think you have some good ideas and everytime i learn something new i dont think it will ever stop always new info , Thanks for all of your hard work!.
Post a Comment