Пример #1
0
        private bool PropertyExists(string name)
        {
            if (d_wrapper.Variable(name) != null)
            {
                return(true);
            }

            Wrappers.Node grp = d_wrapper as Wrappers.Node;

            if (grp == null)
            {
                return(false);
            }

            return(grp.VariableInterface.Implements(name));
        }
Пример #2
0
        private void DoRemoveProperty()
        {
            List <Undo.IAction> actions = new List <Undo.IAction>();

            foreach (TreePath path in d_treeview.Selection.GetSelectedRows())
            {
                Node node = d_treeview.NodeStore.FindPath(path);

                if (node == d_dummy)
                {
                    continue;
                }

                Wrappers.Wrapper temp = d_wrapper.GetVariableTemplate(node.Variable, false);

                if (temp != null)
                {
                    Cdn.Variable tempProp = temp.Variable(node.Variable.Name);

                    actions.Add(new Undo.ModifyVariable(d_wrapper, node.Variable, tempProp.Expression.AsString));
                    actions.Add(new Undo.ModifyVariable(d_wrapper, node.Variable, tempProp.Flags));
                }
                else
                {
                    actions.Add(new Undo.RemoveVariable(d_wrapper, node.Variable));
                }
            }

            try
            {
                d_actions.Do(new Undo.Group(actions));
            }
            catch (GLib.GException err)
            {
                // Display could not remove, or something
                Error(this, err);
            }
        }