public void SetDefinition(XmlElement definition)
        {
            XmlHelper h = new XmlHelper(definition);

            dgExt.Rows.Clear();
            dgRestrict.Rows.Clear();

            foreach (XmlElement x in h.GetElements("Authentication/UserInfoProcessors/Processor/Restrict"))
            {
                int             index = dgRestrict.Rows.Add();
                DataGridViewRow row   = dgRestrict.Rows[index];
                row.Cells[colRestrictType.Name].Value = x.GetAttribute("Type");
                row.Cells[colCondition.Name].Value    = ExtendAuthEditor.GetDisplay(x);
                row.Tag = x;
            }

            foreach (XmlElement x in h.GetElements("Authentication/UserInfoProcessors/Processor/ExtendProperty"))
            {
                int             index = dgExt.Rows.Add();
                DataGridViewRow row   = dgExt.Rows[index];
                row.Cells[dgExtType.Name].Value    = x.GetAttribute("Type");
                row.Cells[dgExtDisplay.Name].Value = ExtendAuthEditor.GetDisplay(x);
                row.Tag = x;
            }
        }
        void extEdotForm_Completed(object sender, ExtEventArg e)
        {
            DataGridViewRow row = dgExt.SelectedRows[0];

            row.Cells[dgExtDisplay.Name].Value = ExtendAuthEditor.GetDisplay(e.Result);
            row.Cells[dgExtType.Name].Value    = e.ExtType;
            row.Tag = e.Result;
        }
        private void SetData(DataGridViewRow row, RestrictEventArgs arg)
        {
            row.Tag = arg.Result;
            row.Cells[colCondition.Name].Value    = ExtendAuthEditor.GetDisplay(arg.Result);
            row.Cells[colRestrictType.Name].Value = arg.RestrictType.ToString();

            DoChanged(true);
        }
        void extForm_Completed(object sender, ExtEventArg e)
        {
            ExtPropForm extForm = sender as ExtPropForm;

            extForm.Completed -= new EventHandler <ExtEventArg>(extForm_Completed);

            int index = dgExt.Rows.Add();

            dgExt.Rows[index].Cells[dgExtType.Name].Value    = e.ExtType;
            dgExt.Rows[index].Cells[dgExtDisplay.Name].Value = ExtendAuthEditor.GetDisplay(e.Result);
            dgExt.Rows[index].Tag = e.Result;
        }
        private void ChangeType(ExtendType type)
        {
            IContractEditor editor = null;
            if (type == ExtendType.open)
            {
                rbPublic.Checked = true;
                editor = new PublicAuthEditor();
            }
            else if (type == ExtendType.ta)
            {
                rbTA.Checked = true;
                editor = new ExtendAuthEditor(type);
            }
            else if (type == ExtendType.sa)
            {
                rbSA.Checked = true;
                editor = new ExtendAuthEditor(type);
            }
            else if (type == ExtendType.admin)
            {
                rbAdmin.Checked = true;
                editor = new ExtendAuthEditor(type);
            }
            else if (type == ExtendType.none)
            {
                rbOther.Checked = true;
                editor = new AdvAuthEditor();
            }
            else if (type == ExtendType.parent)
            {
                rbParent.Checked = true;
                editor = new ExtendAuthEditor(type);
            }

            DockControl(editor);
            editor.DataChanged += new EventHandler(editor_DataChanged);
            editor.ChangeRecovered += new EventHandler(editor_ChangeRecovered);
        }