void IReqRepImpl.SetupConnection(ClientContextBase ctx)
        {
            ClientOptions     opts = ConnectionUtils.GetDefaultOptions();
            ConnectionFactory cf   = new ConnectionFactory();

            ctx.Connection = cf.CreateConnection(opts);
        }
Beispiel #2
0
        protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            var operationCode = (OperationCode)operationRequest.OperationCode;

            if (_context == null)
            {
                if (operationCode != OperationCode.SetupContext)
                {
                    throw new ArgumentException($"Failed to process operation request '{operationCode}', the context has not been initialized");
                }

                var contextType = (ContextType)operationRequest.Parameters[(byte)OperationParameterCode.ContextType];

                if (contextType == ContextType.PlayerClient)
                {
                    _context = new PlayerClientContext(_application, this);
                }
                else
                {
                    throw new ArgumentException($"Failed setup context type '{contextType}', the context type was not recognized");
                }

                return;
            }

            _context.OnOperationRequest(operationCode, operationRequest.Parameters);
        }
Beispiel #3
0
        public bool TryResolveUrl(Uri url, out ClientContextBase instance)
        {
            var result = this._cmsContentContextResolver.TryResolveUrl(url, out instance);

            AssignCustomTrashComponent(instance);
            return(result);
        }
Beispiel #4
0
 private static void AssignCustomTrashComponent(ClientContextBase instance)
 {
     if (instance != null)
     {
         var contentDataContext = (ContentDataContext)instance;
         if (contentDataContext.CustomViewType == "epi-cms/component/Trash")
         {
             contentDataContext.CustomViewType = "customTrash/Trash";
         }
     }
 }
 void IInternalSystem.Initialize(ClientContextBase context, object clientProxy)
 {
     Context = context;
     Client  = (TClientComponent)clientProxy;
 }