Пример #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);
        }
Пример #2
0
        public IComponentControl GetOrCreateChildComponentControl(
            IComponentTypeControl type,
            string systemName,
            string version)
        {
            var createData = new GetOrCreateComponentData(systemName, type)
            {
                Version = version
            };

            return(GetOrCreateChildComponentControl(createData));
        }
Пример #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));
        }
Пример #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;
 }
Пример #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);
        }
Пример #6
0
 public GetOrCreateComponentResponse GetOrCreateComponent(Guid parentId, GetOrCreateComponentData data)
 {
     return(Execute("GetOrCreateComponent", () => ApiServiceInternal.GetOrCreateComponent(parentId, data)));
 }
Пример #7
0
 public IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data)
 {
     return(new FakeComponentControl());
 }
Пример #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();
 }
Пример #10
0
 public GetOrCreateComponentResponse GetOrCreateComponent(Guid parentId, GetOrCreateComponentData data)
 {
     return(GetResponse <GetOrCreateComponentResponse>());
 }
Пример #11
0
 public abstract IComponentControl GetOrCreateChildComponentControl(GetOrCreateComponentData data);