private MappedView CreateView(WebAdminView webAdminView) { var result = new MappedView(webAdminView, webAdminView.CreateView()); FindExposedMethods(result.View.GetType(), result.ExposedMethods); result.View.ShowView(); return(result); }
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; }
public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; pData = null; MappedView?.Dispose(); MappedFile?.Dispose(); Transcoder.Delete(pTranscoder); }
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); }
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); }