Exemplo n.º 1
0
 public IComponentTypeControl GetOrCreateComponentTypeControl(GetOrCreateComponentTypeData data)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     return(new ComponentTypeControlWrapper(this, data.SystemName, data));
 }
Exemplo n.º 2
0
        public IComponentTypeControl GetOrCreateComponentTypeControl(string systemName)
        {
            if (systemName == null)
            {
                throw new ArgumentNullException("systemName");
            }
            var data = new GetOrCreateComponentTypeData(systemName);

            return(GetOrCreateComponentTypeControl(data));
        }
Exemplo n.º 3
0
        protected IComponentControl CreateRootOffline()
        {
            var          getTypeData = new GetOrCreateComponentTypeData(SystemComponentType.Root.SystemName);
            var          type        = Client.GetOrCreateComponentTypeControl(getTypeData);
            const string rootVersion = null;

            return(new ComponentControlOffline(ClientInternal, type, "Root", rootVersion) //todo Root - надо вынестив служебный класс + сделать его System.Components.Root
            {
                IsRootValue = true
            });
        }
Exemplo n.º 4
0
        public static ComponentControlWrapper CreateRoot(Client client)
        {
            var getTypeData = new GetOrCreateComponentTypeData(SystemComponentType.Root.SystemName);
            var type        = client.GetOrCreateComponentTypeControl(getTypeData);

            var wrapper = new ComponentControlWrapper(client, type);

            wrapper.ControlActivator = new ControlActivator <IComponentControl>(
                wrapper.CreateRootOnline,
                wrapper.CreateRootOffline);

            return(wrapper);
        }
Exemplo n.º 5
0
        public GetOrCreateComponentTypeResponse GetOrCreateComponentType(GetOrCreateComponentTypeData data)
        {
            var dataDto = DataConverter.GetOrCreateComponentTypeRequestDtoData(data);
            var request = new GetOrCreateComponentTypeRequestDto
            {
                Data  = dataDto,
                Token = GetAccessTokenDto()
            };
            var responseDto = DtoService.GetOrCreateComponentType(request);
            var response    = CreateResponse <GetOrCreateComponentTypeResponse>(responseDto);

            response.InternalData = DataConverter.GetComponentTypeInfo(responseDto.Data);
            return(response);
        }
 public ComponentTypeControlWrapper(
     Client client,
     string systemName,
     GetOrCreateComponentTypeData getOrCreateData)
     : base(client)
 {
     if (getOrCreateData == null)
     {
         throw new ArgumentNullException("getOrCreateData");
     }
     SystemName       = systemName;
     ControlActivator = new ControlActivator <IComponentTypeControl>(CreateOnline, CreateOffline);
     GetOrCreateData  = getOrCreateData;
 }
Exemplo n.º 7
0
 public GetOrCreateComponentTypeResponse GetOrCreateComponentType(GetOrCreateComponentTypeData data)
 {
     return(Execute("GetOrCreateComponentType", () => ApiServiceInternal.GetOrCreateComponentType(data)));
 }
Exemplo n.º 8
0
 public GetOrCreateComponentTypeResponse GetOrCreateComponentType(GetOrCreateComponentTypeData data)
 {
     return(GetResponse <GetOrCreateComponentTypeResponse>());
 }