Exemplo n.º 1
0
 public FilterItem(IFilterInput info)
 {
     FriendlyName     = info.FriendlyName;
     QueryString      = info.QueryString;
     DisplayValue     = info.DisplayValue;
     QueryStringValue = info.QueryStringValue;
 }
Exemplo n.º 2
0
        public IEnumerable <IContextVariable> GetVariables(IFilterInput input)
        {
            yield return(new ContextVariable(input.HandlerPropertyName, "EntityId")
            {
                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            });

            yield return(new ContextVariable(input.HandlerPropertyName, "Entity")
            {
                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            });

            foreach (var select in GetMembers())
            {
                yield return(new ContextVariable(input.HandlerPropertyName, select.MemberName)
                {
                    Node = this,
                    VariableType = select.MemberType,
                    Repository = this.Repository,
                });

                if (!select.MemberType.IsEnum)
                {
                    foreach (var item in select.MemberType.GetMembers())
                    {
                        yield return(new ContextVariable(input.HandlerPropertyName, select.MemberName, item.MemberName)
                        {
                            Node = this,
                            Source = item,
                            VariableType = item.MemberType,
                            Repository = this.Repository,
                        });
                    }
                }

                ////yield return new ContextVariable(input.HandlerPropertyName, select.Name, "EntityId") { Repository = this.Repository, Node = this, VariableType = "int" };
                ////yield return new ContextVariable(input.HandlerPropertyName, select.Name, "Entity") { Repository = this.Repository, Node = this, VariableType = "uFrame.ECS.Entity" };

                ////foreach (var item in select.PersistedItems.OfType<ITypedItem>())
                ////{
                ////    yield return new ContextVariable(input.HandlerPropertyName, select.Name, item.Name)
                ////    {
                ////        Repository = this.Repository,
                ////        Source = item,
                ////        VariableType = item.RelatedTypeName,
                ////        Node = this
                ////    };
                ////}
            }
        }
Exemplo n.º 3
0
        public IEnumerable <IContextVariable> GetVariables(IFilterInput input)
        {
            yield return(new ContextVariable(input.HandlerPropertyName, "EntityId")
            {
                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            });

            yield return(new ContextVariable(input.HandlerPropertyName, "Entity")
            {
                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            });
        }
        public IEnumerable<IContextVariable> GetVariables(IFilterInput input)
        {
            yield return new ContextVariable(input.HandlerPropertyName, "EntityId")
            {

                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            };
            yield return new ContextVariable(input.HandlerPropertyName, "Entity")
            {

                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            };
        }
Exemplo n.º 5
0
        public IEnumerable <IContextVariable> GetVariables(IFilterInput input)
        {
            yield return(new ContextVariable(input.HandlerPropertyName)
            {
                Node = this,
                Source = null,
                VariableType = this,
                Repository = this.Repository,
                //TypeInfo =  typeof(MonoBehaviour)
            });

            yield return(new ContextVariable(input.HandlerPropertyName, "EntityId")
            {
                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            });

            yield return(new ContextVariable(input.HandlerPropertyName, "Entity")
            {
                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            });

            foreach (var item in GetMembers())
            {
                yield return(new ContextVariable(input.HandlerPropertyName, item.MemberName)
                {
                    Node = this,
                    Source = item as IMemberInfo,
                    VariableType = item.MemberType,
                    Repository = this.Repository,
                });
            }
        }
Exemplo n.º 6
0
 private void CreateFilterProperty(IFilterInput input, IMappingsConnectable inputFilter)
 {
     Ctx.CurrentDeclaration._public_(inputFilter.ContextTypeName, input.HandlerPropertyName);
 }
        private void CreateFilterProperty(IFilterInput input, IMappingsConnectable inputFilter)
        {
            Ctx.CurrentDeclaration._public_(inputFilter.ContextTypeName, input.HandlerPropertyName);

        }
Exemplo n.º 8
0
        private void EnsureFilterList()
        {
            if (_usedParams != null)
            {
                return;
            }
            _usedParams = new List <FilterItem>();

            if (this.Container == null)
            {
                this.Container = this.NamingContainer.FindControl(this.ContainerId);
            }
            if (this.Container == null)
            {
                string str = string.Format("Container with ID {0} not found", this.ContainerId);
                throw new HttpException(str);
            }

            foreach (Control ctl in this.Container.Descendants())
            {
                FilterItem   infoItem;
                IFilterInput info = ctl as IFilterInput;
                if (info != null)
                {
                    // Common case. All our custom controls should implement this interface
                    if (!info.FilterDisabled)
                    {
                        infoItem         = new FilterItem(info);
                        infoItem.Visible = ctl.Visible;
                        _usedParams.Add(infoItem);
                    }
                }
                else if (ctl is CheckBoxList)
                {
                    CheckBoxList  cbList = (CheckBoxList)ctl;
                    List <string> values = new List <string>();
                    foreach (ListItem item in cbList.Items)
                    {
                        if (item.Selected)
                        {
                            values.Add(item.Text);
                        }
                    }
                    if (values.Count > 0)
                    {
                        infoItem = new FilterItem();
                        infoItem.FriendlyName     = cbList.ToolTip;
                        infoItem.DisplayValue     = string.Join(", ", values.ToArray());
                        infoItem.QueryStringValue = infoItem.DisplayValue;
                    }
                }
                else if (ctl is ListControl)
                {
                    // DropDownList, RadioButtonList
                    ListControl ddl = (ListControl)ctl;
                    infoItem = new FilterItem();
                    infoItem.FriendlyName     = ddl.ToolTip;
                    infoItem.DisplayValue     = ddl.SelectedItem.Text;
                    infoItem.QueryStringValue = ddl.SelectedItem.Value;
                    _usedParams.Add(infoItem);
                }
                else if (ctl is CheckBox)
                {
                    CheckBox cb = (CheckBox)ctl;
                    if (cb.Checked)
                    {
                        infoItem = new FilterItem();
                        infoItem.FriendlyName     = cb.Text;
                        infoItem.DisplayValue     = "Checked";
                        infoItem.QueryStringValue = "true";
                        _usedParams.Add(infoItem);
                    }
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Assign hot keys
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            IHotKeyLeftColumn ll = null;

            // Do not use D because browsers use it to go to address bar
            //P is also used by browser to show Page menu
            string usedKeys = "D P";

            foreach (Control ctl in Controls)
            {
                if (ctl is IHotKeyLeftColumn)
                {
                    ll = ctl as IHotKeyLeftColumn;
                }
                IFilterInput info = ctl as IFilterInput;
                if (info != null)
                {
                    //if (this.AutoFocus)
                    //{
                    //    ctl.PreRender += new EventHandler(tb_PreRender);
                    //}
                    if (ll != null)
                    {
                        // If left label text has not been specified, set the control's friendly name to the text
                        // InputControlBase shows ID if friendly name has not been specified
                        if (string.IsNullOrEmpty(info.FriendlyName) || info.FriendlyName == ctl.ID)
                        {
                            info.FriendlyName = ll.Text;
                        }
                        else if (string.IsNullOrEmpty(ll.Text))
                        {
                            ll.Text = info.FriendlyName;
                        }
                        // Find the first unused letter
                        if (string.IsNullOrEmpty(ll.AccessKey))
                        {
                            for (int i = 0; i < ll.Text.Length; ++i)
                            {
                                //changed the character case to upper so that we can compare the characters .
                                // Never let space become an access key
                                if (usedKeys.IndexOf(ll.Text[i].ToString().ToUpper()) == -1)
                                {
                                    if (string.IsNullOrEmpty(ctl.ID))
                                    {
                                    }
                                    else
                                    {
                                        ll.AccessKey           = new string(ll.Text[i], 1);
                                        ll.AssociatedControlID = ctl.ID;
                                        //info.ClientIdRequired = true;
                                        usedKeys += ll.AccessKey.ToUpper();
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
 /*
  * This is the function initializing auto-update by creating an instance of the inner class.
  * Parameters are:
  *      - input - the object providing input to the filter, needs to be instantiated previous to invoking this method
  *      - a - smoothing factor, the lower, the more inertia
  *      - initialValue - the initial value for the filter, it should be as close as possible to the expected average value of the filtered variable.
  */
 public void Set <T>(IFilterInput <T> input, float a, T initialValue)
 {
     lowPassFilterController = new LowPassFilterController <T>(input, a, initialValue);
 }
 /*
  * This is the Constructor for the inner class, it assigns the new input object to a variable and then instantiates the filter.
  * Parameters are:
  *      - input - the object providing input to the filter, needs to be instantiated previous to invoking this method
  *      - a - smoothing factor, the lower, the more inertia
  *      - initialValue - the initial value for the filter, it should be as close as possible to the expected average value of the filtered variable.
  */
 public LowPassFilterController(IFilterInput <T> input, float a, T initialValue)
 {
     lowPassFilterInput = input;
     lowPassFilter      = new LowPassFilter <T>(a, initialValue);
 }
Exemplo n.º 12
0
        public IEnumerable<IContextVariable> GetVariables(IFilterInput input)
        {
            yield return new ContextVariable(input.HandlerPropertyName)
            {
                Node = this,
	            Source = null,
                VariableType = this,
                Repository = this.Repository,
                //TypeInfo =  typeof(MonoBehaviour)
            };
            yield return new ContextVariable(input.HandlerPropertyName, "EntityId")
            {
               
                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            };
            yield return new ContextVariable(input.HandlerPropertyName, "Entity")
            {
                
                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            };

            foreach (var item in GetMembers())
            {
                yield return new ContextVariable(input.HandlerPropertyName,item.MemberName)
                {
                  
                    Node = this,
	                Source = item as IMemberInfo,
                    VariableType = item.MemberType,
                    Repository = this.Repository,
                };
            }
        }
Exemplo n.º 13
0
        public IEnumerable<IContextVariable> GetVariables(IFilterInput input)
        {
            yield return new ContextVariable(input.HandlerPropertyName, "EntityId")
            {
             
                Node = this,
                VariableType = new SystemTypeInfo(typeof(int)),
                Repository = this.Repository,
            };
            yield return new ContextVariable(input.HandlerPropertyName, "Entity")
            {
            
                Node = this,
                VariableType = new SystemTypeInfo(uFrameECS.EntityComponentType),
                Repository = this.Repository,
                //TypeInfo = typeof(MonoBehaviour)
            };

            foreach (var select in GetMembers())
            {

                yield return new ContextVariable(input.HandlerPropertyName, select.MemberName)
                {
                   
                    Node = this, 
                    VariableType = select.MemberType,
                    Repository = this.Repository, 
                };
                if (!select.MemberType.IsEnum)
                {
                    foreach (var item in select.MemberType.GetMembers())
                    {
                        yield return new ContextVariable(input.HandlerPropertyName, select.MemberName, item.MemberName)
                        {
                        
                            Node = this,
                            Source = item ,
                            VariableType = item.MemberType,
                            Repository = this.Repository,
                        };
                    }
                }
          
                ////yield return new ContextVariable(input.HandlerPropertyName, select.Name, "EntityId") { Repository = this.Repository, Node = this, VariableType = "int" };
                ////yield return new ContextVariable(input.HandlerPropertyName, select.Name, "Entity") { Repository = this.Repository, Node = this, VariableType = "uFrame.ECS.Entity" };

                ////foreach (var item in select.PersistedItems.OfType<ITypedItem>())
                ////{
                ////    yield return new ContextVariable(input.HandlerPropertyName, select.Name, item.Name)
                ////    {
                ////        Repository = this.Repository,
                ////        Source = item,
                ////        VariableType = item.RelatedTypeName,
                ////        Node = this
                ////    };
                ////}
            }
        }