当前位置: 首页>>代码示例>>C#>>正文


C# ArrayList.AddEventListener方法代码示例

本文整理汇总了C#中ArrayList.AddEventListener方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.AddEventListener方法的具体用法?C# ArrayList.AddEventListener怎么用?C# ArrayList.AddEventListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArrayList的用法示例。


在下文中一共展示了ArrayList.AddEventListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateChildren


//.........这里部分代码省略.........

        VGroup vGroup = new VGroup { PercentWidth = 100, PercentHeight = 100, Gap = 0 };
        hGroup.AddChild(vGroup);

        #region Header

        /* Implement your own header logic here */

        /*HGroup header = new HGroup {PercentWidth = 100, Gap = 0};
        vGroup.AddChild(header);

        for (int i = 0; i < 5; i++)
        {
            Button btnCol = new Button // example header
            {
                Text = "Column " + (i + 1),
                ToggleMode = true,
                PercentWidth = 100
            };
            btnCol.Click += delegate(Event e)
            {
                // sort, filder and refresh (do list.DataProvider = list.DataProvider)
            };
            header.AddChild(btnCol);
        }*/

        #endregion

        #region List

        List list = new List
        {
            Id = "list1",
            PercentWidth = 100,
            PercentHeight = 100,
            DataProvider = _dataProvider,
            LabelField = "FirstName", // this must be set due to list logic legacy (the field must exist in DTO)
            SkinClass = typeof (ListSkin2),
            ItemRenderer = new ItemRendererFactory<MyGridItemRenderer>()
        };
        vGroup.AddChild(list);

        #endregion

        #region Footer

        HGroup footer = new HGroup { PercentWidth = 100, Gap = 30, PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 0 };
        vGroup.AddChild(footer);

        _lblSum = new Label {Text = "Age sum: ", StyleName = "footer" };
        footer.AddChild(_lblSum);

        _lblNumberOfSelectedItems = new Label { Text = "Driving licenses: ", StyleName = "footer" };
        footer.AddChild(_lblNumberOfSelectedItems);

        UpdateFooter();

        #endregion

        #endregion

        #region Process renderer click

        AddEventListener(MyGridItemRenderer.ADD_BUTTON_CLICKED, delegate(Event e)
        {
            IItemRenderer itemRenderer = (IItemRenderer)e.Target;
            Alert.Show("Info", itemRenderer.Data.ToString(), AlertButtonFlag.Ok,
                new AlertOption(AlertOptionType.HeaderIcon, (object) ImageLoader.Instance.Load("Icons/information")));
        });

        AddEventListener(MyGridItemRenderer.EDIT_BUTTON_CLICKED, delegate(Event e)
        {
            var editor = new ExamplePopupEditor { 
                Title = "Edit", 
                Icon = ImageLoader.Instance.Load("Icons/edit"), 
                Data = ((MyGridItemRenderer) e.Target).Data, 
                CloseOnEsc = true
            };
            editor.AddEventListener(CloseEvent.CLOSE, delegate
            {
                PopupManager.Instance.RemovePopup(editor);
            });

            PopupManager.Instance.AddPopup(editor, true);
        });

        #endregion

        #region Process property change

        _dataProvider.AddEventListener(PropertyChangeEvent.PROPERTY_CHANGE, delegate(Event e)
        {
            //PropertyChangeEvent pce = (PropertyChangeEvent) e;
            //Debug.Log(pce.NewValue);
            UpdateFooter();
        });

        #endregion

    }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:101,代码来源:GridDemo.cs


注:本文中的ArrayList.AddEventListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。