//�Ƴ���ָ���ڲ����Ƶ���� 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; } }
//���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; } }
//�õ�ָ��������Ƶ����������������� 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; }