本文整理汇总了C#中TreeStore类的典型用法代码示例。如果您正苦于以下问题:C# TreeStore类的具体用法?C# TreeStore怎么用?C# TreeStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeStore类属于命名空间,在下文中一共展示了TreeStore类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: XwtTreeList
/// <summary>
/// Initializes a new instance of the <see cref="Sharpend.Xwt.XwtTreeList"/> class.
/// </summary>
/// <param name='tree'>
/// Tree.
/// </param>
/// <param name='xml'>
/// xml definition for the grid or the resource name for the xml
/// </param>
/// <param name='isResource'>
/// if true param xml is a resourcename
/// </param>
public XwtTreeList(TreeView tree,String xml, bool isResource=true)
: this(tree)
{
Fields = createDataFields(xml,isResource);
navigators = new Dictionary<TreeNavigator, VirtualGridRow>(100);
//create the treestore
IDataField[] df = new IDataField[Fields.Length+1];
for (int i=0;i<Fields.Length;i++)
{
df[i] = Fields[i].Field;
}
df[Fields.Length] = new DataField<VirtualTreeRow>();
DataStore = new TreeStore(df);
//add columns to the tree
//foreach (DatafieldContainer dc in Fields)
for (int i=0;i<(Fields.Length-1);i++)
{
DatafieldContainer dc = Fields[i];
Tree.Columns.Add(dc.Title,dc.Field);
//tree.
//Tree.Columns.Add(itm);
//Tree.ButtonPressed += HandleButtonPressed;
}
Tree.DataSource = DataStore;
}
开发者ID:sharpend,项目名称:Sharpend,代码行数:39,代码来源:XwtTreeList.cs
示例2: SetupTreeView
private void SetupTreeView()
{
{
var column = new TreeViewColumn();
var cell = new CellRendererText();
column.Title = "Customer ID";
column.PackStart(cell, true);
column.AddAttribute(cell, "text", (int)Column.CustomerID);
this.treeview1.AppendColumn(column);
}
{
var column = new TreeViewColumn();
var cell = new CellRendererText();
column.Title = "First Name";
column.PackStart(cell, true);
column.AddAttribute(cell, "text", (int)Column.FirstName);
this.treeview1.AppendColumn(column);
}
{
var column = new TreeViewColumn();
var cell = new CellRendererText();
column.Title = "Last Name";
column.PackStart(cell, true);
column.AddAttribute(cell, "text", (int)Column.LastName);
this.treeview1.AppendColumn(column);
}
this.treeStore1 = (TreeStore)this.SetupTreeViewModel();
this.treeview1.Model = this.treeStore1;
this.treeview1.ExpandAll();
}
开发者ID:jholland918,项目名称:gtk-sharp-samples,代码行数:34,代码来源:MainWindow.cs
示例3: ExecutionModeSelectorDialog
public ExecutionModeSelectorDialog ()
{
Title = GettextCatalog.GetString ("Execution Mode Selector");
Width = 500;
Height = 400;
var box = new VBox ();
Content = box;
box.PackStart (new Label (GettextCatalog.GetString ("Run Configurations:")));
listConfigs = new RunConfigurationsList ();
box.PackStart (listConfigs, true);
box.PackStart (new Label (GettextCatalog.GetString ("Execution Modes:")));
storeModes = new TreeStore (modeNameField, modeField, modeSetField);
treeModes = new TreeView (storeModes);
treeModes.HeadersVisible = false;
treeModes.Columns.Add (GettextCatalog.GetString ("Name"), modeNameField);
box.PackStart (treeModes, true);
runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));
Buttons.Add (Command.Cancel);
Buttons.Add (runButton);
listConfigs.SelectionChanged += (sender, e) => LoadModes ();
treeModes.SelectionChanged += OnModeChanged;
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:31,代码来源:ExecutionModeSelectorDialog.cs
示例4: LoadTreeStoreFromSimpleManifest
//Load the tree store from a simple file list (not json)
public static TreeStore LoadTreeStoreFromSimpleManifest(string manifestSimple)
{
TreeStore ts = new TreeStore();
string curFileName = "";
try
{
string[] lineArray = manifestSimple.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
foreach (var line in lineArray.ToList<String>())
{
string[] treeArray = line.Split(';');
curFileName = treeArray[0];
TextAsset treeText = Resources.Load<TextAsset>(treeArray[0]);
ITree tempTree = SimpleTreeParser.getTreeFromString(treeText.text, (TreeType)Int32.Parse(treeArray[1]), ts.globalFlags);
tempTree.treeName = treeArray[2];
ts.treeDictionary.Add(Int32.Parse(treeArray[3]), tempTree);
}
}
catch (Exception ex)
{
Debug.Log(curFileName + ex.Message + ex.StackTrace);
string error = ex.Message + ex.StackTrace;
return null;
}
//select the first manifest item as current tree index
ts.currentTreeIndex = ts.treeDictionary.Keys.ToList()[0];
return ts;
}
开发者ID:mengtest,项目名称:UnityRPG,代码行数:34,代码来源:SimpleTreeParser.cs
示例5: RelayTournamentsView
public RelayTournamentsView(ICSClient c)
{
client = c;
tournamentIter = TreeIter.Zero;
store = new TreeStore (typeof (int),
typeof (string),
typeof (string));
create_tree ();
refreshButton = new Button (Stock.Refresh);
refreshButton.Clicked += OnClicked;
infoLabel = new Label ();
infoLabel.UseMarkup = true;
infoLabel.Xalign = 0;
infoLabel.Xpad = 4;
//infoLabel.Yalign = 0;
//infoLabel.Ypad = 4;
HBox box = new HBox ();
box.PackStart (infoLabel, true, true, 4);
box.PackStart (refreshButton, false, false,
4);
PackStart (box, false, true, 4);
ScrolledWindow scroll = new ScrolledWindow ();
scroll.HscrollbarPolicy =
scroll.VscrollbarPolicy =
PolicyType.Automatic;
scroll.Add (tree);
PackStart (scroll, true, true, 4);
client.AuthEvent += OnAuth;
ShowAll ();
}
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:31,代码来源:RelayTournamentsView.cs
示例6: AlgorithmTreeView
/// <summary>
/// Initializes a new instance of the <see cref="Baimp.AlgorithmTreeView"/> class.
/// </summary>
public AlgorithmTreeView(ScanCollection scanCollection)
{
nameCol = new DataField<object>();
store = new TreeStore(nameCol);
Type baseType = typeof(BaseAlgorithm);
IEnumerable<Type> algorithms = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(t => t.BaseType == baseType);
algorithmCollection = new Dictionary<string, List<BaseAlgorithm>>();
foreach (Type algorithm in algorithms) {
BaseAlgorithm instance =
Activator.CreateInstance(algorithm, (PipelineNode) null, scanCollection) as BaseAlgorithm;
string algorithmType = instance.AlgorithmType.ToString();
if (!algorithmCollection.ContainsKey(algorithmType)) {
algorithmCollection[algorithmType] = new List<BaseAlgorithm>();
}
algorithmCollection[algorithmType].Add(instance);
}
InitializeUI();
}
开发者ID:jfreax,项目名称:BAIMP,代码行数:29,代码来源:AlgorithmTreeView.cs
示例7: MainWindow
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build();
this.c_ProjectTreeView.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
this.c_ProjectTreeView.AppendColumn("Project", new CellRendererText(), "text", 1);
this.m_Store = new TreeStore(typeof(Pixbuf), typeof(string), typeof(object));
this.c_ProjectTreeView.Model = this.m_Store;
this.c_ProjectTreeView.HeadersVisible = false;
// Register events.
this.c_RegenerateAction.Activated += (object sender, EventArgs e) =>
{
Actions.ResyncProjects(this.Module);
};
this.c_ProjectTreeView.RowActivated += (object o, RowActivatedArgs args) =>
{
TreeIter iter;
this.m_Store.GetIter(out iter, args.Path);
var result = this.m_Store.GetValue(iter, 2);
Actions.Open(this.Module, result, this.Update);
};
}
开发者ID:JoschaMetze,项目名称:Protobuild,代码行数:26,代码来源:MainWindow.cs
示例8: MainWindow
public MainWindow()
{
this.Examples = ExampleLibrary.Examples.GetList().OrderBy(e => e.Category).ToList();
this.plotView = new PlotView();
this.plotView.MinHeight = 554;
this.plotView.MinWidth = 625;
this.plotView.DefaultTrackerSettings.Enabled = true;
this.plotView.DefaultTrackerSettings.Background = Xwt.Drawing.Colors.AliceBlue.WithAlpha (0.9).ToOxyColor();
this.treeView = new TreeView();
this.treeView.MinWidth = 314;
this.treeView.Visible = true;
var treeModel = new TreeStore(nameCol);
TreePosition categoryNode = null;
string categoryName = null;
foreach (var ex in this.Examples)
{
if (categoryName == null || categoryName != ex.Category)
{
categoryNode = treeModel.AddNode ().SetValue (nameCol, ex.Category).CurrentPosition;
categoryName = ex.Category;
}
treeModel.AddNode (categoryNode).SetValue (nameCol, ex.Title);
}
treeView.Columns.Add ("Example", nameCol);
this.treeView.DataSource = treeModel;
this.treeView.SelectionChanged += (s, e) =>
{
if (treeView.SelectedRow != null) {
var sample = treeModel.GetNavigatorAt (treeView.SelectedRow).GetValue (nameCol);
var info = this.Examples.FirstOrDefault(ex => ex.Title == sample);
if (info != null)
{
this.SelectedExample = info;
}
}
};
var hbox = new HBox();
hbox.Spacing = 6;
hbox.MinHeight = 554;
hbox.MinWidth = 943;
hbox.PackStart(this.treeView);
hbox.PackStart(this.plotView, true);
Content = hbox;
this.SelectedExample = this.Examples.FirstOrDefault();
this.Title = "OxyPlot.Xwt Example Browser";
this.CloseRequested += (s, a) => Application.Exit ();
}
开发者ID:oxyplot,项目名称:oxyplot-xwt,代码行数:60,代码来源:MainWindow.cs
示例9: Tree
public Tree(string[] args)
{
Application.Init ();
store = new TreeStore (typeof (string), typeof (string));
Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null );
gxml.Autoconnect( this );
window.Resize(500, 400 );
// eventos
window.DeleteEvent += new DeleteEventHandler( Salir );
b_agregar.Clicked += new EventHandler( Agregar );
b_eliminar.Clicked += new EventHandler( Borrar );
b_limpiar.Clicked += new EventHandler( Limpiar );
b_salir.Clicked += new EventHandler( Cerrar );
// crear arbol
tv = new TreeView ();
tv.Model = store;
tv.HeadersVisible = true;
tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0);
tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1);
scrolledwindow1.Add (tv);
window.ShowAll ();
Application.Run ();
}
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:30,代码来源:tree.cs
示例10: ImageInfo
public ImageInfo () : base (null, null)
{
store = new TreeStore ((int)TypeFundamentals.TypeString,
(int)TypeFundamentals.TypeString);
tv = new TreeView (store);
tv.HeadersVisible = true;
TreeViewColumn NameCol = new TreeViewColumn ();
CellRenderer NameRenderer = new CellRendererText ();
NameCol.Title = "Name";
NameCol.PackStart (NameRenderer, true);
NameCol.AddAttribute (NameRenderer, "markup", 0);
tv.AppendColumn (NameCol);
TreeViewColumn ValueCol = new TreeViewColumn ();
CellRenderer ValueRenderer = new CellRendererText ();
ValueCol.Title = "Value";
ValueCol.PackStart (ValueRenderer, false);
ValueCol.AddAttribute (ValueRenderer, "text", 1);
tv.AppendColumn (ValueCol);
//
// Populate tree
//
TreeIter iter = new TreeIter ();
PopulateGeneral (out iter);
PopulateDetails (out iter);
Add (tv);
}
开发者ID:emtees,项目名称:old-code,代码行数:32,代码来源:ImageInfo.cs
示例11: GtkSharpVectorViewer
public GtkSharpVectorViewer(string[] args)
{
XML glade = new XML (null, "svg-viewer.glade", "MainWindow", null);
glade.Autoconnect (this);
glade["bgEventBox"].ModifyBg(StateType.Normal, glade["MainWindow"].Style.Background (Gtk.StateType.Active));
svgWidget = new SvgImageWidget();
// mainPaned.Add2 (svgWidget);
// mainPaned.Pack2 (svgWidget, false, false);
// mainHBox.PackStart (svgWidget, true, true, 0);
(glade["svgViewport"] as Viewport).Add(svgWidget);
svgWidget.Show();
testsStore = new TreeStore(typeof(string));
testsTreeView.Model = testsStore;
testsTreeView.AppendColumn("Test Name", new CellRendererText(), "text", 0);
if (args.Length > 0) {
LoadUri (new Uri(args[0]));
}
AddW3CTests ();
}
开发者ID:codebutler,项目名称:savagesvg,代码行数:27,代码来源:GtkSharpVectorViewer.cs
示例12: ProjectSelectDialog
public ProjectSelectDialog(Microsoft.TeamFoundation.Client.ProjectCollection projectCollection)
{
this.projectCollection = projectCollection;
_treeStore = new TreeStore(_name, _path);
BuildGui();
FillTreeView();
}
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:8,代码来源:ProjectSelectDialog.cs
示例13: MainWindow
public MainWindow()
{
Menu menu = new Menu ();
var file = new MenuItem ("File");
file.SubMenu = new Menu ();
file.SubMenu.Items.Add (new MenuItem ("Open"));
file.SubMenu.Items.Add (new MenuItem ("New"));
file.SubMenu.Items.Add (new MenuItem ("Close"));
menu.Items.Add (file);
var edit = new MenuItem ("Edit");
edit.SubMenu = new Menu ();
edit.SubMenu.Items.Add (new MenuItem ("Copy"));
edit.SubMenu.Items.Add (new MenuItem ("Cut"));
edit.SubMenu.Items.Add (new MenuItem ("Paste"));
menu.Items.Add (edit);
MainMenu = menu;
HBox box = new HBox ();
icon = Image.FromResource (typeof(App), "class.png");
store = new TreeStore (nameCol, iconCol, widgetCol);
samplesTree = new TreeView ();
samplesTree.Columns.Add ("Name", iconCol, nameCol);
AddSample (null, "Boxes", typeof(Boxes));
AddSample (null, "Buttons", typeof(ButtonSample));
AddSample (null, "ComboBox", typeof(ComboBoxes));
// AddSample (null, "Designer", typeof(Designer));
AddSample (null, "Drag & Drop", typeof(DragDrop));
var n = AddSample (null, "Drawing", null);
AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget));
AddSample (n, "Chart", typeof(ChartSample));
AddSample (n, "Transformations", typeof(DrawingTransforms));
AddSample (null, "Images", typeof(Images));
AddSample (null, "List View", typeof(ListView1));
AddSample (null, "Notebook", typeof(NotebookSample));
// AddSample (null, "Scroll View", typeof(ScrollWindowSample));
AddSample (null, "Text Entry", typeof(TextEntries));
AddSample (null, "Windows", typeof(Windows));
samplesTree.DataSource = store;
box.PackStart (samplesTree);
sampleBox = new VBox ();
title = new Label ("Sample:");
sampleBox.PackStart (title, BoxMode.None);
box.PackStart (sampleBox, BoxMode.FillAndExpand);
Content = box;
samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
}
开发者ID:carlosalberto,项目名称:xwt,代码行数:58,代码来源:MainWindow.cs
示例14: OnTilesetChanged
private void OnTilesetChanged(Level level)
{
Tileset tileset = level.Tileset;
TreeStore store = new TreeStore(typeof(Tilegroup));
foreach(Tilegroup group in tileset.Tilegroups.Values) {
store.AppendValues(group);
}
Model = store;
}
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:10,代码来源:TileGroupSelector.cs
示例15: 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;
}
开发者ID:ZaneMiller,项目名称:EMUlsifier,代码行数:14,代码来源:MainWindow.cs
示例16: ChooseProjectsDialog
public ChooseProjectsDialog(TeamFoundationServer server)
{
collectionStore = new ListStore(collectionName, collectionItem);
projectsStore = new TreeStore(isProjectSelected, projectName, projectItem);
BuildGui();
if (server.ProjectCollections == null)
SelectedProjects = new List<ProjectInfo>();
else
SelectedProjects = new List<ProjectInfo>(server.ProjectCollections.SelectMany(pc => pc.Projects));
LoadData(server);
}
开发者ID:BHamrin,项目名称:monodevelop-tfs-addin,代码行数:11,代码来源:ChooseProjectsDialog.cs
示例17: CodeIssuePadControl
public CodeIssuePadControl ()
{
runButton.Clicked += StartAnalyzation;
PackStart (runButton, BoxMode.None);
store = new TreeStore (text, region);
view.DataSource = store;
view.HeadersVisible = false;
view.Columns.Add ("Name", text);
PackStart (view, BoxMode.FillAndExpand);
}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:13,代码来源:CodeIssuePad.cs
示例18: CreateScrollableWidget
public override IScrollableWidget CreateScrollableWidget ()
{
DataField<string> text = new DataField<string> ();
TreeStore s = new TreeStore (text);
var list = new TreeView (s);
list.Columns.Add ("Hi", text);
for (int n = 0; n < 100; n++) {
var r = s.AddNode ();
r.SetValue (text, n + new string ('.',100));
}
return list;
}
开发者ID:m13253,项目名称:xwt,代码行数:13,代码来源:TreeViewTests.cs
示例19: buildLinksTree
protected void buildLinksTree()
{
//defind datatype of data in the TreeStore
ts = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string));
tv = new TreeView (ts);
tv.HeadersVisible = true;
//this tree has 3 columns Title, Link and Flag
tv.AppendColumn ("Title", new CellRendererText (), "text", 0);
tv.AppendColumn ("Flag", new CellRendererText (), "text", 1);
tv.AppendColumn ("Link", new CellRendererText (), "text", 2);
swLinks.Add (tv);
swLinks.ShowAll ();
tv.RowActivated += tvRowActivated;
}
开发者ID:voidcode,项目名称:LAdd,代码行数:14,代码来源:MainWindow.cs
示例20: CodeIssuePadControl
public CodeIssuePadControl ()
{
var buttonRow = new HBox();
runButton.Clicked += StartAnalyzation;
buttonRow.PackStart (runButton);
cancelButton.Clicked += StopAnalyzation;
cancelButton.Sensitive = false;
buttonRow.PackStart (cancelButton);
var groupingProvider = new CategoryGroupingProvider {
Next = new ProviderGroupingProvider()
};
rootGroup = new IssueGroup (groupingProvider, "root group");
var groupingProviderControl = new GroupingProviderChainControl (rootGroup, groupingProviders);
buttonRow.PackStart (groupingProviderControl);
PackStart (buttonRow);
store = new TreeStore (textField, nodeField);
view.DataSource = store;
view.HeadersVisible = false;
view.Columns.Add ("Name", textField);
view.SelectionMode = SelectionMode.Multiple;
view.RowActivated += OnRowActivated;
view.RowExpanding += OnRowExpanding;
view.ButtonPressed += HandleButtonPressed;
view.ButtonReleased += HandleButtonReleased;
PackStart (view, true);
IIssueTreeNode node = rootGroup;
node.ChildrenInvalidated += (sender, group) => {
Application.Invoke (delegate {
ClearSiblingNodes (store.GetFirstNode ());
store.Clear ();
SyncStateToUi (runner.State);
foreach(var child in ((IIssueTreeNode)rootGroup).Children) {
var navigator = store.AddNode ();
SetNode (navigator, child);
SyncNode (navigator);
}
});
};
node.ChildAdded += HandleRootChildAdded;
runner.IssueSink = rootGroup;
runner.AnalysisStateChanged += HandleAnalysisStateChanged;
}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:49,代码来源:CodeIssuePad.cs
注:本文中的TreeStore类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论