Example #1
0
        public static ComponentControlWrapper CreateFolder(
            ComponentControlWrapper parent,
            GetOrCreateFolderData getOrCreateFolder)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (getOrCreateFolder == null)
            {
                throw new ArgumentNullException("getOrCreateFolder");
            }

            var folderType = parent.Client.GetFolderComponentTypeControl();
            var getOrCreateComponentData = new GetOrCreateComponentData(getOrCreateFolder.SystemName, folderType)
            {
                DisplayName = getOrCreateFolder.DisplayName,
                Version     = null
            };


            var controlData = new GetOrCreateComponentControlData(parent, getOrCreateComponentData);

            var wrapper = new ComponentControlWrapper(
                controlData.Parent.ClientInternal,
                controlData.Data.ComponentTypeControl);

            wrapper.GetOrCreateComponentData = controlData;

            wrapper.ControlActivator = new ControlActivator <IComponentControl>(
                wrapper.CreateFolderOnline,
                wrapper.CreateFolderOffline);

            return(wrapper);
        }
Example #2
0
        public IComponentControl GetOrCreateChildComponentControl(
            IComponentTypeControl type,
            string systemName,
            string version)
        {
            var createData = new GetOrCreateComponentData(systemName, type)
            {
                Version = version
            };

            return(GetOrCreateChildComponentControl(createData));
        }
Example #3
0
        public IComponentControl GetOrCreateChildFolderControl(GetOrCreateFolderData data)
        {
            var type          = Client.GetFolderComponentTypeControl();
            var componentData = new GetOrCreateComponentData(data.SystemName, type)
            {
                DisplayName = data.DisplayName,
                Version     = null
            };

            componentData.Properties.CopyFrom(data.Properties);
            return(GetOrCreateChildComponentControl(componentData));
        }
Example #4
0
 public GetOrCreateComponentControlData(ComponentControlWrapper parent, GetOrCreateComponentData data)
 {
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     Parent = parent;
     Data   = data;
 }
Example #5
0
        public GetOrCreateComponentResponse GetOrCreateComponent(Guid parentId, GetOrCreateComponentData data)
        {
            var dataDto = DataConverter.GetOrCreateComponentDataDto(parentId, data);
            var request = new GetOrCreateComponentRequestDto()
            {
                Data  = dataDto,
                Token = GetAccessTokenDto()
            };
            var responseDto = DtoService.GetOrCreateComponent(request);
            var response    = CreateResponse <GetOrCreateComponentResponse>(responseDto);

            response.InternalData = DataConverter.GetComponentControlData(responseDto.Data);
            return(response);
        }
 public GetOrCreateComponentResponse GetOrCreateComponent(Guid parentId, GetOrCreateComponentData data)
 {
     return(Execute("GetOrCreateComponent", () => ApiServiceInternal.GetOrCreateComponent(parentId, data)));
 }
Example #7
0
 public IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data)
 {
     return(new FakeComponentControl());
 }
Example #8
0
        public override IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data)
        {
            var controlData = new GetOrCreateComponentControlData(this, data);

            return(GetOrCreateChildComponentControl(controlData));
        }
 public override IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data)
 {
     // данный метод вызывается только у wrapper-а
     throw new NotImplementedException();
 }
Example #10
0
 public GetOrCreateComponentResponse GetOrCreateComponent(Guid parentId, GetOrCreateComponentData data)
 {
     return(GetResponse <GetOrCreateComponentResponse>());
 }
Example #11
0
 public abstract IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data);