本文整理匯總了C#中Battle.Requires方法的典型用法代碼示例。如果您正苦於以下問題:C# Battle.Requires方法的具體用法?C# Battle.Requires怎麽用?C# Battle.Requires使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Battle
的用法示例。
在下文中一共展示了Battle.Requires方法的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);
}