Exemplo n.º 1
0
        public bool AddNormalComponent(string componentName, object componentDataObject)
        {
            bool result;

            try
            {
                instance = GetContainer();
                var 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);
                result = true;
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 2
0
        public object GetNormalComponentDataObject(string componentName)
        {
            instance = GetContainer();
            var normalComponent = new NormalComponent(componentName);

            if (instance.CurrentContainer.Components[normalComponent.InnerName] == null)
            {
                return(null);
            }

            return(((NormalComponent)instance.CurrentContainer.Components[normalComponent.InnerName]).ComponentDataObject);
        }
Exemplo n.º 3
0
 public static MyControlContainer GetContainer()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             if (instance == null)
             {
                 instance = new MyControlContainer();
             }
         }
     }
     return(instance);
 }