static void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, XContainer p) { foreach (XNode n in p.Nodes) { Gtk.TreeIter childIter; if (!parent.Equals (Gtk.TreeIter.Zero)) childIter = store.AppendValues (parent, n); else childIter = store.AppendValues (n); XContainer c = n as XContainer; if (c != null && c.FirstChild != null) BuildTreeChildren (store, childIter, c); } }
public static void CargarListaCafeteria(ref Gtk.ListStore listaStore) { listaStore.Clear(); MySQL.consultar("SELECT `ID_articulo`, `descripcion`, `precio` FROM cafeteria_articulos"); /* // Miremos primero si no han agregado este articulo a la lista TreeIter iter = new TreeIter(); Boolean Encontrado = false; if (MySQL.Reader.Read() && tvLista.Model.GetIterFirst(ref iter)) { do { if (tvLista.Model.GetValue(iter,0).ToString() == MySQL.Reader["ID_articulo"].ToString()) { int CantidadActual = int.Parse(tvLista.Model.GetValue (iter, 1).ToString()); tvLista.Model.SetValue(iter,1,++CantidadActual); Encontrado = true; } } while(tvLista.Model.IterNext(ref iter)); } if (!Encontrado && MySQL.Reader.HasRows) listaStore.AppendValues (MySQL.Reader["ID_articulo"].ToString(),MySQL.Reader["codigo_barra"].ToString(), 0, MySQL.Reader["descripcion"].ToString(),double.Parse(MySQL.Reader["precio"].ToString())); */ while (MySQL.Reader.Read()) listaStore.AppendValues (MySQL.Reader["ID_articulo"].ToString(), 0, MySQL.Reader["descripcion"].ToString(),double.Parse(MySQL.Reader["precio"].ToString())); }
private static void SetChildItems(Gtk.TreeStore syncItems, Gtk.TreeIter iter, IEnumerable<SyncItem> items) { foreach (var item in items) { var childIter = syncItems.AppendValues(iter, item); if (item.ChildItems.Count > 0) { SetChildItems(syncItems, childIter, item.ChildItems.Values); } } }
public static void LoadCertificateTree(Gtk.TreeStore certStore) { foreach (EveCertGroup group in m_CertGroups.Values) { Gtk.TreeIter groupIter = certStore.AppendValues(group.Name, -1, group.ID, true); group.TreeReference = new Gtk.TreeRowReference(certStore, certStore.GetPath(groupIter)); } foreach (EveCertificate cert in m_Certificates.Values) { EveCertGroup group = m_CertGroups[cert.GroupID]; Gtk.TreeIter groupIter; Gtk.TreeIter certIter; if (certStore.GetIter(out groupIter, group.TreeReference.Path)) { certIter = certStore.AppendValues(groupIter, cert.Name, cert.Grade, cert.ID, false); cert.TreeReference = new Gtk.TreeRowReference(certStore, certStore.GetPath(certIter)); } } }
void showpowers(Gtk.TreeStore store,GroupPowers powers) { Gtk.TreeIter iterx; bool test; iterx = store.AppendValues(folder_open, "Membership Managment", GroupPowers.None); test=(powers & GroupPowers.Invite) == GroupPowers.Invite; store.AppendValues(iterx,test?tick:cross,"Invite people to group",GroupPowers.Invite); test=(powers & GroupPowers.Eject) == GroupPowers.Eject; store.AppendValues(iterx,test?tick:cross,"Eject members",GroupPowers.Eject); test=(powers & GroupPowers.ChangeOptions) == GroupPowers.ChangeOptions; //????????? store.AppendValues(iterx,test?tick:cross,"Toggle Open Enrollment",GroupPowers.ChangeOptions); iterx = store.AppendValues(folder_open, "Roles", GroupPowers.None); test=(powers & GroupPowers.CreateRole) == GroupPowers.CreateRole; //????????? store.AppendValues(iterx,test?tick:cross,"Toggle Open Enrollment",GroupPowers.CreateRole); test=(powers & GroupPowers.DeleteRole) == GroupPowers.DeleteRole; //????????? store.AppendValues(iterx,test?tick:cross,"Delete ROles",GroupPowers.DeleteRole); test=(powers & GroupPowers.RoleProperties) == GroupPowers.RoleProperties; //????????? store.AppendValues(iterx,test?tick:cross,"Change ROle names,titles",GroupPowers.RoleProperties); test=(powers & GroupPowers.AssignMemberLimited) == GroupPowers.AssignMemberLimited; //????????? store.AppendValues(iterx,test?tick:cross,"Assign Members to Assigners Role",GroupPowers.AssignMemberLimited); test=(powers & GroupPowers.AssignMember) == GroupPowers.AssignMember; //????????? store.AppendValues(iterx,test?tick:cross,"Assign Members to Any Role",GroupPowers.AssignMember); test=(powers & GroupPowers.RemoveMember) == GroupPowers.RemoveMember; //????????? store.AppendValues(iterx,test?tick:cross,"Remove Members from Roles",GroupPowers.RemoveMember); test=(powers & GroupPowers.ChangeIdentity) == GroupPowers.ChangeIdentity; //????????? store.AppendValues(iterx,test?tick:cross,"Assign and Remove Abilities",GroupPowers.ChangeIdentity); iterx = store.AppendValues(folder_open, "Parcel Managment", GroupPowers.None); test=(powers & GroupPowers.LandDeed) == GroupPowers.LandDeed; //????????? store.AppendValues(iterx,test?tick:cross,"Deed land and buy land for group",GroupPowers.LandDeed); test=(powers & GroupPowers.LandRelease) == GroupPowers.LandRelease; //????????? store.AppendValues(iterx,test?tick:cross,"Abandon land",GroupPowers.LandRelease); test=(powers & GroupPowers.LandSetSale) == GroupPowers.LandSetSale; //????????? store.AppendValues(iterx,test?tick:cross,"Set land for sale info",GroupPowers.LandSetSale); test=(powers & GroupPowers.LandDivideJoin) == GroupPowers.LandDivideJoin; store.AppendValues(iterx,test?tick:cross,"Join and Divide Parcels",GroupPowers.LandDivideJoin); iterx = store.AppendValues(folder_open, "Parcel Identy", GroupPowers.None); test=(powers & GroupPowers.FindPlaces) == GroupPowers.FindPlaces; store.AppendValues(iterx,test?tick:cross,"Toggle show in Find Places",GroupPowers.FindPlaces); test=(powers & GroupPowers.LandChangeIdentity) == GroupPowers.LandChangeIdentity; store.AppendValues(iterx,test?tick:cross,"Change parcel name and Description",GroupPowers.LandChangeIdentity); test=(powers & GroupPowers.SetLandingPoint) == GroupPowers.SetLandingPoint; store.AppendValues(iterx,test?tick:cross,"Set Landing point",GroupPowers.SetLandingPoint); iterx = store.AppendValues(folder_open, "Parcel Settings", GroupPowers.None); test=(powers & GroupPowers.ChangeMedia) == GroupPowers.ChangeMedia; store.AppendValues(iterx,test?tick:cross,"Change music & media settings",GroupPowers.ChangeMedia); test=(powers & GroupPowers.ChangeOptions) == GroupPowers.ChangeOptions; store.AppendValues(iterx,test?tick:cross,"Toggle various about->land options",GroupPowers.ChangeOptions); iterx = store.AppendValues(folder_open, "Parcel Powers", GroupPowers.None); test=(powers & GroupPowers.AllowEditLand) == GroupPowers.AllowEditLand; store.AppendValues(iterx,test?tick:cross,"Always allow Edit Terrain",GroupPowers.AllowEditLand); test=(powers & GroupPowers.AllowFly) == GroupPowers.AllowFly; store.AppendValues(iterx,test?tick:cross,"Always allow fly",GroupPowers.AllowFly); test=(powers & GroupPowers.AllowRez) == GroupPowers.AllowRez; store.AppendValues(iterx,test?tick:cross,"Always allow Create Objects",GroupPowers.AllowRez); test=(powers & GroupPowers.AllowLandmark) == GroupPowers.AllowLandmark; store.AppendValues(iterx, test?tick:cross, "Always allow Create Landmarks", GroupPowers.AllowLandmark); test=(powers & GroupPowers.AllowSetHome) == GroupPowers.AllowSetHome; store.AppendValues(iterx,test?tick:cross,"Allow Set Home to Hete on group land",GroupPowers.AllowSetHome); iterx = store.AppendValues(folder_open, "Parcel Access", GroupPowers.None); test=(powers & GroupPowers.LandManageAllowed) == GroupPowers.LandManageAllowed; store.AppendValues(iterx,test?tick:cross,"Manage parcel Access lists",GroupPowers.LandManageAllowed); test=(powers & GroupPowers.LandManageBanned) == GroupPowers.LandManageBanned; store.AppendValues(iterx,test?tick:cross,"Manage Ban lists",GroupPowers.LandManageBanned); test=(powers & GroupPowers.LandEjectAndFreeze) == GroupPowers.LandEjectAndFreeze; store.AppendValues(iterx,test?tick:cross,"Eject and freeze Residents on parcel",GroupPowers.LandEjectAndFreeze); iterx = store.AppendValues(folder_open, "Parcel Content", GroupPowers.None); test=(powers & GroupPowers.ReturnGroupOwned) == GroupPowers.ReturnGroupOwned; store.AppendValues(iterx,test?tick:cross,"Return objects owner by group",GroupPowers.ReturnGroupSet); test=(powers & GroupPowers.ReturnGroupSet) == GroupPowers.ReturnGroupSet; store.AppendValues(iterx,test?tick:cross,"Return objects set to group",GroupPowers.ReturnGroupSet); test=(powers & GroupPowers.ReturnNonGroup) == GroupPowers.ReturnNonGroup; store.AppendValues(iterx,test?tick:cross,"Return non-group objects",GroupPowers.ReturnNonGroup); test=(powers & GroupPowers.LandGardening) == GroupPowers.LandGardening; store.AppendValues(iterx,test?tick:cross,"Landscaping using Linden Plants",GroupPowers.LandGardening); iterx = store.AppendValues(folder_open, "Object Managment", GroupPowers.None); test=(powers & GroupPowers.DeedObject) == GroupPowers.DeedObject; store.AppendValues(iterx,test?tick:cross,"Deed objects to group",GroupPowers.DeedObject); test=(powers & GroupPowers.ObjectManipulate) == GroupPowers.ObjectManipulate; store.AppendValues(iterx,test?tick:cross,"Manipulate (move,copy,modify) group objetcs",GroupPowers.ObjectManipulate); test=(powers & GroupPowers.ObjectSetForSale) == GroupPowers.ObjectSetForSale; store.AppendValues(iterx,test?tick:cross,"Set group objects for sale",GroupPowers.ObjectSetForSale); iterx = store.AppendValues(folder_open, "Notices", GroupPowers.None); test=(powers & GroupPowers.SendNotices) == GroupPowers.SendNotices; store.AppendValues(iterx,test?tick:cross,"Send Notices",GroupPowers.SendNotices); test=(powers & GroupPowers.ReceiveNotices) == GroupPowers.ReceiveNotices; store.AppendValues(iterx,test?tick:cross,"Receive Notices and view past Notices",GroupPowers.ReceiveNotices); iterx = store.AppendValues(folder_open, "Proposals", GroupPowers.None); test=(powers & GroupPowers.StartProposal) == GroupPowers.StartProposal; store.AppendValues(iterx,test?tick:cross,"Create Proposals",GroupPowers.StartProposal); test=(powers & GroupPowers.VoteOnProposal) == GroupPowers.VoteOnProposal; store.AppendValues(iterx,test?tick:cross,"Vote on Proposals",GroupPowers.VoteOnProposal); iterx = store.AppendValues(folder_open, "Chat", GroupPowers.None); test=(powers & GroupPowers.JoinChat) == GroupPowers.JoinChat; store.AppendValues(iterx,test?tick:cross,"Join Group Chat",GroupPowers.JoinChat); test=(powers & GroupPowers.AllowVoiceChat) == GroupPowers.AllowVoiceChat; store.AppendValues(iterx,test?tick:cross,"Join Group Voice Chat",GroupPowers.AllowVoiceChat); this.treeview_allowed_ability1.ExpandAll(); }
protected void updateSymbolTable(Hashtable symbolTable, Gtk.ListStore symbolTree) { symbolTree.Clear (); foreach(DictionaryEntry pair in symbolTable) { symbolTree.AppendValues (pair.Key, pair.Value); } }
private void AddNoteToStore(Note note, Gtk.ListStore notesStore) { if (note.TreeIter.Equals (Gtk.TreeIter.Zero)) { note.TreeIter = notesStore.AppendValues (note.Title, note); Debug.Assert(!note.TreeIter.Equals(Gtk.TreeIter.Zero)); } else { notesStore.SetValue(note.TreeIter, (int)NoteCols.Title, note.Title); } }
void AddToTree (Gtk.TreeStore treeStore, Gtk.TreeIter iter, PArray arr) { iterTable[arr] = iter; for (int i = 0; i < arr.Count; i++) { var item = arr[i]; var txt = string.Format (GettextCatalog.GetString ("Item {0}"), i); var subIter = iter.Equals (TreeIter.Zero) ? treeStore.AppendValues (txt, item) : treeStore.AppendValues (iter, txt, item); if (item is PArray) AddToTree (treeStore, subIter, (PArray)item); if (item is PDictionary) AddToTree (treeStore, subIter, (PDictionary)item); if (expandedObjects.Contains (item)) treeview.ExpandRow (treeStore.GetPath (subIter), true); } AddCreateNewEntry (iter); if (!rebuildArrays.Contains (arr)) { rebuildArrays.Add (arr); arr.Changed += HandleArrRebuild; } }
void RefillOutlineStore (T4ParsedDocument doc, Gtk.TreeStore store) { if (doc == null) return; Gdk.Color normal = new Gdk.Color (0x00, 0x00, 0x00); Gdk.Color blue = new Gdk.Color (0x10, 0x40, 0xE0); Gdk.Color green = new Gdk.Color (0x08, 0xC0, 0x30); Gdk.Color orange = new Gdk.Color (0xFF, 0xA0, 0x00); Gdk.Color red = new Gdk.Color (0xC0, 0x00, 0x20); Gtk.TreeIter parent = Gtk.TreeIter.Zero; foreach (Mono.TextTemplating.ISegment segment in doc.TemplateSegments) { Mono.TextTemplating.Directive dir = segment as Mono.TextTemplating.Directive; if (dir != null) { parent = Gtk.TreeIter.Zero; store.AppendValues ("<#@ " + dir.Name + " #>", red, segment); continue; } Mono.TextTemplating.TemplateSegment ts = segment as Mono.TextTemplating.TemplateSegment; if (ts != null) { string name; if (ts.Text.Length > 40) { name = ts.Text.Substring (0, 40) + "..."; } else { name = ts.Text; } name = name.Replace ('\n', ' ').Trim (); if (name.Length == 0) continue; if (ts.Type == Mono.TextTemplating.SegmentType.Expression) { store.AppendValues (parent, "<#= " + name + " #>", orange, segment); } else { if (ts.Type == Mono.TextTemplating.SegmentType.Block) { name = "<#" + name + " #>"; store.AppendValues (name, blue, segment); parent = Gtk.TreeIter.Zero; } else if (ts.Type == Mono.TextTemplating.SegmentType.Helper) { name = "<#+" + name + " #>"; store.AppendValues (name, green, segment); parent = Gtk.TreeIter.Zero; } else if (ts.Type == Mono.TextTemplating.SegmentType.Content) { parent = store.AppendValues (name, normal, segment); } } } } }
//DL rempixbuf // protected bool renderImage(VirtualTreeRow row, VirtualTreeRow childrow) // { //// if ((row.Cells[0].CustomOption != null) && (row.Cells[0].CustomOption.Equals("nopic"))) //// { //// return false; //// } // if (childrow.BaseRow != null) // { // VirtualGridCell cell = childrow.BaseRow.getCell(row.HeaderColumn); // if (cell != null) // { // if (cell.CustomOption.Equals("nopic",StringComparison.OrdinalIgnoreCase)) // { // return false; // } // } // } // // if (row.HeaderColumn.CustomOption.Equals("pixbuf", StringComparison.OrdinalIgnoreCase)) // { // return true; // } // return false; // } protected void addData(Gtk.TreeStore store, Gtk.TreeIter iter, VirtualTreeRow row, bool withiter) { //Console.WriteLine("->" + row.NodeValue); //store.AppendValues(row.Data); foreach (KeyValuePair<String,VirtualTreeRow> kp in row.Children) { //GroupedChildRows grp = kp.Value; VirtualTreeRow childrow = kp.Value; Gtk.TreeIter it; bool wi = withiter; if (! withiter) { //DL rempixbuf // if (renderImage(row, childrow)) // { // it = store.AppendValues(childrow.DataWithImage); // // wi = true; // } //else { it = store.AppendValues(childrow.Data); wi = true; } } else { // if (renderImage(row, childrow)) // { // it = store.AppendValues(iter, childrow.DataWithImage); // } // else // { // // } it = store.AppendValues(iter, childrow.Data); } addData(store,it,childrow,wi); } //foreach //add the data into a row if (row.HeaderColumn.ChildColumn == null) { //startStopWatch("AppendValues"); if ((row.Rows != null) && (row.Rows.Count > 1)) //TODO Count > 1 check .. or option ?? { //foreach (VirtualGridRow vr in row.Rows) int idx = 0; if (SkipFirstChildrow) { idx = 1; } for (int i=idx;i<row.Rows.Count;i++) { VirtualGridRow vr = row.Rows[i]; //DL rempixbuf // bool tmp = LoadPixBuf; // if (!PixBufInRow) // { // LoadPixBuf = false; // } store.AppendValues(iter,vr.Datas); //DL rempixbuf //LoadPixBuf = tmp; } } //stopStopWatch("AppendValues"); } }
void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, ParentNode p, IList<Block> blocks) { foreach (Node node in p) { if (!(node is TagNode)) { var startLoc = new TextLocation (node.Location.BeginLine, node.Location.BeginColumn); var endLoc = new TextLocation (node.Location.EndLine, node.Location.EndColumn); var doc = defaultDocument.Editor.Document; var blocksBetween = blocks.Where (n => n.Start.AbsoluteIndex >= doc.GetOffset (startLoc) && n.Start.AbsoluteIndex <= doc.GetOffset (endLoc)); foreach (var block in blocksBetween) { var outlineNode = new OutlineNode (block) { Location = new DomRegion (doc.OffsetToLocation (block.Start.AbsoluteIndex), doc.OffsetToLocation (block.Start.AbsoluteIndex + block.Length)) }; if (!parent.Equals (Gtk.TreeIter.Zero)) store.AppendValues (parent, outlineNode); else store.AppendValues (outlineNode); } continue; } Gtk.TreeIter childIter; if (!parent.Equals (Gtk.TreeIter.Zero)) childIter = store.AppendValues (parent, new OutlineNode(node as TagNode)); else childIter = store.AppendValues (new OutlineNode(node as TagNode)); ParentNode pChild = node as ParentNode; if (pChild != null) BuildTreeChildren (store, childIter, pChild, blocks); } }
static void BuildSubTree(Gtk.TreeStore fileListStore, TreeModelData data) { Gtk.TreeIter subIter = fileListStore.AppendValues(data.Name); foreach (var item in data.GetChildren()) { BuildSubTree(fileListStore, subIter, item); } }
static void BuildListStore(Gtk.ListStore listStore, ListModel model) { foreach (var item in model.GetItems()) { string[] values = new string[] { item.Extension, item.Color.ToString(), item.Description, ListModel.FormatSizeString(item.Bytes), string.Format("{0:P1}", (item.PercentBytes)), item.FileCount.ToString() }; listStore.AppendValues(values); } }
public void FillStoreNames(Gtk.TreeStore tree_store) { XmlDocument doc = this.GetXmlDocument(); XmlNodeList nodelist = doc.SelectNodes("/sites/site/name"); // Iterate on the node set foreach (XmlNode n in nodelist) { Console.WriteLine(n.InnerText); tree_store.AppendValues(n.InnerText); } doc = null; nodelist = null; }
private void AddTagToStore(Tag tag, Gtk.ListStore tagStore) { if(tag.TreeIter.Equals (Gtk.TreeIter.Zero)) { tag.TreeIter = tagStore.AppendValues(tag.Name, tag.Count); Debug.Assert(!tag.TreeIter.Equals(Gtk.TreeIter.Zero)); } else { tagStore.SetValue(tag.TreeIter, (int)TagCols.Count, tag.Count); } }
public void FillStoreNames(Gtk.TreeStore tree_store) { this.LoadConfiguration(); // Populate the model. dbcmd.CommandText = "select name from websites"; IDataReader reader = dbcmd.ExecuteReader(); while (reader.Read()) { string name = reader.GetString(0); tree_store.AppendValues(name); } this.EndConfiguration(); }
public static void LoadSkills(Gtk.TreeStore skillsStore) { Console.WriteLine("Creating Skill TreeStore"); System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew(); Dictionary<long, Gtk.TreeIter> skillGroups = new Dictionary<long, Gtk.TreeIter>(); foreach (EveMarketGroup group in m_MarketGroups.Values) { if (group.ParentID == 150) { Gtk.TreeIter groupIter = skillsStore.AppendNode(); skillsStore.SetValues(groupIter, group.Name, 0, 0, 0, -1, 0, false, group.ID, 0, true); skillGroups.Add(group.ID, groupIter); } } Console.WriteLine("Groups added"); foreach (EveItem item in m_Items.Values) { //Console.WriteLine("Checking item {0}", item.Name); if (skillGroups.ContainsKey(item.MarketGroupID)) { EveSkill skill = item as EveSkill; Gtk.TreeIter parentIter = skillGroups[item.MarketGroupID]; skillsStore.AppendValues(parentIter, skill.Name, skill.Rank, -1, -1, 0, 0, false, skill.ID, 0, false); } } sw.Stop (); Console.WriteLine("Skill TreeStore created in {0}", sw.Elapsed); }
void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, XContainer p, IList<Block> blocks) { foreach (XNode node in p.Nodes) { var el = node as XElement; if (el == null) { var startLoc = node.Region.Begin; var endLoc = node.Region.End; var doc = defaultDocument.Editor.Document; var blocksBetween = blocks.Where (n => n.Start.AbsoluteIndex >= doc.GetOffset (startLoc) && n.Start.AbsoluteIndex <= doc.GetOffset (endLoc)); foreach (var block in blocksBetween) { var outlineNode = new RazorOutlineNode (block) { Location = new DomRegion (doc.OffsetToLocation (block.Start.AbsoluteIndex), doc.OffsetToLocation (block.Start.AbsoluteIndex + block.Length)) }; if (!parent.Equals (Gtk.TreeIter.Zero)) store.AppendValues (parent, outlineNode); else store.AppendValues (outlineNode); } continue; } Gtk.TreeIter childIter; if (!parent.Equals (Gtk.TreeIter.Zero)) childIter = store.AppendValues (parent, new RazorOutlineNode(el)); else childIter = store.AppendValues (new RazorOutlineNode(el)); BuildTreeChildren (store, childIter, el, blocks); } }
public static void LoadMarket(Gtk.TreeStore marketStore, Gtk.ListStore itemStore) { LoadMarket(); foreach(EveMarketGroup group in m_MarketGroups.Values) { Gtk.TreeIter groupIter; Gtk.TreeIter parentIter; if (group.ParentID > -1 && marketStore.GetIter(out parentIter, m_MarketGroups[group.ParentID].TreeReference.Path)) { groupIter = marketStore.AppendNode(parentIter); } else { groupIter = marketStore.AppendNode(); } group.TreeReference = new Gtk.TreeRowReference(marketStore, marketStore.GetPath(groupIter)); marketStore.SetValues(groupIter, new Gdk.Pixbuf(ItemDatabase.GetMarketIconStream(group.IconString)), group.Name, group.ID, group.HasItems, true); } foreach (EveItem item in m_Items.Values) { if (item.MarketGroupID > -1) { Gtk.TreeIter parentIter; if (marketStore.GetIter(out parentIter, m_MarketGroups[item.MarketGroupID].TreeReference.Path)) { Gtk.TreeIter childIter = marketStore.AppendValues(parentIter, null, item.Name, item.ID, false, false); itemStore.AppendValues(item.Name, item.ID); item.TreeReference = new Gtk.TreeRowReference(marketStore, marketStore.GetPath(childIter)); } } } }
void AddToTree (Gtk.TreeStore treeStore, Gtk.TreeIter iter, PDictionary dict) { iterTable[dict] = iter; foreach (var item in dict) { var key = item.Key.ToString (); var subIter = iter.Equals (TreeIter.Zero) ? treeStore.AppendValues (key, item.Value) : treeStore.AppendValues (iter, key, item.Value); if (item.Value is PArray) AddToTree (treeStore, subIter, (PArray)item.Value); if (item.Value is PDictionary) AddToTree (treeStore, subIter, (PDictionary)item.Value); if (expandedObjects.Contains (item.Value)) treeview.ExpandRow (treeStore.GetPath (subIter), true); } AddCreateNewEntry (iter); if (!rebuildArrays.Contains (dict)) { rebuildArrays.Add (dict); dict.Changed += HandleDictRebuild; } }
protected Gtk.TreeIter SetRowValue(Gtk.TreeStore store, Gtk.TreeIter parent, int childIndx, params object[] values) { Gtk.TreeIter child; if (store.IterNthChild(out child, parent, childIndx)) { for (int i=0; i < values.Length; i++) { if (null == values[i]) continue; store.SetValue(child, i, values[i]); } } else child = store.AppendValues (parent, values); return child; }
Gtk.TreeIter AddOption (Gtk.TreeStore model, Gtk.TreeIter parent, string propertyName, string displayName, string example) { bool isBool = false; if (!string.IsNullOrEmpty (propertyName)) { PropertyInfo info = GetPropertyByName (propertyName); isBool = info.PropertyType == typeof (bool); } return model.AppendValues (parent, propertyName, displayName, example, !string.IsNullOrEmpty (propertyName) ? isBool : false, !string.IsNullOrEmpty (propertyName) ? !isBool : false); }
public void parseLines(String line,ref Boolean isComment, int lineNumber, ref Gtk.ListStore lexModel, ref Gtk.ListStore symbolTree, TextView consoleText) { lineNumber += 1; Match m; String matchedString; while (line.Length != 0) { if(isComment) { m = Regex.Match (line, @"^TLDR$"); if (m.Success) { isComment = false; lexModel.AppendValues (m.Value, "End of Multi-Comment"); break; } lexModel.AppendValues (line, "Multi Line Comment"); break; } m = Regex.Match (line, @"^HAI\s*$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Start of Program"); continue; } m = Regex.Match (line, @"^KTHXBYE$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "End of Program"); continue; } m = Regex.Match (line, @"^\s*BTW"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Start of Single Comment"); lexModel.AppendValues (line, "Single Line Comment"); line = line.Remove (0, line.Length); continue; } m = Regex.Match (line, @"^OBTW$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Start of Multi-Comment"); isComment = true; continue; } m = Regex.Match (line, @"^\s*I\s+HAS\s+A\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Var Declaration"); continue; } m = Regex.Match (line, @"^\s*ITZ\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Var Initializer"); continue; } m = Regex.Match (line, @"^\s*R\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Var Assignment"); continue; } m = Regex.Match (line, @"^\s*SUM\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Addition Op"); continue; } m = Regex.Match (line, @"^\s*DIFF\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Subtraction Op"); continue; } m = Regex.Match (line, @"^\s*PRODUKT\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Multiplication Op"); continue; } m = Regex.Match (line, @"^\s*QUOSHUNT\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Division Op"); continue; } m = Regex.Match (line, @"^\s*MOD\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Modulo Op"); continue; } m = Regex.Match (line, @"^\s*BIGGR\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Max Value Op"); continue; } m = Regex.Match (line, @"^\s*SMALLR\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Min Value Op"); continue; } m = Regex.Match (line, @"^\s*BOTH\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "AND Op"); continue; } m = Regex.Match (line, @"^\s*EITHER\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "OR Op"); continue; } m = Regex.Match (line, @"^\s*WON\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "XOR Op"); continue; } m = Regex.Match (line, @"^\s*NOT\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Negation Op"); continue; } m = Regex.Match (line, @"^\s*ALL\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Infinite Arity AND"); continue; } m = Regex.Match (line, @"^\s*ANY\s+OF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Infinite Arity OR"); continue; } m = Regex.Match (line, @"^\s*AN\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Linking Op"); continue; } m = Regex.Match (line, @"^\s*BOTH\s+SAEM\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equality Op"); continue; } m = Regex.Match (line, @"^\s*DIFFRINT\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Inequality Op"); continue; } m = Regex.Match (line, @"^\s*SMOOSH\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "String Concat Op"); continue; } m = Regex.Match (line, @"^\s*MKAY\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "End of Infinite Arity"); continue; } m = Regex.Match (line, @"^\s*WIN\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equivalent to TRUE"); continue; } m = Regex.Match (line, @"^\s*FAIL\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equivalent to FALSE"); continue; } m = Regex.Match (line, @"^\s*MAEK\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Casting Op"); continue; } m = Regex.Match (line, @"^A\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Linking Op"); continue; } m = Regex.Match (line, @"^\s*IS\s+NOW\s+A\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Casting Op"); continue; } m = Regex.Match (line, @"^\s*VISIBLE\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Print Op"); continue; } m = Regex.Match (line, @"^\s*GIMMEH\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Scan Op"); continue; } m = Regex.Match (line, @"^\s*O\s+RLY\?\s*$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Start of If-Then"); continue; } m = Regex.Match (line, @"^\s*YA\s+RLY\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equivalent to IF"); continue; } m = Regex.Match (line, @"^\s*MEBBE\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equivalent to ELSEIF"); continue; } m = Regex.Match (line, @"^\s*NO\s+WAI\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Equivalent to ELSE"); continue; } m = Regex.Match (line, @"^\s*OIC\s*$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "End of Selection Statement"); continue; } m = Regex.Match (line, @"^\s*WTF\?\s*$"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Start of Switch"); continue; } m = Regex.Match (line, @"^\s*OMG\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Case"); continue; } m = Regex.Match (line, @"^\s*GTFO\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Break"); continue; } m = Regex.Match (line, @"^\s*OMGWTF\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Default Case"); continue; } m = Regex.Match (line, @"^\s*[a-zA-Z][a-zA-z\d]*\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Var Identifier"); continue; } m = Regex.Match (line, @"^\s*"""); if (m.Success) { String stringLiteral = ""; line = line.Remove (0, m.Value.Length); matchedString = m.Value; lexModel.AppendValues (matchedString, "Start string Delimiter"); for(; line.Length > 0 && line[0] != '"';) { stringLiteral += line[0]; line = line.Remove(0, 1); } if(line.Length != 0) { lexModel.AppendValues (stringLiteral, "String Literal"); lexModel.AppendValues (line[0] + "", "End string Delimiter"); line = line.Remove(0, 1); } else { //ERROR -> unpaired quotation mark consoleText.Buffer.Text += "Syntax Error at line " + lineNumber + "! (unpaired quotes)\n"; break; } continue; } m = Regex.Match (line, @"^\-?\d*\.\d+\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Numbar Literal"); continue; } m = Regex.Match (line, @"^\-?\d+\s*"); if (m.Success) { line = line.Remove (0, m.Value.Length); matchedString = m.Value; matchedString = matchedString.Trim (); lexModel.AppendValues (matchedString, "Numbr Literal"); continue; } //if does not match any of the above, print error consoleText.Buffer.Text += "Syntax Error at line " + lineNumber + "!\n"; break; } //End of main loop }