本文整理汇总了C#中Gtk.TreeStore.AppendValues方法的典型用法代码示例。如果您正苦于以下问题:C# TreeStore.AppendValues方法的具体用法?C# TreeStore.AppendValues怎么用?C# TreeStore.AppendValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeStore
的用法示例。
在下文中一共展示了TreeStore.AppendValues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnProjectLoaded
private void OnProjectLoaded(
object sender,
ProjectEventArgs e)
{
// Remove the child, if we have one.
if (Child != null)
{
Remove(Child);
}
// Create a tree model for this project.
var store = new TreeStore(typeof (string));
TreeIter iter = store.AppendValues("Project");
store.AppendValues(iter, "Chapter");
// Create the view for the tree.
var treeView = new TreeView
{
Model = store,
HeadersVisible = false,
};
treeView.AppendColumn("Name", new CellRendererText(), "text", 0);
// We need to wrap this in a scroll bar since the list might become
// too larger.
var scrolledWindow = new ScrolledWindow();
scrolledWindow.Add(treeView);
Add(scrolledWindow);
// Show our components to the user.
ShowAll();
}
示例2: ServiceScpdInfo
public ServiceScpdInfo (ServiceController service)
{
this.Build ();
this.service = service;
actionModel = new TreeStore (typeof (string));
stateVariableModel = new TreeStore (typeof (string));
foreach (var action in service.Actions) {
var iter = actionModel.AppendValues (action.Key);
foreach (var argument in action.Value.Arguments) {
var argument_iter = actionModel.AppendValues (iter, argument.Key);
actionModel.AppendValues (argument_iter, Catalog.GetString ("Direction: ") +
(argument.Value.Direction == ArgumentDirection.In ? "In" : "Out"));
actionModel.AppendValues (argument_iter, Catalog.GetString ("Is Return Value: ") + argument.Value.IsReturnValue);
actionModel.AppendValues (argument_iter, Catalog.GetString ("Related State Variable: ") + argument.Value.RelatedStateVariable);
}
}
foreach (var stateVariable in service.StateVariables) {
var iter = stateVariableModel.AppendValues (stateVariable.Key);
stateVariableModel.AppendValues (iter, Catalog.GetString ("Data Type: ") + stateVariable.Value.DataType);
stateVariableModel.AppendValues (iter, Catalog.GetString ("Sends Events: ") + stateVariable.Value.SendsEvents);
stateVariableModel.AppendValues (iter, Catalog.GetString ("Is Multicast: ") + stateVariable.Value.IsMulticast);
if (stateVariable.Value.DefaultValue != null) {
stateVariableModel.AppendValues (iter, Catalog.GetString ("Default Value: ") + stateVariable.Value.DefaultValue);
}
if (stateVariable.Value.AllowedValues != null) {
var allowed_values_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Values"));
foreach (var value in stateVariable.Value.AllowedValues) {
stateVariableModel.AppendValues (allowed_values_iter, value);
}
}
if (stateVariable.Value.AllowedValueRange != null) {
var allowed_value_range_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Value Range"));
stateVariableModel.AppendValues (allowed_value_range_iter,
"Minimum: " + stateVariable.Value.AllowedValueRange.Minimum);
stateVariableModel.AppendValues (allowed_value_range_iter,
"Maximum: " + stateVariable.Value.AllowedValueRange.Maximum);
if (stateVariable.Value.AllowedValueRange.Step != null) {
stateVariableModel.AppendValues (allowed_value_range_iter,
"Step: " + stateVariable.Value.AllowedValueRange.Step);
}
}
}
actions.AppendColumn (Catalog.GetString ("Actions"), new CellRendererText (), "text", 0);
actions.Model = actionModel;
actions.Selection.Changed += ActionsSelectionChanged;
stateVariables.AppendColumn (Catalog.GetString ("State Variables"), new CellRendererText (), "text", 0);
stateVariables.Model = stateVariableModel;
}
示例3: DocsTreeView
public DocsTreeView(Gtk.TextView rtv, OurParserTask r)
{
tv = rtv;
AppendColumn("Name", new Gtk.CellRendererText());
AppendColumn("Result", new Gtk.CellRendererPixbuf());
RulesHint = true;
Columns[0].SetCellDataFunc(Columns[0].CellRenderers[0],
new Gtk.TreeCellDataFunc(RenderName));
Columns[1].SetCellDataFunc(Columns[1].CellRenderers[0],
new Gtk.TreeCellDataFunc(RenderIcon));
Columns[0].Expand = true;
Gtk.TreeStore mres_store = new Gtk.TreeStore(
typeof(IParsed));
Model = mres_store;
Selection.Changed += new EventHandler(OnSelection);
Gtk.TreeIter iter = new Gtk.TreeIter();
foreach (ParsedDocument doc in r.Docs) {
iter = mres_store.AppendValues(doc);
foreach (IParsed m in doc.Results)
if (m.Result > 0)
mres_store.AppendValues(iter, m);
}
}
示例4: RepositoryView
public RepositoryView(Driver driver)
{
this.driver = driver;
HeadersVisible = false;
AppendColumn ("", new Gtk.CellRendererText (), "text", 0);
TreeViewColumn fullPath = AppendColumn ("", new Gtk.CellRendererText (), "text", 0);
fullPath.Visible = false;
itemStore = new Gtk.TreeStore (typeof (string), typeof (string));
Gtk.TreeIter root = itemStore.AppendValues(VersionControlPath.RootFolder, VersionControlPath.RootFolder);
Microsoft.TeamFoundation.VersionControl.Client.Item[] items = ItemsForPath(VersionControlPath.RootFolder);
foreach (Microsoft.TeamFoundation.VersionControl.Client.Item item in items)
{
if (item.ServerItem == VersionControlPath.RootFolder) continue;
string shortPath = item.ServerItem.Substring(item.ServerItem.LastIndexOf('/') + 1) + "/";
Gtk.TreeIter iter = itemStore.AppendValues (root, shortPath, item.ServerItem);
itemStore.AppendValues(iter, "");
}
Model = itemStore;
ExpandRow(TreePath.NewFirst(), false);
RowExpanded += MyRowExpandedHandler;
KeyReleaseEvent += MyKeyReleaseEventHandler;
}
示例5: AddinLoadErrorDialog
public AddinLoadErrorDialog(AddinError[] errors)
{
XML glade = new XML (null, "MonoDevelop.Startup.glade", "addinLoadErrorDialog", null);
glade.Autoconnect (this);
TreeStore store = new TreeStore (typeof(string));
errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
errorTree.Model = store;
bool fatal = false;
foreach (AddinError err in errors) {
string name = Path.GetFileNameWithoutExtension (err.AddinFile);
if (err.Fatal) name += " (Fatal error)";
TreeIter it = store.AppendValues (name);
store.AppendValues (it, "Full Path: " + err.AddinFile);
store.AppendValues (it, "Error: " + err.Exception.Message);
it = store.AppendValues (it, "Exception: " + err.Exception.GetType ());
store.AppendValues (it, err.Exception.StackTrace.ToString ());
if (err.Fatal) fatal = true;
}
// addinLoadErrorDialog.ShowAll ();
if (fatal) {
noButton.Hide ();
yesButton.Hide ();
labelContinue.Hide ();
closeButton.Show ();
labelFatal.Show ();
}
}
示例6: ContentDirectoryInfo
public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
{
if (contentDirectory == null) {
throw new ArgumentNullException ("contentDirectory");
}
this.content_directry = contentDirectory;
this.store = new TreeStore (typeof (ObjectRow));
var objects = new TreeView ();
var column = new TreeViewColumn ();
var cell = new CellRendererText ();
column.PackStart (cell, true);
column.SetCellDataFunc (cell, RenderObject);
column.Title = "Objects";
objects.AppendColumn (column);
objects.Selection.Changed += HandleObjectsSelectionChanged;
objects.RowExpanded += HandleObjectsRowExpanded;
objects.Model = store;
var root = contentDirectory.GetRootObject ();
store.AppendValues (new ObjectRow (root));
TreeIter iter;
store.GetIterFirst (out iter);
store.AppendValues (iter, loading);
Add (objects);
}
示例7: UpdateTree
/// <summary>
/// Fills the values into the emulator browser tree
/// </summary>
public void UpdateTree()
{
TreeStore listStore = new TreeStore (typeof(Emulator), typeof(Game));
foreach (Emulator emu in EmulatorController.emulators.OrderBy(o=>o.name))
{
TreeIter iter = listStore.AppendValues (emu);
foreach (Game game in emu.games)
listStore.AppendValues (iter, game);
}
LibraryTreeView.Model = listStore;
}
示例8: TreeItem
public TreeItem (TreeStore store, TreeItem parent, CoverageItem model, string title) {
this.store = store;
this.parent = parent;
this.model = model;
if (parent == null)
iter = store.AppendValues (title);
else
iter = store.AppendValues (parent.Iter, title);
FillColumns ();
}
示例9: PopulatePeopleCategories
void PopulatePeopleCategories(TreeStore treeStore ,Tag parent,TreeIter parentIter,int level)
{
foreach (Tag tag in (parent as Category).Children) {
if (tag is Category) {
//Log.Debug("Append : "+tag.Name + " to "+parent.Name);
TreeIter iter =
(parentIter.Equals(TreeIter.Zero) ?
treeStore.AppendValues(tag.Name,/*parent,*/tag):
treeStore.AppendValues(parentIter,tag.Name,/*parent,*/tag)) ;
PopulatePeopleCategories (treeStore,tag,iter,level+1);
}
}
}
示例10: AddinLoadErrorDialog
public AddinLoadErrorDialog (AddinError[] errors, bool warning)
{
Build ();
Title = BrandingService.ApplicationName;
TreeStore store = new TreeStore (typeof(string));
errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
errorTree.Model = store;
bool fatal = false;
foreach (AddinError err in errors) {
string msg = err.Message;
if (string.IsNullOrEmpty (msg) && err.Exception != null)
msg = err.Exception.Message;
string name = System.IO.Path.GetFileNameWithoutExtension (err.AddinFile);
if (err.Fatal) name += " (Fatal error)";
TreeIter it = store.AppendValues (name);
store.AppendValues (it, "Full Path: " + err.AddinFile);
store.AppendValues (it, "Error: " + msg);
if (err.Exception != null) {
it = store.AppendValues (it, "Exception: " + err.Exception.GetType () + ": " + err.Exception.Message);
store.AppendValues (it, err.Exception.StackTrace.ToString ());
}
if (err.Fatal) fatal = true;
}
if (fatal) {
noButton.Hide ();
yesButton.Hide ();
closeButton.Show ();
messageLabel.Text = GettextCatalog.GetString (
"{0} cannot start because a fatal error has been detected.",
BrandingService.ApplicationName
);
} else if (warning) {
noButton.Hide ();
yesButton.Hide ();
closeButton.Show ();
messageLabel.Text = GettextCatalog.GetString (
"{0} can run without these add-ins, but the functionality they provide will be missing.",
BrandingService.ApplicationName
);
} else {
messageLabel.Text = GettextCatalog.GetString (
"You can start {0} without these add-ins, but the functionality they " +
"provide will be missing. Do you wish to continue?",
BrandingService.ApplicationName
);
}
}
示例11: AccountsDialog
// ============================================
// PUBLIC Constructors
// ============================================
/// Create New "Add Peer" Dialog
public AccountsDialog()
: base("dialog", new XML(null, "AccountsDialog.glade", "dialog", null))
{
TreeStore store = new TreeStore(typeof(string), typeof(bool));
store.AppendValues("Demo 0", true);
store.AppendValues("Demo 1", false);
store.AppendValues("Demo 1", false);
treeView.Model = store;
treeView.AppendColumn("Demo", new CellRendererText(), "text", 0);
treeView.AppendColumn("Data", new CellRendererToggle(), "active", 1);
}
示例12: BindProviderTree
public void BindProviderTree()
{
accountStore = new TreeStore (typeof(string), typeof(Int64));
foreach (var provider in Providers) {
TreeIter iter = accountStore.AppendValues (provider.Name);
var accounts = accountService.GetByProvider (provider.Id);
foreach (var account in accounts) {
accountStore.AppendValues (iter, account.Name, account.Id);
}
}
TreeviewAccounts.Model = accountStore;
TreeviewAccounts.ButtonPressEvent += new ButtonPressEventHandler (OnItemButtonPressed);
}
示例13: AddChildrenToView
private void AddChildrenToView(NodeKey key, TreeStore store, TreeIter iter)
{
if (key.ChildValues != null)
foreach (ValueKey val in key.ChildValues)
store.AppendValues(iter, val.Name, val);
if (key.ChildNodes != null)
{
foreach (NodeKey node in key.ChildNodes)
{
TreeIter child = store.AppendValues(iter, node.Name, node);
AddChildrenToView(node, store, child);
}
}
}
示例14: Dialog
public Dialog(Drawable drawable, VariableSet variables = null)
: base("CountTool", variables)
{
var hbox = new HBox(false, 12) {BorderWidth = 12};
VBox.PackStart(hbox, true, true, 0);
var preview = new Preview(drawable, _coordinates);
hbox.PackStart(preview, true, true, 0);
var sw = new ScrolledWindow();
hbox.Add(sw);
var store = new TreeStore(typeof(Coordinate<int>));
for (int i = 0; i < 10; i++)
{
var coordinate = new Coordinate<int>(10 * i, 10 * i);
_coordinates.Add(coordinate);
store.AppendValues(coordinate);
}
var view = new TreeView(store);
sw.Add(view);
var textRenderer = new CellRendererText();
view.AppendColumn("X", textRenderer, new TreeCellDataFunc(RenderX));
view.AppendColumn("Y", textRenderer, new TreeCellDataFunc(RenderY));
}
示例15: HelpTree
public HelpTree () : base (GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
{
tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0);
tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
tree_view.Selection.Changed += new EventHandler (RowActivated);
store = new TreeStore (typeof (string), typeof (Node));
tree_view.Model = store;
tree_view.HeadersVisible = false;
scroller = new MonoDevelop.Components.CompactScrolledWindow ();
scroller.ShadowType = Gtk.ShadowType.None;
scroller.Add (tree_view);
if (HelpService.HelpTree != null) {
root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), HelpService.HelpTree);
PopulateNode (root_iter);
tree_view.ExpandRow (new TreePath ("0"), false);
TreeIter child_iter;
start:
if (store.IterChildren (out child_iter, root_iter)) {
do {
if (!store.IterHasChild (child_iter)) {
store.Remove (ref child_iter);
goto start;
}
} while (store.IterNext (ref child_iter));
}
}
Control.ShowAll ();
}