Exemplo n.º 1
0
        //���Session���
        public bool AddNormalComponent(string componentName,object componentDataObject)
        {
            try
            {
                instance=GetContainer();

                NormalComponent _NormalComponent=new NormalComponent(componentName);

                if(instance.CurrentContainer.Components[componentName]!=null) //�������
                {
                    instance.RemoveComponentByName(componentName);
                }
                else
                {
                    instance.RemoveComponentByInnerName(_NormalComponent.InnerName);
                }

                _NormalComponent.ComponentDataObject=componentDataObject;

                instance.CurrentContainer.Add(_NormalComponent,_NormalComponent.InnerName);

                return true;
            }
            catch
            {
                return false;
            }
        }
Exemplo n.º 2
0
 public static DiscuzControlContainer GetContainer()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             if (instance == null)
             {
                 instance = new DiscuzControlContainer();
             }
         }
     }
     return instance;
 }
Exemplo n.º 3
0
 //�Ƴ���ָ���ڲ����Ƶ����
 public void RemoveComponentByInnerName(string componentName)
 {
     instance=GetContainer();
     NormalComponent _NormalComponent=new NormalComponent(componentName);
     foreach(IDiscuzNTComponent component in instance.CurrentContainer.Components)
     {
         if(component.InnerName==_NormalComponent.ComponentName)
         {
             CurrentContainer.Remove (component);
         }
         break;
     }
 }
Exemplo n.º 4
0
 //�Ƴ���ָ�����Ƶ����
 public void RemoveComponentByName(string componentName)
 {
     instance=GetContainer();
     foreach(IDiscuzNTComponent component in instance.CurrentContainer.Components)
     {
         if(component.ComponentName==componentName)
         {
             CurrentContainer.Remove (component);
         }
         break;
     }
 }
Exemplo n.º 5
0
 //�õ�ָ��������Ƶ�����������������
 public object GetNormalComponentDataObject(string componentName)
 {
     instance=GetContainer();
     NormalComponent _NormalComponent=new NormalComponent(componentName);
     if(instance.CurrentContainer.Components[_NormalComponent.InnerName]==null) //�������
     {
         return null;
     }
     return ((NormalComponent) instance.CurrentContainer.Components[_NormalComponent.InnerName]).ComponentDataObject;
 }