In other type of treatment of Valium overdose, doctor may order antidote for the overdosing. Detox process would be done. In case a person is addicted, the detoxification process will be the first phase of the treatment plan. Next step would be getting help from the rehab centre specializing in Valium addiction treatment. After these stages, there will be higher chances of sobriety. Basically, it is important that in case of Valium overdose, you should rush immediately to your doctor before thevalium online-buy diazepam.During the recent few years the sleeping pill named ambien has become very popular in many countries of the world and alone in the United States of America it is consumed by around a 22 million people. This medical product would not be available from any place unless you are having a prescription from a registered doc.buy ambien online-order ambien online overnight.FDA categorizes Tramadol in category C which means that it can harm the unborn baby. Inform the physician if you are or are planning to be pregnant. If all these conditions are considered, Tramadol can be taken safely.buy tramadol-buy tramadol 100mg.Tramadol or Ultram is a highly appreciated opiate agonist medication. It works by altering the way the body feels the pain in the central nervous system. This is a successful painkiller which works on all kinds of pains.buy tramadol-buy tramadol uk.This strong central nervous system depressant is free from all kinds of side effects. If one takes it exactly as prescribed by the doctors there are no chances of any side effect. It is recommended that you must take it after the prescription of doctor. Do not stop taking this medication immediately.buy tramadol-buy tramadol with cod.Tramadol belongs to the group of medicines which are called opiate agonists. These are similar to the narcotics. This is the prescription drug which is available as Ultram ER or Ultram. This drug functions by altering your body in experiencing pain.buy tramadol-generic tramadol.You can always take the Tramadol as per prescription. It is a simple way to relieve pain but it is important to follow doctor’s instructions. Tramadol usually should be taken after every 4-6 hours. It can be taken without food as well. Tramadol is only available in the form of tablet. It should be swallowed as it is without being crushed, chewed or split. Injecting or snorting Tramadol can lead to death as well.buy tramadol-buy generic tramadol online.Since individuals may make it a habit to take this medication to be devoid of moderate or severe pain, one must understand the drastic consequences of overdose and should follow the prescription blindly.  Though this medication can be consumed either through an injection or by inhaling it, consuming the tablet as a whole with a glass of water is the most preferred way. Minimum dosage is 400 mg and 600 mg for oral and parental respectively.buy tramadol-buy tramadol tablets.This reduces the brain activity and calms in down. This medicine can be taken with or without food intake, which makes it rather flexible to use. The use of this medicine is most effective when it is taken as soon as the pain begins; if taken after the pain worsens, the intake of this medicine may not be of much use to the patient. Hence, this particular drug has a number of uses and benefits that humans can put to good use.buy tramadol online-buy tramadol cod overnight.Before we may take up the topic of relief from lower back pain with use of tramadol it would be at first quite right to discuss a little about the causes of back pain and their types. In most individuals who are suffering from low back pain it has been found from researches that emotional factors along with stress played a huge part in causing such pain.buy tramadol online cod-buy tramadol online.You can buy soma online if you possess a valid prescription. You should get the prescription from a registered doctor or a healthcare provider since the medicine is not safe to consume without the advice of a doctor.buy soma-buy soma online.This drug can make you feel dizzy or sleepy. So if you are doing anything that requires caution like driving then be alert.soma online-carisoprodol without prescription.
Print Shortlink

Activating SharePoint 2010 features with properties

The most common task when deploying your solution is to activate custom and out of the box features. In the first chapter of my book – we looked at how you can automate the process using PowerShell saving yourself from manual deployment of your solution. However, PowerShell snap in for SharePoint doesn’t have a method to activate features with properties. There are quite a few of out of the box features with properties, let alone your might have few of your own if you want to pass parameters to your features.

Recently I found very good reference over here on how you can use .NET reflection and pass activation properties to your features. In this article I would like to provide simplified example that you can compile quickly and possibly latest show you how same can be done in PowerShell.

First, we’re going to create a new SharePoint solution which will provision just one feature with receiver.

1. In your Vsiaul Studio Blank SharePoint project add a feature
2. Add a receiver to the feature
3. Add the following code to the receiver’s FeatureActivated method:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb web = properties.Feature.Parent as SPWeb;
if (properties.Feature.Properties["Test"]!=null)
{
web.Title = properties.Feature.Properties["Test"].Value;
web.Update();
}
}

Basically a new feature parameter called “Test” is being accepted and the value of that parameter will be set as a title of the web. Deploy the solution – you will notice the feature will be installed in your site but not activated.

Let’s see how we can activate the feature with parameters using a custom webpart

1. Create a new SharePoint project in Visual Studio of type Visual Webpart
2. In the code behind of of the user control add the following code to the Page_Load method:

 protected void Page_Load(object sender, EventArgs e)
{
    SPWeb web = SPContext.Current.Web;
    web.AllowUnsafeUpdates = true;
    Dictionary<string,string> activationProps = new Dictionary<string,string>();
    activationProps.Add("Test", "This is my title");
    web.Features.ActivateFeature(new Guid("1a3fea9d-251d-42ce-a72e-5f138629c0c1"),
activationProps);
    web.Update();
}

Above, the GUID is simply the ID of the feature we created before. In this part we’re passing a parameter to our extension method called ActivateFeature with the properties and the ID of the feature. Let’s now implement the extension method provided by Hristo in the above article:

The extension class (with 2 methods) will go into the separate class and will be referenced by the user control, here is the code of the class:

public static class ExtensionForFeature
{
public static SPFeature ActivateFeature(this
SPFeatureCollection features,
Guid featureId,
Dictionary<string,string> activationProps)
{
ConstructorInfo propCollConstr =
typeof(SPFeaturePropertyCollection).GetConstructors(BindingFlags.NonPublic
| BindingFlags.Instance)[0];
SPFeaturePropertyCollection properties = (SPFeaturePropertyCollection)
propCollConstr.Invoke(new object[] { null });
foreach (string key in activationProps.Keys)
properties.Add(new SPFeatureProperty(key, activationProps[key]));
return ActivateFeature(features, featureId, properties);
}
private static SPFeature ActivateFeature(this
SPFeatureCollection features,
Guid featureId,
SPFeaturePropertyCollection properties)
{
MethodInfo getFeatureInternal =
typeof(SPFeatureCollection).GetMethod(
"GetFeature",
BindingFlags.Instance | BindingFlags.NonPublic,
null,
new Type[] { typeof(Guid) },
null);
SPFeature alreadyActivatedFeature = (SPFeature)getFeatureInternal.Invoke
(features, new object[] { featureId });
if (alreadyActivatedFeature != null)
// The feature is already activated. No action required
return null;
MethodInfo addInternal =
typeof(SPFeatureCollection).GetMethod(
"Add",
BindingFlags.Instance | BindingFlags.NonPublic,
null,
new Type[] { typeof(Guid), typeof(SPFeaturePropertyCollection), typeof(bool) },
null);
object result = addInternal.Invoke(features, new object[] { featureId,
properties, false });
return result as SPFeature;
}
}

Add the following namespace references:

using System.Reflection;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
using System.Linq;

The above extension class will use Reflection to access internal methods available in SharePoint and invoke those to pass parameters into your feature during activation.

Now, deploy your solution and add a new webpart to the page – during its activation you will see the second feature being activated and title of the web changed according to the feature parameter passed..

Enjoy!