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


C# Battle.Provides方法代码示例

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


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

示例1: OriginView

        public OriginView(Battle.Core.BattleSession session, Battle.Core.OriginDefinition orig)
            : base(5, 2, false)
        {
            this.SizeRequested += HandleSizeRequested;
            this.SizeAllocated += HandleSizeAllocated;
            //this.session = session;
            //this.orig = orig;

            Label label1 = new Label("Name: ");
            Label label2 = new Label("Description: ");
            Entry entry1 = new Entry();
            Entry entry2 = new Entry();

            entry1.IsEditable = false;
            entry1.Text = orig.Name;

            entry2.IsEditable = false;
            entry2.Text = orig.Description;

            Gtk.TreeStore store1 = new Gtk.TreeStore(typeof(string));
            foreach (string prov in orig.Provides())
            {
                //string[] vs = new string[1];
                //vs[0] = prov;
                //store1.AppendValues(vs);
                TreeIter i =  store1.AppendNode();
                store1.SetValue(i, 0, prov);
            }
            TreeView treeview1 = new TreeView(store1);
            treeview1.AppendColumn("Provides", new CellRendererText(), "text", 0);

            Gtk.TreeStore store2 = new Gtk.TreeStore(typeof(string));
            foreach (string req in orig.Requires())
            {
                string[] vs = new string[1];
                vs[0] = req;
                store1.AppendValues(vs);
            }
            TreeView treeview2 = new TreeView(store2);
            treeview2.AppendColumn("Requires", new CellRendererText(), "text", 0);

            this.Attach(new Label("Origin"), 0, 2, 0, 1, AttachOptions.Expand, AttachOptions.Fill, 0, 0);

            this.Attach(label1, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            this.Attach(entry1, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            this.Attach(label2, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            this.Attach(entry2, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            this.Attach(treeview1, 0, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 1, 1);

            this.Attach(treeview2, 0, 2, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
        }
开发者ID:sgtnasty,项目名称:battle,代码行数:53,代码来源:OriginView.cs


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