February 23, 2012

Document Library Event receiver


 if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)
{
//This is when the update event is triggered by check-in.
}
else
{
//This is triggered by events other than check-in action.
}

February 22, 2012

ERROR OCCURRED IN DEPLOYMENT STEP ‘ACTIVATE FEATURES’: OPERATION IS NOT VALID DUE TO THE CURRENT STATE OF THE OBJECT.

1. Close Visual Studio
2. IISRESET

Trying to use an SPWeb object that has been closed or disposed and is no longer valid.

VisualWebPart - Visual WebPart - Custom and EditPart Properties

http://blog.concurrency.com/sharepoint/create-a-custom-web-part-for-sharepoint-2010/

private string customTextProp = "";

[WebBrowsable(true),
Category("Miscellaneous"),
Personalizable(PersonalizationScope.Shared),
WebDisplayName("Enter some text")]
public string CustomTextProp 
{ 
get{return customTextProp;}
set{customTextProp = value;} 
}


protected override void CreateChildControls()
{
   MyWebPartUserControl control = Page.LoadControl(_ascxPath) as MyWebPartUserControl;
   if (control != null)
      control.WebPart = this;
      Controls.Add(control);
   }
}



In UserControl.cs file
public MyWebPart WebPart { get; set; }

In 2007:

      Button btn = new Button();


        protected override void CreateChildControls()
        {
            btn.Text = "Set the Property";
            btn.Click += new EventHandler(btn_AddLink);
            this.Controls.Add(btn);
        }


        private void btn_AddLink(Object sender, EventArgs e)
        {
            btn.Text = "Changed Text";
        }

February 15, 2012

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...