当前位置: 首页>>代码示例>>C#>>正文


C# TreeModel.IterParent方法代码示例

本文整理汇总了C#中TreeModel.IterParent方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.IterParent方法的具体用法?C# TreeModel.IterParent怎么用?C# TreeModel.IterParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeModel的用法示例。


在下文中一共展示了TreeModel.IterParent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PixbufCellDataFunc

		void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			TreeIter parent;
			bool toplevel = !model.IterParent (out parent, iter);
			
			var crp = (CellRendererPixbuf) cell;
			crp.Visible = !toplevel;
			
			if (toplevel) {
				return;
			}
			
			var section = (OptionsDialogSection) model.GetValue (iter, 0);
			
			//HACK: The mimetype panels can't register a single fake stock ID for all the possible image size.
			// Instead, give this some awareness of the mime system.
			var mimeSection = section as MonoDevelop.Ide.Projects.OptionPanels.MimetypeOptionsDialogSection;
			if (mimeSection != null && !string.IsNullOrEmpty (mimeSection.MimeType)) {
				var pix = DesktopService.GetPixbufForType (mimeSection.MimeType, treeIconSize);
				if (pix != null) {
					crp.Pixbuf = pix;
				} else {
					crp.Pixbuf = ImageService.GetPixbuf (emptyCategoryIcon, treeIconSize);
				}
			} else {
				string icon = section.Icon.IsNull? emptyCategoryIcon : section.Icon.ToString ();
				crp.Pixbuf = ImageService.GetPixbuf (icon, treeIconSize);
			}
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:29,代码来源:OptionsDialog.cs

示例2: TextCellDataFunc

		void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			TreeIter parent;
			bool toplevel = !model.IterParent (out parent, iter);
			
			var crt = (CellRendererText) cell;
			var section = (OptionsDialogSection) model.GetValue (iter, 0);
			
			if (toplevel) {
				crt.Markup = "<b>" + GLib.Markup.EscapeText (section.Label) + "</b>";
			} else {
				crt.Text = section.Label;
			}
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:14,代码来源:OptionsDialog.cs

示例3: PixbufDataFunc

        void PixbufDataFunc(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            CellRendererPixbuf renderer = cell as CellRendererPixbuf;

            string stock;
            var uri = folder_tree_model.GetUriByIter (iter);
            if (uri == null)
                return;
            File file = FileFactory.NewForUri (uri);
            try {
                FileInfo info =
                    file.QueryInfo ("standard::icon", FileQueryInfoFlags.None, null);

                ThemedIcon themed_icon = info.Icon as ThemedIcon;
                if (themed_icon != null && themed_icon.Names.Length > 0)
                    stock = themed_icon.Names[0];
                else
                    stock = "gtk-directory";

            } catch (Exception) {
                stock = "gtk-directory";
            }

            TreeIter tmp;
            if (tree_model.IterParent (out tmp, iter)) {
                renderer.IconName = stock;
                renderer.CellBackground = null;
            } else {
                renderer.IconName = stock;
                renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
            }
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:32,代码来源:FolderTreeView.cs

示例4: FolderDataFunc

        void FolderDataFunc(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            CellRendererTextProgress renderer = cell as CellRendererTextProgress;

            int progress_value = 0;
            int count = (tree_model as FolderTreeModel).Count;

            if (count != 0)
                progress_value = (int) ((100.0 * folder_tree_model.GetPhotoCountByIter (iter)) / count);

            renderer.Value = progress_value;

            string text = folder_tree_model.GetFolderNameByIter (iter);

            TreeIter tmp;
            if (tree_model.IterParent (out tmp, iter)) {
                renderer.UseMarkup = false;
                renderer.Text = text;
                renderer.CellBackground = null;
            } else {
                renderer.UseMarkup = true;

                /* since import do not use GIO at the moment, no other prefix than file:/// is
                 * possible.
                 */
                if (text == Uri.UriSchemeFile)
                    renderer.Text = String.Format ("<b>{0}</b>", Catalog.GetString ("Filesystem"));
                else
                    renderer.Text = String.Format ("<b>{0}</b>", text);

                renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
            }
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:33,代码来源:FolderTreeView.cs

示例5: FilterEmptySections

        // Widget: tvBgList
        // Don't show sections that are empty
        private bool FilterEmptySections(TreeModel model, TreeIter iter)
        {
            TreeIter    parent;
            string key = (string) model.GetValue(iter, 0);

            // Always draw all wallpapers
            if (key != null)
                return true;

            if (model.IterParent(out parent, iter)) {
                if (model.IterNChildren(parent) >= 2)
                    return false;
            }

            return true;
        }
开发者ID:mtanski,项目名称:drapes,代码行数:18,代码来源:ConfigMenu.cs

示例6: OnGameSelected

    /// <summary>
    /// Called when a game is selected in the libaray
    /// </summary>
    /// <param name="game">Game.</param>
    protected void OnGameSelected(Game game, TreeModel model, TreeIter child)
    {
        activeEmulator = null;
        activeGame = game;

        TreeIter iter;
        if (model.IterParent (out iter, child))
            activeEmulator = (Emulator)model.GetValue (iter, 0);

        GameView.SetModels (activeGame, activeEmulator);

        SetActionSensitivity ();
    }
开发者ID:ZaneMiller,项目名称:EMUlsifier,代码行数:17,代码来源:MainWindow.cs

示例7: ShowItemMarketDetails

    void ShowItemMarketDetails(ECM.EveItem item, TreeModel model, TreeIter iter)
    {
        ntbMarketDetails.CurrentPage = 0;

        foreach (Widget w in hbxItemPath.Children)
        {
            hbxItemPath.Remove(w);
            w.Destroy();
        }

        // First work out the tree path
        TreeIter parentIter;
        string path = "";
        long ID = 0;
        while (model.IterParent(out parentIter, iter))
        {
            iter = parentIter;
            path = model.GetValue(parentIter, 1).ToString();
            ID = Convert.ToInt64(model.GetValue(iter, 2));

            ECM.EveMarketGroup g = ECM.ItemDatabase.MarketGroups[ID];

            Button btn = new Button(new Label(path));
            btn.Relief = ReliefStyle.None;

            btn.Clicked += delegate(object sender, EventArgs e)
            {
                SelectItemInMarket(g);
            };

            hbxItemPath.PackEnd(new Label("\\"));
            hbxItemPath.PackEnd(btn);
        }

        hbxItemPath.ShowAll();

        lblItemNameDetails.Markup = string.Format("<b>{0}</b>", item.Name);
        imgItemIconDetails.PixbufAnimation = new Gdk.PixbufAnimation(ECM.Core.LoadingSpinnerGIF);

        BackgroundWorker fetchImage = new BackgroundWorker();
        fetchImage.DoWork += delegate(object sender, DoWorkEventArgs e)
        {
            imgItemIconDetails.Pixbuf = ECM.API.ImageApi.GetItemImageGTK(item.ID, ECM.API.ImageApi.ImageRequestSize.Size64x64);
        };

        btnShowRender.Name = item.ID.ToString();
        btnShowRender.Sensitive = true;

        fetchImage.RunWorkerAsync();

        //lblItemTreeDetails.Visible = true;
        imgItemIconDetails.Visible = true;
        btnItemInfo.Visible = true;
        vbxBuySell.Visible = true;
        frmItemImage.ShadowType = ShadowType.EtchedOut;
    }
开发者ID:SilkyPantsDan,项目名称:ECM,代码行数:56,代码来源:MainWindow.Market.cs


注:本文中的TreeModel.IterParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。