本文整理汇总了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);
}