示例#1
0
        public void Config(EntityViewMeta evm)
        {
            if (PageSize != null && evm is WebEntityViewMeta)
            {
                evm.AsWebView().PageSize = PageSize.Value;
            }
            if (GroupBy != null)
            {
                if (GroupBy == NullString)
                {
                    evm.GroupBy = null;
                }
                else
                {
                    evm.GroupBy = evm.Property(GroupBy);
                }
            }

            foreach (var property in this.EntityProperties)
            {
                if (property.IsChanged())
                {
                    var pvm = evm.Property(property.Name);
                    if (pvm != null)
                    {
                        property.Config(pvm);
                    }
                }
            }

            if (RafyEnvironment.Location.IsWebUI)
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var jsCmd = evm.AsWebView().Commands.Find(cmd.Name);
                        if (jsCmd != null)
                        {
                            cmd.Config(jsCmd);
                        }
                    }
                }
            }
            else
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var wpfCmd = evm.AsWPFView().Commands.Find(cmd.Name);
                        if (wpfCmd != null)
                        {
                            cmd.Config(wpfCmd);
                        }
                    }
                }
            }
        }
 internal void Read(EntityViewMeta evm)
 {
     this.Id = GetRuntimeUniqueId(evm);
     if (evm.GroupBy != null) this.GroupBy = evm.GroupBy.Name;
     if (evm is WebEntityViewMeta)
     {
         this.PageSize = evm.AsWebView().PageSize;
     }
     this.EntityType = ClientEntities.GetClientName(evm.EntityType);
     if (!string.IsNullOrEmpty(evm.ExtendView)) this.ViewName = evm.ExtendView;
 }
示例#3
0
 private void UseSysCommands(EntityViewMeta evm)
 {
     //初始化实体视图中的命令按钮
     var em = evm.EntityMeta;
     if (!RafyEnvironment.Location.IsWebUI)
     {
         if (em.EntityCategory == EntityCategory.QueryObject)
         {
             evm.AsWPFView().UseCommands(WPFCommandNames.SysQueryCommands);
         }
         else
         {
             evm.AsWPFView().UseCommands(WPFCommandNames.SysCommands);
         }
     }
     else
     {
         if (em.EntityCategory == EntityCategory.QueryObject)
         {
             evm.AsWebView().UseCommands(WebCommandNames.SysQueryCommands);
         }
         else
         {
             evm.AsWebView().UseCommands(WebCommandNames.SysCommands);
         }
     }
 }
示例#4
0
 internal void Read(EntityViewMeta evm)
 {
     this.Id = GetRuntimeUniqueId(evm);
     if (evm.GroupBy != null) this.GroupBy = evm.GroupBy.Name;
     if (evm is WebEntityViewMeta)
     {
         this.PageSize = evm.AsWebView().PageSize;
     }
     this.EntityType = ClientEntities.GetClientName(evm.EntityType);
     if (!string.IsNullOrEmpty(evm.ExtendView)) this.ViewName = evm.ExtendView;
 }
示例#5
0
        public void Config(EntityViewMeta evm)
        {
            if (PageSize != null && evm is WebEntityViewMeta) evm.AsWebView().PageSize = PageSize.Value;
            if (GroupBy != null)
            {
                if (GroupBy == NullString)
                {
                    evm.GroupBy = null;
                }
                else
                {
                    evm.GroupBy = evm.Property(GroupBy);
                }
            }

            foreach (var property in this.EntityProperties)
            {
                if (property.IsChanged())
                {
                    var pvm = evm.Property(property.Name);
                    if (pvm != null) { property.Config(pvm); }
                }
            }

            if (RafyEnvironment.Location.IsWebUI)
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var jsCmd = evm.AsWebView().Commands.Find(cmd.Name);
                        if (jsCmd != null) { cmd.Config(jsCmd); }
                    }
                }
            }
            else
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var wpfCmd = evm.AsWPFView().Commands.Find(cmd.Name);
                        if (wpfCmd != null) { cmd.Config(wpfCmd); }
                    }
                }
            }
        }