public static IWebSecurityAddIn Create(WebSecurityAddInData.WebSecurityAddInsRow addIn, StateBag viewStateContext, string languageCode) { IWebSecurityAddIn @in = null; try { if (addIn.TypeAssembly == null) { throw new InvalidCastException(); } @in = (IWebSecurityAddIn)Assembly.Load(addIn.TypeAssembly).CreateInstance(addIn.TypeNameSpace); @in.AddInDbId = addIn.WebSecurityAddInId; @in.Disabled = addIn.Disabled; string str = ResourceManager.GetString(addIn.Description); @in.Description = (str == null) ? addIn.Description : str; @in.SurveyId = addIn.SurveyID; @in.ViewState = viewStateContext; @in.Order = addIn.AddInOrder; @in.LanguageCode = languageCode; /// return @in; } catch (NullReferenceException) { throw new InvalidCastException("specfied type " + addIn.TypeNameSpace + " could not be found in the specifed assembly " + addIn.TypeAssembly); } catch (InvalidCastException) { throw new InvalidCastException("specfied type " + addIn.TypeNameSpace + " must implement the IWebSecurityAddIn interface"); } return(@in); }
/// <summary> /// Builds a row with the options available for an addin /// </summary> /// <returns>a tablerow instance with the options</returns> private TableRow BuildAddInOptionsRow(IWebSecurityAddIn addIn, int totalAddIns) { // Creates a new addin options control SecurityAddInOptionsControl addInOptionsControl = (SecurityAddInOptionsControl)LoadControl("SecurityAddInOptionsControl.ascx"); addInOptionsControl.SecurityAddIn = addIn; addInOptionsControl.SurveyId = SurveyId; addInOptionsControl.TotalAddIns = totalAddIns; return(BuildRow(addInOptionsControl)); }
private void AddAddinButton_Click(object sender, System.EventArgs e) { new SecurityAddIn().AddSecurityAddInToSurvey(SurveyId, int.Parse(SecurityAddInDropDownList.SelectedValue), _addInOrder); WebSecurityAddInData.WebSecurityAddInsRow addInRow = (WebSecurityAddInData.WebSecurityAddInsRow) new SecurityAddIns().GetAddInById(SurveyId, int.Parse(SecurityAddInDropDownList.SelectedValue)).WebSecurityAddIns.Rows[0]; try { IWebSecurityAddIn addedAddin = WebSecurityAddInFactory.Create(addInRow, ViewState, null); addedAddin.InitOnSurveyAddition(); } catch (Exception) { new SecurityAddIn().DeleteWebSecurityAddIn(SurveyId, int.Parse(SecurityAddInDropDownList.SelectedValue)); throw; } UINavigator.NavigateToSurveySecurity(SurveyId, MenuIndex); }
/// <summary> /// Builds a row with the options available for an addin /// </summary> /// <returns>a tablerow instance with the options</returns> private TableRow BuildAddInOptionsRow(IWebSecurityAddIn addIn, int totalAddIns) { // Creates a new addin options control SecurityAddInOptionsControl addInOptionsControl = (SecurityAddInOptionsControl )LoadControl("UserControls/SecurityAddInOptionsControl.ascx"); addInOptionsControl.SecurityAddIn = addIn; addInOptionsControl.SurveyId = SurveyId; addInOptionsControl.TotalAddIns = totalAddIns; return BuildRow(addInOptionsControl); }
public int Add(IWebSecurityAddIn surveySecurityAddIn) { return base.Add(surveySecurityAddIn); }
public void Remove(IWebSecurityAddIn surveySecurityAddIn) { base.Remove(surveySecurityAddIn); }
public void Insert(int index, IWebSecurityAddIn surveySecurityAddIn) { base.Insert(index, surveySecurityAddIn); }
public bool Contains(IWebSecurityAddIn surveySecurityAddIn) { return base.Contains(surveySecurityAddIn); }
public int Add(IWebSecurityAddIn surveySecurityAddIn) { return(base.Add(surveySecurityAddIn)); }
public bool Contains(IWebSecurityAddIn surveySecurityAddIn) { return(base.Contains(surveySecurityAddIn)); }