コード例 #1
0
        private MappedView CreateView(WebAdminView webAdminView)
        {
            var result = new MappedView(webAdminView, webAdminView.CreateView());

            FindExposedMethods(result.View.GetType(), result.ExposedMethods);
            result.View.ShowView();

            return(result);
        }
コード例 #2
0
 public DeferredMethod(long requestId, MappedView mappedView, ExposedMethod exposedMethod, object[] parameters)
 {
     JobId         = Guid.NewGuid().ToString();
     CreatedUtc    = DateTime.UtcNow;
     RequestId     = requestId;
     MappedView    = mappedView;
     ExposedMethod = exposedMethod;
     Parameters    = parameters;
 }
コード例 #3
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            IsDisposed = true;
            pData      = null;
            MappedView?.Dispose();
            MappedFile?.Dispose();
            Transcoder.Delete(pTranscoder);
        }
コード例 #4
0
        private string StartMultiViewInstance(WebAdminView webAdminView, string key, TextContentEventArgs args)
        {
            Dictionary <string, MappedView> runningInstances;

            if (!_MultiViewInstances.TryGetValue(key, out runningInstances))
            {
                runningInstances = new Dictionary <string, MappedView>();
            }

            string viewId;

            do
            {
                viewId = Guid.NewGuid().ToString();
            } while(runningInstances.ContainsKey(viewId));

            MappedView mappedView = CreateView(webAdminView);

            mappedView.ViewId = viewId;

            var newInnerMap = CollectionHelper.ShallowCopy(runningInstances);

            newInnerMap.Add(viewId, mappedView);

            var newOuterMap = CollectionHelper.ShallowCopy(_MultiViewInstances);

            if (newOuterMap.ContainsKey(key))
            {
                newOuterMap[key] = newInnerMap;
            }
            else
            {
                newOuterMap.Add(key, newInnerMap);
            }
            _MultiViewInstances = newOuterMap;

            return(viewId);
        }
コード例 #5
0
        private MappedView FindMappedView(RequestReceivedEventArgs args)
        {
            var sharedViewInstances = _SharedViewInstances;
            var multiViewInstances  = _MultiViewInstances;

            var normalisedPath = NormaliseString(args.Path);

            MappedView result = null;

            if (!sharedViewInstances.TryGetValue(normalisedPath, out result))
            {
                Dictionary <string, MappedView> viewInstances;
                if (multiViewInstances.TryGetValue(normalisedPath, out viewInstances))
                {
                    var viewId = args.QueryString[ViewIdParameterName] ?? args.Request.FormValues[ViewIdParameterName];
                    if (viewId != null)
                    {
                        viewInstances.TryGetValue(viewId, out result);
                    }
                }
            }

            return(result);
        }