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


C# ListStore.IterNChildren方法代码示例

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


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

示例1: SaveList

 public static void SaveList(ListStore list, string path)
 {
     path = path + "streams.list";
     File.Delete(path);
     for (int i = 0; i < list.IterNChildren(); i++) {
         TreeIter iter;
         list.GetIterFromString (out iter, i.ToString ());
         File.AppendAllText(path, list.GetValue(iter, 0).ToString());
         File.AppendAllText(path, " ");
         File.AppendAllText(path, list.GetValue(iter, 1).ToString());
         File.AppendAllText(path, "\n");
     }
 }
开发者ID:veridiam,项目名称:glivestreamer,代码行数:13,代码来源:MainWindow.cs

示例2: PopulateForm

		public void PopulateForm ()
		{
			//for (int i = 0; i < comboboxDevices.Model.IterNChildren(); i++)
			//	comboboxDevices.RemoveText(i);
			/*
			List<String> deviceNames = new List<string> ();
			foreach (LedController controller in Manager.Controllers) {
				deviceNames.Add (controller.DeviceVisibleName);
			}
			deviceNames.Sort ();
			*/
			string previousDeviceSerial = "";
			if (comboboxDevices.Active >= 0)
				previousDeviceSerial = DeviceEntities[comboboxDevices.Active].Serial;

			ListStore store = new ListStore(typeof (string));
			comboboxDevices.Model = store;

			DeviceEntities = Manager.GetOnlineDeviceList();

			int previousDeviceIndex = -1;
			int index = -1;
			foreach (DeviceEntity entity in DeviceEntities) {
				store.AppendValues(entity.ToString());

				index++;

				if (entity.ToString() == previousDeviceSerial)
				{
					previousDeviceIndex = index;
				}
			}

			SelectedController = null;

			if (store.IterNChildren() >= 1 && previousDeviceIndex == -1)
			{
				comboboxDevices.Active = 0;
			}
			else if (previousDeviceIndex >= 0)
			{
				comboboxDevices.Active = previousDeviceIndex;
			}
			else
			{
				UpdateFormComponents();
			}
		}
开发者ID:pipermatt,项目名称:blinkstick-client,代码行数:48,代码来源:BlinkStickTestForm.cs

示例3: ConnectDialog

        public ConnectDialog()
            : base(Gui.MainWindow.Window, "ConnectDialog")
        {
            store = new ListStore(typeof(object), typeof(string));
            ipCombo.Model = store;
            ipCombo.TextColumn = 1;

            CellRendererPixbuf imageCell = new CellRendererPixbuf();
            CellRendererText textCell = new CellRendererText();
            ipCombo.Clear();
            ipCombo.PackStart(imageCell, false);
            ipCombo.PackStart(textCell, true);
            ipCombo.SetCellDataFunc(imageCell, ShowImage);
            ipCombo.SetCellDataFunc(textCell, ShowText);
            ipCombo.WrapWidth = 3;
            ipCombo.Entry.ActivatesDefault = true;
            PopulateAddressCombo();

            networksListStore = new ListStore(typeof(object));
            networksListStore.AppendValues(new object());
            foreach (Network network in Core.Networks) {
                networksListStore.AppendValues(network);
            }

            networksComboBox.Clear();

            CellRendererText networkNameCell = new CellRendererText();
            networksComboBox.PackStart(networkNameCell, false);
            networksComboBox.SetCellDataFunc(networkNameCell, new CellLayoutDataFunc(NetworkTextFunc));
            networksComboBox.Model = networksListStore;
            networksComboBox.Changed += delegate { PopulateAddressCombo(); };
            networksComboBox.Active = Math.Min(networksListStore.IterNChildren(), 1);

            notImage = Gui.LoadIcon(16, "dialog-warning");
            localImage = Gui.LoadIcon(16, "stock_channel");
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:36,代码来源:ConnectDialog.cs

示例4: BuildCombo

        private Widget BuildCombo(PipelineVariable variable)
        {
            ListStore model = new ListStore(typeof(string), typeof(string));
            PipelineVariableComboBox box = new PipelineVariableComboBox(variable, model);
            TreeIter active_iter = TreeIter.Zero;

            box.Changed += OnComboChanged;

            if(variable.PossibleValuesCount > 0) {
                foreach(string key in variable.PossibleValuesKeys) {
                    TreeIter iter = ComboAppend(model, variable, variable.PossibleValues[key].Display, key);

                    if(variable.CurrentValue == key || (active_iter.Equals(TreeIter.Zero) &&
                        variable.DefaultValue == key)) {
                        active_iter = iter;
                    }
                }
            } else {
                double min = variable.MinValue;
                double max = variable.MaxValue;
                double step = variable.StepValue;
                double current = min;

                for(; current <= max; current += step) {
                    ComboAppend(model, variable, current.ToString(), current.ToString());
                }
            }

            if(active_iter.Equals(TreeIter.Zero)) {
                for(int i = 0, n = model.IterNChildren(); i < n; i++) {
                    TreeIter iter;
                    if(model.IterNthChild(out iter, i)) {
                        string value = (string)model.GetValue(iter, 1);
                        if(value == variable.CurrentValue) {
                            active_iter = iter;
                            break;
                        }
                    }
                }
            }

            CellRendererText text_renderer = new CellRendererText();
            box.PackStart(text_renderer, true);
            box.AddAttribute(text_renderer, "text", 0);

            box.Model = model;

            if(active_iter.Equals(TreeIter.Zero)) {
                if(model.IterNthChild(out active_iter, 0)) {
                    box.SetActiveIter(active_iter);
                }
            } else {
                box.SetActiveIter(active_iter);
            }

            return box;
        }
开发者ID:knocte,项目名称:banshee,代码行数:57,代码来源:ProfileConfigurationDialog.cs

示例5: SharedConstructor

        private void SharedConstructor()
        {
            fileListStore = new ListStore(typeof(string));
            fileList.Model = fileListStore;
            TreeViewColumn theCol = fileList.AppendColumn("File Attachments", new CellRendererText(), "text", 0 );
            theCol.Sizing = TreeViewColumnSizing.Autosize;

            networksListStore = new ListStore(typeof (object));
            networksListStore.AppendValues(new object());
            foreach (Network network in Core.Networks) {
                networksListStore.AppendValues (network);
            }
            networksComboBox.Clear ();
            CellRendererText networkNameCell = new CellRendererText ();
            networksComboBox.PackStart (networkNameCell, true);
            networksComboBox.SetCellDataFunc (networkNameCell, NetworkTextFunc);
            networksComboBox.Model = networksListStore;

            networksComboBox.Active = Math.Min(networksListStore.IterNChildren(), 1);
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:20,代码来源:EditMemoDialog.cs

示例6: SetupProviders

        private void SetupProviders()
        {
            providers = Daemon.GetProviders ();

            providerStore = new ListStore (typeof (string), typeof (string));
            providerCombo.Model = providerStore;

            CellRendererText renderer = new CellRendererText ();
            providerCombo.PackStart (renderer, false);
            providerCombo.AddAttribute (renderer, "text", 0);

            foreach (Provider p in providers) {
                if (p.Plugin != "beagle") {
                    providerStore.AppendValues (p.Name, p.Plugin);
                }
            }

            if (providerStore.IterNChildren () == 0) {
                providerRadio.Sensitive = false;
                providerCombo.Sensitive = false;
                specifyRadio.Active = true;

                providerStore.AppendValues ("None", "None");
                providerCombo.Active = 0;
            } else {
                providerCombo.Active = 0;
            }

            beagleRadio.Sensitive = FindProvider ("beagle") != null;
        }
开发者ID:snorp,项目名称:tangerine,代码行数:30,代码来源:PropertiesWindow.cs

示例7: JoinChatroomDialog

        public JoinChatroomDialog(Window parent)
            : base(parent, "JoinChatroomDialog")
        {
            passwordEntry.Text = "";

            networksListStore = new ListStore (typeof (object));
            networksListStore.AppendValues (new object());
            foreach (Network network in Core.Networks) {
                networksListStore.AppendValues (network);
            }

            roomListStore = new ListStore (typeof(string), typeof(ChatRoom));

            CellRendererText textCell = new CellRendererText ();
            networkCombo.PackStart (textCell, true);
            networkCombo.SetCellDataFunc (textCell, new CellLayoutDataFunc (networkComboBox_TextFunc));
            networkCombo.Model = networksListStore;

            roomNameCombo.Entry.Changed += roomNameCombo_Entry_Changed;
            roomNameCombo.Entry.ActivatesDefault = true;
            roomNameCombo.Entry.Text = "#";

            var imageCell = new CellRendererPixbuf ();
            roomNameCombo.PackEnd(imageCell, false);
            roomNameCombo.SetCellDataFunc(imageCell, RoomComboImageFunc);

            roomNameCombo.Model = roomListStore;
            roomNameCombo.TextColumn = 0;

            if (networksListStore.IterNChildren() > 0) {
                networkCombo.Active = 1;
                roomNameCombo.Entry.GrabFocus();
                roomNameCombo.Entry.SelectRegion(1,1);
            } else {
                networkCombo.Active = 0;
            }

            base.Dialog.Shown += delegate {
                roomNameCombo.Entry.SelectRegion (1,1);
            };

            EnableDisableOkButton();
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:43,代码来源:JoinChatroomDialog.cs


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