Esempio n. 1
0
            public DocumentZone(HtmlHelper html, string targetZone, ZoneInjectMode injectMode, string key)
            {
                Guard.NotEmpty(targetZone, nameof(targetZone));

                _viewContext = html.ViewContext;
                _originalViewContextWriter = _viewContext.Writer;
                _page = (WebViewPage)html.ViewDataContainer;

                var writer = new StringWriter();

                _page.OutputStack.Push(writer);
                _viewContext.Writer = writer;

                _targetZone = targetZone;
                _injectMode = injectMode;

                if (key.HasValue())
                {
                    if (HasUniqueKey(key))
                    {
                        _isVoid = true;
                    }
                    else
                    {
                        UniqueKeys.Add(key);
                    }
                }

                if (_page.Request.IsAjaxRequest())
                {
                    _isVoid = true;
                }
            }
 public void AddUniqueKey(MySqlKeyDefinition index)
 {
     if (IndexKeys == null)
     {
         UniqueKeys = new HashSet <MySqlKeyDefinition>();
     }
     UniqueKeys.Add(index);
 }
Esempio n. 3
0
            public DocumentZone(WebViewPage page, string targetZone, ZoneInjectMode injectMode, string key)
            {
                Guard.NotEmpty(targetZone, nameof(targetZone));

                _page = page;
                _page.OutputStack.Push(new StringWriter());

                _targetZone = targetZone;
                _injectMode = injectMode;

                if (key.HasValue())
                {
                    UniqueKeys.Add(key);
                }
            }
Esempio n. 4
0
 public virtual DdlCreateTableStatement AddUniqueIndex(Identifier colname, IndexDefinition def)
 {
     UniqueKeys.Add(new Pair <Identifier, IndexDefinition>(colname, def));
     return(this);
 }