protected void OnIV_SelectedServicesItemActivated(object o, ItemActivatedArgs a)
        {
            TreeIter iter;

            IV_SelectedServices.Model.GetIter(out iter, a.Path);
            List <Options> te   = (List <Options>)(IV_SelectedServices.Model.GetValue(iter, 3));
            string         name = (string)(IV_SelectedServices.Model.GetValue(iter, 1));

            if (name != "Свой сервис")
            {
                new OptionsWindow(name, te);
            }
            else
            {
                int      currNumb = -1;
                TreeIter iterTemp;
                SelectedServices.GetIterFirst(out iterTemp);
                while (SelectedServices.IterNext(ref iterTemp))
                {
                    string serviceName = ((List <Options>)SelectedServices.GetValue(iterTemp, 3))[0].Value;
                    if (serviceName.Contains("Свой сервис "))
                    {
                        int numb = Convert.ToInt32(serviceName.Split(' ')[2]);
                        if (currNumb <= numb)
                        {
                            currNumb = numb;
                        }
                    }
                }
                AddToSelectedServices("Свой сервис " + ++currNumb, DefaultServiceIcon);
            }
        }
Example #2
0
        T GetSelectedPolicy()
        {
            int active = policyCombo.Active;

            if (active == 0 && !IsRoot)
            {
                return(bag.Owner.ParentFolder.Policies.Get <T> ());
            }

            TreeIter iter;
            int      i = 0;

            if (store.GetIterFirst(out iter))
            {
                do
                {
                    if (active == i)
                    {
                        PolicySet s = store.GetValue(iter, 1) as PolicySet;
                        if (s != null)
                        {
                            return(s.Get <T> ());
                        }
                        else
                        {
                            return(null);
                        }
                    }
                    i++;
                } while (store.IterNext(ref iter));
            }

            return(null);
        }
Example #3
0
        void downButton_Clicked(object sender, EventArgs e)
        {
            TreeIter  iter, next;
            TreeModel model;

            if (!itemTree.Selection.GetSelected(out model, out iter))
            {
                return;
            }

            //get next iter
            next = iter.Copy();
            if (!itemStore.IterNext(ref next))
            {
                return;
            }

            //swap the two
            itemStore.Swap(iter, next);

            //swap indices too
            object nextVal = itemStore.GetValue(next, 1);
            object iterVal = itemStore.GetValue(iter, 1);

            itemStore.SetValue(next, 1, iterVal);
            itemStore.SetValue(iter, 1, nextVal);
        }
Example #4
0
        public static bool SetActiveText(ComboBox cbox, string text)
        {
            // returns true if found, false if not found

            string    tvalue;
            TreeIter  iter;
            ListStore store = (ListStore)cbox.Model;

            store.IterChildren(out iter);
            tvalue = store.GetValue(iter, 0).ToString();
            if (tvalue.Equals(text))
            {
                cbox.SetActiveIter(iter);
                return(true);
            }
            else
            {
                bool found = store.IterNext(ref iter);
                while (found == true)
                {
                    tvalue = store.GetValue(iter, 0).ToString();
                    if (tvalue.Equals(text))
                    {
                        cbox.SetActiveIter(iter);
                        return(true);
                    }
                    else
                    {
                        found = store.IterNext(ref iter);
                    }
                }
            }

            return(false);            // not found
        }
		protected void OnButtonOkClicked (object sender, EventArgs e)
		{
			//Получаем из листа новые значения
			parameters = new Dictionary<string, string> ();
			TreeIter iter = new TreeIter ();
			if (!parametersListStore.GetIterFirst (out iter))
				return;
			do {
				string key = (string)parametersListStore.GetValue (iter, 0);
				string value = (string)parametersListStore.GetValue (iter, 1);
				parameters.Add (key, value);
			} while (parametersListStore.IterNext (ref iter));
			//Добавляем или обновляем.
			foreach (var pair in parameters) {
				string value = String.Empty;
				if (MainSupport.BaseParameters.All.TryGetValue (pair.Key, out value)) {
					if (value == pair.Value)
						continue;
				}
				MainSupport.BaseParameters.UpdateParameter (QSMain.ConnectionDB, pair.Key, pair.Value);
			}
			//Удаляем
			foreach (var pair in MainSupport.BaseParameters.All.ToList()) {
				if (!parameters.ContainsKey (pair.Key))
					MainSupport.BaseParameters.RemoveParameter (QSMain.ConnectionDB, pair.Key);
			}
		}
Example #6
0
 //Seleccionar todos los del treeview, un check_button
 void on_checkbutton_todos_envios(object sender, EventArgs args)
 {
     if ((bool)checkbutton_todos_envios.Active == true)
     {
         TreeIter iter2;
         if (treeViewEnginesolicitud.GetIterFirst(out iter2))
         {
             lista_almacenes.Model.SetValue(iter2, 0, true);
             while (treeViewEnginesolicitud.IterNext(ref iter2))
             {
                 lista_almacenes.Model.SetValue(iter2, 0, true);
             }
         }
     }
     else
     {
         TreeIter iter2;
         if (treeViewEnginesolicitud.GetIterFirst(out iter2))
         {
             lista_almacenes.Model.SetValue(iter2, 0, false);
             while (treeViewEnginesolicitud.IterNext(ref iter2))
             {
                 lista_almacenes.Model.SetValue(iter2, 0, false);
             }
         }
     }
 }
        void UpdateOKButton()
        {
            TreeIter iter;

            if (!store.GetIterFirst(out iter))
            {
                return;
            }

            bool atleast_one_selected = false;

            do
            {
                bool selected = (bool)store.GetValue(iter, colCheckedIndex);
                if (!selected)
                {
                    continue;
                }

                atleast_one_selected = true;

                string propertyName = (string)store.GetValue(iter, colPropertyNameIndex);
                string error;
                if (!IsValidPropertyName(propertyName, out error))
                {
                    buttonOk.Sensitive = false;
                    return;
                }
            } while (store.IterNext(ref iter));

            buttonOk.Sensitive = atleast_one_selected;
        }
Example #8
0
        public virtual bool ValidateSchemaObjects(out string msg)
        {
            TreeIter iter;

            if (store.GetIterFirst(out iter))
            {
                do
                {
                    string name   = store.GetValue(iter, colNameIndex) as string;
                    string column = store.GetValue(iter, colColumnNameIndex) as string;
                    string source = store.GetValue(iter, colSourceIndex) as string;
                    bool   iscolc = (bool)store.GetValue(iter, colIsColumnConstraintIndex);

                    if (String.IsNullOrEmpty(source))
                    {
                        msg = GettextCatalog.GetString("Checked constraint '{0}' does not contain a check statement.", name);
                        return(false);
                    }

                    if (iscolc && String.IsNullOrEmpty(column))
                    {
                        msg = GettextCatalog.GetString("Checked constraint '{0}' is marked as a column constraint but is not applied to a column.", name);
                        return(false);
                    }
                } while (store.IterNext(ref iter));
            }
            msg = null;
            return(true);
        }
Example #9
0
        void SelectNearest(TreeView view)
        {
            ListStore store = (ListStore)view.Model;

            TreePath[] paths = view.Selection.GetSelectedRows();
            if (paths.Length == 0)
            {
                return;
            }
            TreeIter it;

            store.GetIter(out it, paths [paths.Length - 1]);
            if (store.IterNext(ref it))
            {
                view.Selection.UnselectAll();
                view.Selection.SelectIter(it);
                return;
            }
            store.GetIter(out it, paths [0]);
            if (store.IterNext(ref it))
            {
                view.Selection.UnselectAll();
                view.Selection.SelectIter(it);
                return;
            }
        }
Example #10
0
        void UpdateItemsModel()
        {
            if (itemsModel == null || master == null)
            {
                return;
            }

            // build items list
            ArrayList items = new ArrayList();

            foreach (object o in master.DockObjects)
            {
                if (o is DockItem)
                {
                    items.Add(o);
                }
            }

            TreeIter iter;

            // update items model data after a layout load
            if (itemsModel.GetIterFirst(out iter))
            {
                bool valid = true;
walk_start:
                while (valid)
                {
                    DockItem item = itemsModel.GetValue(iter, 3) as DockItem;
                    if (item != null)
                    {
                        // look for the object in the items list
                        for (int i = 0; i < items.Count; i++)
                        {
                            // found, update data
                            if (item == items[i])
                            {
                                UpdateItemData(iter, item);
                                items.RemoveAt(i);
                                valid = itemsModel.IterNext(ref iter);
                                goto walk_start;
                            }
                        }
                        // FIXME: not found, skip it?
                        valid = itemsModel.IterNext(ref iter);
                    }
                    else
                    {
                        // not a valid row
                        valid = itemsModel.Remove(ref iter);
                    }
                }
            }

            // add any remaining objects
            foreach (DockItem ditem in items)
            {
                itemsModel.AppendValues(ditem.Name, ditem.IsAttached, ditem.Locked, ditem);
            }
        }
Example #11
0
        public void ToggleAll(bool isSelectAllChecked)
        {
            TreeIter iter;

            if (model.GetIterFirst(out iter))
            {
                do
                {
                    model.SetValue(iter, COLINDEX_TOGGLE, isSelectAllChecked);
                } while (model.IterNext(ref iter));
            }
        }
        protected virtual void SetSelectState(bool state)
        {
            TreeIter iter;

            if (store.GetIterFirst(out iter))
            {
                do
                {
                    store.SetValue(iter, ColSelectIndex, state);
                } while (store.IterNext(ref iter));
            }
        }
Example #13
0
        /// <summary>
        /// Clear _listStore rows by filling columns with empty strings.
        /// </summary>
        private void StoreClear()
        {
            TreeIter iter;

            _listStore.GetIterFirst(out iter);

            for (int i = 0; i < _listStore.IterNChildren(); i++)
            {
                _listStore.SetValues(iter, "", "", "", "", "", "", "", "", "", "");

                _listStore.IterNext(ref iter);
            }
        }
Example #14
0
		void changeService_ComponentRename (object sender, ComponentRenameEventArgs e)
		{
			//We just need to rename the right component in the combobox list
			TreeIter t; 
			components.GetIterFirst (out t);

			do {
				if ((IComponent)components.GetValue (t, 1) == e.Component && (string) components.GetValue(t, 0) == e.OldName) {
					components.SetValue (t, 0, e.NewName);
					return;
				}
			} while (components.IterNext (ref t));
		}
Example #15
0
		/// <summary>
		/// Updates the greyed out state of the up and down buttons
		/// depending on the currently selected item.
		/// </summary>
		protected void UpdatePriorityButtons ()
		{
			TreePath[] paths = treeview.Selection.GetSelectedRows ();
			if (paths.Length > 0) {
				TreePath p = paths [0];
				TreeIter it;
				listStore.GetIter (out it, p);
				buttonDown.Sensitive = listStore.IterNext (ref it);
				buttonUp.Sensitive = p.Prev ();
			} else {
				buttonDown.Sensitive = buttonUp.Sensitive = false;
			}
		}
        public System.Collections.Generic.List <Context> GetAllItems()
        {
            List <Context> result = new List <Context>();

            TreeIter iter;

            for (bool run = m_Results.GetIterFirst(out iter); run; run = m_Results.IterNext(ref iter))
            {
                Context context = (Context)m_ResultsTreeView.Model.GetValue(iter, 0);

                result.Add(context);
            }

            return(result);
        }
Example #17
0
        void Remove(LMDashboardVM dashboardVM)
        {
            TreeIter iter;

            dashboardsStore.GetIterFirst(out iter);
            while (dashboardsStore.IterIsValid(iter))
            {
                if (dashboardsStore.GetValue(iter, COL_DASHBOARD) == dashboardVM)
                {
                    dashboardsStore.Remove(ref iter);
                    break;
                }
                dashboardsStore.IterNext(ref iter);
            }
        }
Example #18
0
        IEnumerable <string> GetPermissions()
        {
            TreeIter iter;

            if (!permissionsStore.GetIterFirst(out iter))
            {
                yield break;
            }
            while (permissionsStore.IterNext(ref iter))
            {
                if ((bool)permissionsStore.GetValue(iter, 0))
                {
                    yield return((string)permissionsStore.GetValue(iter, 1));
                }
            }
        }
        public void ApplyFeature(SolutionFolder parentCombine, SolutionItem entry)
        {
            TranslationProject newProject;

            if (entry is TranslationProject)
            {
                newProject = (TranslationProject)entry;
            }
            else
            {
                newProject      = new TranslationProject();
                newProject.Name = entry.Name + "Translation";
                string path = System.IO.Path.Combine(parentCombine.BaseDirectory, newProject.Name);
                if (!System.IO.Directory.Exists(path))
                {
                    System.IO.Directory.CreateDirectory(path);
                }
                newProject.FileName = System.IO.Path.Combine(path, newProject.Name + ".mdse");
                parentCombine.Items.Add(newProject);
            }

            TreeIter iter;

            if (store.GetIterFirst(out iter))
            {
                do
                {
                    string code = (string)store.GetValue(iter, 1);
                    newProject.AddNewTranslation(code, new NullProgressMonitor());
                }while (store.IterNext(ref iter));
            }
        }
Example #20
0
        void UpdateListValues()
        {
            TreeIter it;

            if (seriesStore.GetIterFirst(out it))
            {
                do
                {
                    ChartSerieInfo ci = (ChartSerieInfo)seriesStore.GetValue(it, 3);
                    if (ci.Counter == null)
                    {
                        continue;
                    }
                    CounterValue val = ci.Counter.LastValue;
                    seriesStore.SetValue(it, 4, val.Value.ToString());

                    if (countChart.ActiveCursor != null)
                    {
                        val = ci.Counter.GetValueAt(new DateTime((long)countChart.ActiveCursor.Value));
                        seriesStore.SetValue(it, 5, val.Value.ToString());
                    }

                    val = ci.Counter.GetValueAt(new DateTime((long)countChart.SelectionStart.Value));
                    CounterValue val2 = ci.Counter.GetValueAt(new DateTime((long)countChart.SelectionEnd.Value));

                    seriesStore.SetValue(it, 6, (val2.Value - val.Value).ToString());
                }while (seriesStore.IterNext(ref it));
            }
        }
Example #21
0
        void OnPropertyUpdated(object sender, PropertyChangedEventArgs e)
        {
            bool change = false;

            if (e.Key == "Monodevelop.UserTasksHighPrioColor" && e.NewValue != e.OldValue)
            {
                highPrioColor = StringToColor((string)e.NewValue);
                change        = true;
            }
            if (e.Key == "Monodevelop.UserTasksNormalPrioColor" && e.NewValue != e.OldValue)
            {
                normalPrioColor = StringToColor((string)e.NewValue);
                change          = true;
            }
            if (e.Key == "Monodevelop.UserTasksLowPrioColor" && e.NewValue != e.OldValue)
            {
                lowPrioColor = StringToColor((string)e.NewValue);
                change       = true;
            }

            if (change)
            {
                TreeIter iter;
                if (store.GetIterFirst(out iter))
                {
                    do
                    {
                        Task task = (Task)store.GetValue(iter, (int)Columns.Task);
                        store.SetValue(iter, (int)Columns.Foreground, GetColorByPriority(task.Priority));
                    } while (store.IterNext(ref iter));
                }
            }
        }
        /// <summary>
        /// Raises the button ok clicked event.
        /// </summary>
        /// <param name='sender'>
        /// Sender.
        /// </param>
        /// <param name='e'>
        /// E.
        /// </param>
        protected void OnButtonOkClicked(object sender, System.EventArgs e)
        {
            //No need to send the information when nobody is listening.
            if (OnItemChosenEvent != null)
            {
                string chosenOption = restoreComboBox.ActiveText;

                //To get the Memento object, we need to iterate over the innerList
                //You need the TreeIter class to iterate over a StoreList.
                //We initialized the StoreList with two column's.
                //The first column has the combobox text and the second column has the Memento object.

                TreeIter iterator;
                innerList.GetIterFirst(out iterator);
                do
                {
                    string currentKey   = (string)innerList.GetValue(iterator, 0);
                    object currentValue = innerList.GetValue(iterator, 1);

                    if (currentKey.Equals(chosenOption))
                    {
                        //Send the chosen memento back to the MainWindow.
                        OnItemChosenEvent(currentValue);
                    }
                }while(innerList.IterNext(ref iterator));
            }

            //Hide the dialog so it can be re-used
            this.Hide();
        }
Example #23
0
        protected void OnBtnAnadirServClicked(object sender, EventArgs e)
        {
            int       cont = 0;
            TreeIter  iter;
            ListStore otro = cod.GetDetFact();

            if (otro.IterNChildren() > 0)
            {
                if (otro.GetIterFirst(out iter))
                {
                    do
                    {
                        TreeIter iter2;
                        if (otro.GetIterFirst(out iter2))
                        {
                            if (EntCodServ.Text == otro.GetValue(iter, 0).ToString())
                            {
                                cont = +1;
                                cod.Mensaje("El servicio ya fue añadido.\nSi desea actualizar la cantidad, haga doble click sobre el servicio\nen el listado de abajo.", ButtonsType.Ok, MessageType.Error);
                                EntCodServ.ChildFocus(DirectionType.Up);
                            }
                        }
                    } while (otro.IterNext(ref iter));
                }
            }
            AñadirServicios(cont);
        }
Example #24
0
        /* public constructors */
        public EditMemoDialog(Window parentWindow, Memo editMemo) : base(parentWindow, "EditMemoDialog")
        {
            SharedConstructor();
            theMemo                  = editMemo;
            subjectEntry.Text        = editMemo.Subject;
            memoTextView.Buffer.Text = editMemo.Text;
            Dialog.Title             = "Edit Memo";

            TreeIter iter;

            if (networksListStore.GetIterFirst(out iter))
            {
                do
                {
                    Network thisNetwork = networksListStore.GetValue(iter, 0) as Network;
                    if (thisNetwork == editMemo.Network)
                    {
                        networksComboBox.SetActiveIter(iter);
                        networksComboBox.Sensitive = false;
                        break;
                    }
                } while (networksListStore.IterNext(ref iter));
            }

            //foreach (FileLink f in theMemo.FileLinks) {
            //Dim newItem As ListViewItem = lstvFiles.Items.Add(f.FileName)
            //newItem.SubItems.Add(SetBytes(f.FileSize))
            //newItem.Tag = f
            //}
        }
        static void StoreHistory(string propertyName, Gtk.ComboBoxEntry comboBox)
        {
            ListStore     store   = (ListStore)comboBox.Model;
            List <string> history = new List <string> ();
            TreeIter      iter;

            if (store.GetIterFirst(out iter))
            {
                do
                {
                    history.Add((string)store.GetValue(iter, 0));
                } while (store.IterNext(ref iter));
            }
            const int limit = 20;

            if (history.Count > limit)
            {
                history.RemoveRange(history.Count - (history.Count - limit), history.Count - limit);
            }
            if (history.Contains(comboBox.Entry.Text))
            {
                history.Remove(comboBox.Entry.Text);
            }
            history.Insert(0, comboBox.Entry.Text);
            PropertyService.Set(propertyName, string.Join(historySeparator.ToString(), history.ToArray()));
        }
Example #26
0
        private int FindPattern(ListStore ls, string pattern, out TreeIter ti)
        {
            ti = new TreeIter();
            TreeIter iter;

            if (ls.GetIterFirst(out iter) == false)
            {
                return(-1);
            }

            string val;
            int    i = 0;

            while ((val = (ls.GetValue(iter, 0) as string)) != null)
            {
                if (pattern == val)
                {
                    ti = iter;
                    return(i);
                }
                ls.IterNext(ref iter);
                i++;
            }

            return(-1);
        }
Example #27
0
        void RemoveRegisteredSchema(XmlSchemaCompletionData schema)
        {
            if (addedSchemas.Contains(schema) && !schema.ReadOnly)
            {
                addedSchemas.Remove(schema);
            }
            else
            {
                removedSchemas.Add(schema);
            }

            TreeIter iter;
            bool     valid = registeredSchemasStore.GetIterFirst(out iter);

            while (valid)
            {
                if (GetRegisteredSchema(iter) == schema)
                {
                    registeredSchemasStore.Remove(ref iter);
                    break;
                }
                valid = registeredSchemasStore.IterNext(ref iter);
            }

            //restore built-in schema
            if (!schema.ReadOnly)
            {
                XmlSchemaCompletionData builtin = XmlSchemaManager.BuiltinSchemas[schema.NamespaceUri];
                if (builtin != null)
                {
                    AppendSchemaToStore(builtin);
                }
            }
        }
Example #28
0
 public CompuMethod SaveData(CompuMethod dat = null)
 {
     if (null == dat)
     {
         dat = currentCM;
     }
     dat.name        = this.entryName.Text;
     dat.description = this.entryDescription.Text;
     if (dat is RationalFunction)
     {
         ((RationalFunction)dat).Numerators [0]   = Convert.ToDouble(this.entryNumerator.Text);
         ((RationalFunction)dat).Numerators [1]   = Convert.ToDouble(this.entryNumerator1.Text);
         ((RationalFunction)dat).Denominators [0] = Convert.ToDouble(this.entryDenominator.Text);
         ((RationalFunction)dat).Denominators [1] = Convert.ToDouble(this.entryDenominator1.Text);
     }
     else if (dat is VerbalTable)
     {
         TreeIter ti;
         lsVT.GetIterFirst(out ti);
         ((VerbalTable)dat).items.Clear();
         for (int i = 0; i < lsVT.IterNChildren(); i++)
         {
             ((VerbalTable)dat).items.Add((int)lsVT.GetValue(ti, 0), (string)lsVT.GetValue(ti, 1));
             lsVT.IterNext(ref ti);
         }
     }
     else
     {
     }
     return(dat);
 }
Example #29
0
        /// <summary>Sets the disabled series names.</summary>
        /// <param name="seriesNames">The series names.</param>
        public void SetDisabledSeriesNames(string[] seriesNames)
        {
            TreeIter iter;

            if (listModel.GetIterFirst(out iter))
            {
                do
                {
                    string entry = (string)listModel.GetValue(iter, 1);
                    if (Array.IndexOf(seriesNames, entry) >= 0)
                    {
                        listModel.SetValue(iter, 0, false);
                    }
                } while (listModel.IterNext(ref iter));
            }
        }
Example #30
0
        protected virtual void ShowSettings(DatabaseConnectionSettings settings, bool updateProviderCombo)
        {
            checkCustom.Active = settings.UseConnectionString;
            entryName.Text     = String.IsNullOrEmpty(settings.Name) ? String.Empty : settings.Name;
            entryPassword.Text = String.IsNullOrEmpty(settings.Password) ? String.Empty : settings.Password;
            spinPort.Value     = settings.Port > 0 ? settings.Port : spinPort.Value;
            entryServer.Text   = String.IsNullOrEmpty(settings.Server) ? String.Empty : settings.Server;
            entryUsername.Text = String.IsNullOrEmpty(settings.Username) ? String.Empty : settings.Username;
            textConnectionString.Buffer.Text = String.IsNullOrEmpty(settings.ConnectionString) ? String.Empty : settings.ConnectionString;
            comboDatabase.Entry.Text         = String.IsNullOrEmpty(settings.Database) ? String.Empty : settings.Database;
            spinMinPoolSize.Value            = settings.MinPoolSize;
            spinMaxPoolSize.Value            = settings.MaxPoolSize;

            if (updateProviderCombo)
            {
                TreeIter iter;
                if (storeProviders.GetIterFirst(out iter))
                {
                    do
                    {
                        IDbFactory fac = storeProviders.GetValue(iter, 1) as IDbFactory;
                        if (settings.ProviderIdentifier == fac.Identifier)
                        {
                            comboProvider.SetActiveIter(iter);
                            return;
                        }
                    } while (storeProviders.IterNext(ref iter));
                }
            }
        }