Exemple #1
0
        public IMarkupStorage CreateControlScopeMarkupStorage(ControlScopeId controlScopeId)
        {
            IMarkupStorage controlMarkupStorage = new MarkupStorage();

            _nestedScopeToMarkupMap.Add(controlScopeId, controlMarkupStorage);
            return(controlMarkupStorage);
        }
Exemple #2
0
        public void EnterControlScope(ControlScopeId controlScopeId)
        {
            var controlScopeBehavior = CurrentContext.GetNestedControlScopeContext(controlScopeId);

            _contextStack.Push(controlScopeBehavior);
            _levelOfNesting++;
        }
Exemple #3
0
        public IMarkupStorageInitializer GetOrCreateControlScopeMarkupStorage(ControlScopeId controlScopeId)
        {
            IMarkupStorageInitializer controlMarkupStorage = TryGetControlScopeMarkupStorage(controlScopeId);

            if (controlMarkupStorage == null)
            {
                controlMarkupStorage = CreateControlScopeMarkupStorage(controlScopeId);
            }

            return(controlMarkupStorage);
        }
        public ControlScopeContext GetNestedControlScopeContext(ControlScopeId controlScopeId)
        {
            if (_markupStorage == null)
            {
                throw new InvalidOperationException(
                          $"MarkupStorage for ControlContext with name=\"{_contextId.Name}\" is not defined, so nested control scope with name = \"{controlScopeId.Name} can't be found");
            }

            var nestedControlMarkupStorage = _markupStorage.TryGetControlScopeMarkupStorage(controlScopeId) ??
                                             _markupStorage.CreateControlScopeMarkupStorage(controlScopeId);

            return(new ControlScopeContext(controlScopeId, nestedControlMarkupStorage));
        }
Exemple #5
0
 public IMarkupStorage TryGetControlScopeMarkupStorage(ControlScopeId controlScopeId)
 {
     _nestedScopeToMarkupMap.TryGetValue(controlScopeId, out var controlMarkupStorage);
     return(controlMarkupStorage);
 }
 private void AddSelectionStep(ControlScopeId controlScopeId)
 {
     _selectionSteps.Push(controlScopeId);
 }
 private bool Equals(ControlScopeId other)
 {
     return(string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase));
 }
Exemple #8
0
 public IScopeMappingPipe CreateControlMappingPipe(ControlScopeId controlScopeId)
 {
     return(new ScopeMappingPipe(_markupStorage.GetOrCreateControlScopeMarkupStorage(controlScopeId)));
 }
Exemple #9
0
 public IScopeContextRuntime UseControlScopeContextRuntime(ControlScopeId controlScopeId)
 {
     _scopeContextRuntime.EnterControlScope(controlScopeId);
     return(_scopeContextRuntime);
 }
 public IMarkupStorageInitializer GetOrCreateControlScopeMarkupStorage(ControlScopeId controlScopeId)
 {
     return(new MultiMarkupStorageProxy(_storages
                                        .Select(v => v.GetOrCreateControlScopeMarkupStorage(controlScopeId))));
 }
 public ControlScopeContext(ControlScopeId contextId,
                            [CanBeNull] IMarkupStorage markupStorage)
 {
     _markupStorage = markupStorage;
     _contextId     = contextId;
 }