public static void RecreateView(CruiseDatastore datastore, IViewDefinition viewDef)
        {
            var viewName = viewDef.ViewName;

            datastore.Execute($"DROP VIEW {viewName};");
            datastore.Execute(viewDef.CreateView);
        }
Esempio n. 2
0
        private async Task ImportViewDefinitionEntryAsync(IViewDefinition vd)
        {
            switch (vd)
            {
            case MenuItem menuItem:
                await this.ImportMenuItemDefinition(menuItem);

                break;

            case AbstractEntityViewDefinition entityView:
                await this.ImportViewDefinitionAsync(entityView);

                break;

            case AbstractActionDefinition action:
                await this.ImportActionDefinitionAsync(action);

                break;

            case ViewFragment fragment:
                await this.ImportViewFragmentDefinitionAsync(fragment);

                break;

            default:
                throw new NotSupportedException($"Unsupported view definition '{vd.GetType().Name}' to import");
            }
        }
Esempio n. 3
0
        private UITableViewCell GetViewFromDeclaration(IViewDefinition viewDefinition)
        {
            var style = UITableViewCellStyle.Default;

            if (viewDefinition.Param is UITableViewCellStyle)
            {
                style = (UITableViewCellStyle)viewDefinition.Param;
            }

            var reuseIndentifer = GetReuseIndentiferForView(viewDefinition.ViewType, style);
            var cell            = this.Source.TableView.DequeueReusableCell(reuseIndentifer);

            if (cell == null)
            {
                cell = this.CreateView(viewDefinition.ViewType, style, reuseIndentifer);

                cell.SetValue(TableViewSection.SectionProperty, this);
                AttachBehavioursToView(viewDefinition.Behaviours, cell);
            }

            return(cell);
        }
Esempio n. 4
0
 public ElementDataViewWrapper(IViewDefinition viewDefintion, object data) : base(data, null)
 {
     this.ViewDefinition = viewDefintion;
 }
Esempio n. 5
0
        public void ExcerciseCreateView(IViewDefinition viewDef)
        {
            var createTable = viewDef.CreateView;

            TestSyntax(createTable);
        }
Esempio n. 6
0
 private UITableViewCell GetViewFromDeclaration(IViewDefinition viewDefinition)
 {
     var style = UITableViewCellStyle.Default;
     if (viewDefinition.Param is UITableViewCellStyle)
     {
         style = (UITableViewCellStyle)viewDefinition.Param;
     }
     
     var reuseIndentifer = GetReuseIndentiferForView(viewDefinition.ViewType, style);
     var cell = this.Source.TableView.DequeueReusableCell(reuseIndentifer);
     
     if (cell == null)
     {
         cell = this.CreateView(viewDefinition.ViewType, style, reuseIndentifer);
         
         cell.SetValue(TableViewSection.SectionProperty, this);
         AttachBehavioursToView(viewDefinition.Behaviours, cell);
     }
     
     return cell;
 }
Esempio n. 7
0
        private void CreateView(ICommands cmd, IAParser parser, IATranslator translator, IViewDefinition view)
        {
            ASTNodeList   aNodes         = null;
            StringBuilder createViewStmt = new StringBuilder("create view ");

            createViewStmt.Append(view.ViewName);

            if (view.DbType == DbTypeName.Any || parser.ExpandEmptyStrings)
            {
                aNodes = parser.CreateNodeList(view.SelectStatement);
            }

            if (view.DbType == DbTypeName.Any)
            {
                if (!ColumnListContainStar(aNodes))
                {
                    createViewStmt.Append(CreateColumnList(aNodes));
                }

                aNodes = translator.Translate(aNodes);
            }

            createViewStmt.Append(" as ");

            if (aNodes != null)
            {
                createViewStmt.Append(aNodes);
            }
            else
            {
                createViewStmt.Append(view.SelectStatement);
            }

            cmd.ExecuteNonQuery(createViewStmt.ToString());
        }
Esempio n. 8
0
 public ElementDataViewWrapper(IViewDefinition viewDefintion, object data) : base(data, null)
 {
     this.ViewDefinition = viewDefintion;
 }