示例#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 ();
        }
示例#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 ();
        }
示例#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);
            }
        }
示例#4
0
文件: Templates.cs 项目: MrJoe/lat
        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;
                }
            }
        }
示例#5
0
文件: Templates.cs 项目: MrJoe/lat
 public void Add(Template t)
 {
     _templates.Add (t);
 }