Ejemplo n.º 1
0
        public CreateEntryDialog(Connection connection, Template theTemplate)
        {
            if (connection == null)
                throw new ArgumentNullException("connection");
            if (theTemplate == null)
                throw new ArgumentNullException("theTemplate");

            conn = connection;
            t = theTemplate;
            isTemplate = true;

            Init ();

            foreach (string s in t.Classes) {
                attrListStore.AppendValues ("objectClass", s, "Optional");
                _objectClass.Add (s);
            }

            showAttributes ();

            createEntryDialog.Icon = Global.latIcon;

            createEntryDialog.Run ();

                createEntryDialog.Run ();

            createEntryDialog.Destroy ();
        }
Ejemplo n.º 2
0
        public TemplateEditorDialog(Connection connection, Template theTemplate)
        {
            conn = connection;
            _isEdit = true;

            t = theTemplate;

            Init ();

            nameEntry.Text = t.Name;
            nameEntry.Sensitive = false;

            foreach (string s in t.Classes) {
                objListStore.AppendValues (s);
                _objectClass.Add (s);
            }

            ShowAttributes ();

            templateEditorDialog.Run ();
            templateEditorDialog.Destroy ();
        }
Ejemplo n.º 3
0
        public void OnOkClicked(object o, EventArgs args)
        {
            if (_isEdit) {
                t.Name = nameEntry.Text;
                t.ClearAttributes ();
            } else {

                t = new Template (nameEntry.Text);
            }

            t.AddClass (_objectClass);

            foreach (object[] row in attrListStore) {
                string nam = (string) row[0];
                string val = (string) row[2];

                if (string.IsNullOrEmpty(nam) || string.IsNullOrEmpty(val))
                    continue;

                t.AddAttribute (nam, val);
            }
        }
Ejemplo n.º 4
0
        public void Update(Template t)
        {
            for (int i = 0; i < _templates.Count; i++) {
                Template p = (Template) _templates[i];

                if (t.Name.Equals (p.Name)) {
                    _templates[i] = t;
                    break;
                }
            }
        }
Ejemplo n.º 5
0
 public void Add(Template t)
 {
     _templates.Add (t);
 }