예제 #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);
        }
예제 #2
0
        public void RemoveComponentByInnerName(string componentName)
        {
            var normalComponent = new NormalComponent(componentName);

            foreach (IBBXComponent item in GetContainer().CurrentContainer.Components)
            {
                if (item != null && item.InnerName == normalComponent.ComponentName)
                {
                    this.CurrentContainer.Remove(item);
                }
            }
        }
예제 #3
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);
        }
예제 #4
0
        public override bool Equals(object cmp)
        {
            NormalComponent normalComponent = (NormalComponent)cmp;

            return(this.ComponentName.Equals(normalComponent.ComponentName));
        }