Ejemplo n.º 1
0
        private BaseForumControl CreateDynamicForumControl(SharePointForumControls childControl)
        {
            BaseForumControl control = null;

            try
            {
                string controlTypeName = string.Format("{0}.{1}", ForumConstants.Control_Namespace, childControl.ToString());
                Type   controlType     = Type.GetType(controlTypeName);
                control = Activator.CreateInstance(controlType) as BaseForumControl;
                control.WebPartParent = this;
            }
            catch (ArgumentNullException nullEx)
            {
                AddError(nullEx);
            }

            return(control);
        }
Ejemplo n.º 2
0
        private BaseControl createDynamicControl(SharePointForumControls childControl)
        {
            BaseControl control = null;

            try
            {
                var controlTypeName = string.Format("{0}.{1}", ForumConstants.ControlNamespace, childControl);
                var controlType     = Type.GetType(controlTypeName);
                control = Activator.CreateInstance(controlType) as BaseControl;
                if (control != null)
                {
                    control.WebPartParent = this;
                }
            }
            catch (ArgumentNullException ex)
            {
                HandleException(ex);
            }

            return(control);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a link to a given action control with a set of parameters.
 /// </summary>
 /// <param name="action">The action.</param>
 /// <param name="format">The format.</param>
 /// <param name="args">The args.</param>
 /// <returns></returns>
 public string GetLink(SharePointForumControls action, string format, params object[] args)
 {
     return(string.Format("{0}?control={1}&{2}", BasePath, action, string.Format(format, args)));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a link to a given action control.
 /// </summary>
 /// <param name="action">The action.</param>
 /// <returns></returns>
 public string GetLink(SharePointForumControls action)
 {
     return(string.Format("{0}?control={1}", BasePath, action.ToString()));
 }
Ejemplo n.º 5
0
        private BaseControl createDynamicControl(SharePointForumControls childControl)
        {
            BaseControl control = null;

            try
            {
                var controlTypeName = string.Format("{0}.{1}", ForumConstants.ControlNamespace, childControl);
                var controlType = Type.GetType(controlTypeName);
                control = Activator.CreateInstance(controlType) as BaseControl;
                if (control != null) control.WebPartParent = this;
            }
            catch (ArgumentNullException ex)
            {
                HandleException(ex);
            }

            return control;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a link to a given action control with a set of parameters.
 /// </summary>
 /// <param name="action">The action.</param>
 /// <param name="format">The format.</param>
 /// <param name="args">The args.</param>
 /// <returns></returns>
 public string GetLink(SharePointForumControls action, string format, params object[] args)
 {
     return string.Format("{0}?control={1}&{2}", BasePath, action, string.Format(format, args));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs a link to a given action control.
 /// </summary>
 /// <param name="action">The action.</param>
 /// <returns></returns>
 public string GetLink(SharePointForumControls action)
 {
     return string.Format("{0}?control={1}", BasePath, action.ToString());
 }
Ejemplo n.º 8
0
		private BaseForumControl CreateDynamicForumControl(SharePointForumControls childControl)
		{
			BaseForumControl control = null;
			
			try
			{
				string controlTypeName = string.Format("{0}.{1}", ForumConstants.Control_Namespace, childControl.ToString());
				Type controlType = Type.GetType(controlTypeName);
				control = Activator.CreateInstance(controlType) as BaseForumControl;
				control.WebPartParent = this;
			}
			catch(ArgumentNullException nullEx)
			{
				AddError(nullEx);
			}

			return control;
		}