Exemplo n.º 1
0
        public IControl Instantiate(IContainer container)
        {
            List <IMember> orderedMembers   = TopologicalSort(members);
            InstantiatedTemplateControl ctl = new InstantiatedTemplateControl(delegate(IInstantiatedTemplateControl x) { return(MainRenderFunction.Render(this, x)); });

            foreach (IMember m in orderedMembers)
            {
                try {
                    m.Instantiate(this, ctl, container);
                }
#if SERVER
                catch (Exception ex) {
                    if (ex is TargetInvocationException)
                    {
                        ex = ex.InnerException;
                    }
                    throw new Exception("Error instantiating member " + m.Name + ": " + ex.Message, ex);
                }
#else
                catch (Exception ex) {
                    throw new Exception("Error instantiating member " + m.Name + ": " + ex.Message);
                }
#endif
            }
            return(ctl);
        }
Exemplo n.º 2
0
		public IControl Instantiate(IContainer container) {
			List<IMember> orderedMembers = TopologicalSort(members);
			InstantiatedTemplateControl ctl = new InstantiatedTemplateControl(delegate(IInstantiatedTemplateControl x) { return MainRenderFunction.Render(this, x); });
			foreach (IMember m in orderedMembers) {
				try {
					m.Instantiate(this, ctl, container);
				}
#if SERVER
				catch (Exception ex) {
					if (ex is TargetInvocationException)
						ex = ex.InnerException;
					throw new Exception("Error instantiating member " + m.Name + ": " + ex.Message, ex);
				}
#else
				catch (Exception ex) {
					throw new Exception("Error instantiating member " + m.Name + ": " + ex.Message);
				}
#endif
			}
			return ctl;
		}