private void Display()
        {
            if (WorkQueues != null && WorkQueues.Count > 0)
            {
                Model.WorkQueue workqueue = WorkQueues[0];
                WorkQueueSettingsPanel.SelectedPriority     = workqueue.WorkQueuePriorityEnum;
                WorkQueueSettingsPanel.NewScheduledDateTime = workqueue.ScheduledTime;
            }

            SelectedWorkQueueItemList.Refresh();

            if (WorkQueues == null)
            {
                return;
            }

            if (SelectedWorkQueueItemList.WorkQueueItems.Count != WorkQueueKeys.Count)
            {
                MessageDialog.Message     = HttpContext.GetGlobalResourceObject("SR", "WorkQueueNoLongerAvailable") as string;
                MessageDialog.MessageType =
                    MessageBox.MessageTypeEnum.INFORMATION;
                MessageDialog.Show();
            }

            ModalDialog.Show();
        }
        /// <summary>
        /// Displays the add device dialog box.
        /// </summary>
        public void Show(bool updateUI)
        {
            if (updateUI)
            {
                UpdateUI();
            }
            else
            {
                if (EditMode)
                {
                    ModalDialog.Title = SR.DialogEditFileSystemTitle;
                }
                else
                {
                    ModalDialog.Title = SR.DialogAddFileSystemTitle;
                }
            }


            if (Page.IsValid)
            {
                TabContainer1.ActiveTabIndex = 0;
            }

            ModalDialog.Show();
        }
        /// <summary>
        /// Displays the add device dialog box.
        /// </summary>
        public void Show(bool updateUI)
        {
            if (EditMode)
            {
                ModalDialog.Title    = SR.DialogEditPartitionTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;
            }
            else
            {
                ModalDialog.Title    = SR.DialogAddPartitionTitle;
                OKButton.Visible     = true;
                UpdateButton.Visible = false;
            }

            if (updateUI)
            {
                UpdateUI();
            }

            if (Page.IsValid)
            {
                ServerPartitionTabContainer.ActiveTabIndex = 0;
            }

            ModalDialog.Show();
        }
Esempio n. 4
0
        // Token: 0x0600004A RID: 74 RVA: 0x0000412C File Offset: 0x0000232C
        public static bool dontOverwriteExistingFile(string sFullPath, CamIntOverwriteMode overwriteMode, out bool cancel)
        {
            cancel = false;
            bool flag = overwriteMode == CamIntOverwriteMode.Overwrite;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = false;
                bool flag3 = File.Exists(sFullPath);
                bool flag4 = flag3;
                if (flag4)
                {
                    bool flag5 = overwriteMode == CamIntOverwriteMode.Cancel;
                    if (flag5)
                    {
                        cancel = true;
                        return(true);
                    }
                    bool flag6 = overwriteMode == CamIntOverwriteMode.Skip;
                    if (flag6)
                    {
                        return(true);
                    }
                    bool flag7 = ItCNCFileWriter.bNeverOverwrite;
                    if (flag7)
                    {
                        flag2 = true;
                    }
                    else
                    {
                        bool flag8 = !ItCNCFileWriter.bAlwaysOverwrite;
                        if (flag8)
                        {
                            string      fileName        = Path.GetFileName(sFullPath);
                            string      lclTitleProceed = ItCNCFileWriter._lclTitleProceed;
                            ModalDialog modalDialog     = new ModalDialog(lclTitleProceed);
                            modalDialog.MainContent = "msgProceedWithOverwrite".LocaliseFormat(new string[]
                            {
                                fileName
                            });
                            modalDialog.CommonButtons = (ModalDialogButtons.Yes | ModalDialogButtons.Cancel);
                            modalDialog.DefaultButton = ModalDialogResult.Cancel;
                            modalDialog.Id            = "RevitPrecastCNCOverwriteFile";
                            modalDialog.AddCommandLink(ModalDialogCommandLinkId.CommandLink1, ItCNCFileWriter._lclMsgYesToAll);
                            ModalDialogResult modalDialogResult = modalDialog.Show();
                            flag2 = (modalDialogResult == ModalDialogResult.Cancel);
                            ItCNCFileWriter.bAlwaysOverwrite = (modalDialogResult == ModalDialogResult.CommandLink1);
                            cancel = (modalDialogResult == ModalDialogResult.Cancel);
                        }
                    }
                }
                result = flag2;
            }
            return(result);
        }
        /// <summary>
        /// Displays the add device dialog box.
        /// </summary>
        public void Show(bool updateUI)
        {
            if (updateUI)
            {
                UpdateUI();
            }
            else
            {
                if (EditMode)
                {
                    ModalDialog.Title = Titles.EditPartitionArchiveTitle;
                }
                else
                {
                    ModalDialog.Title = Titles.AddPartitionArchiveTitle;
                }
            }


            if (Page.IsValid)
            {
//                ServerPartitionTabContainer.ActiveTabIndex = 0;
            }


            ModalDialog.Show();
        }
Esempio n. 6
0
        private bool?Show(ModalDialog dialog)
        {
            DialogOpened?.Invoke(this, EventArgs.Empty);
            dialog.Show();
            DialogClosed?.Invoke(this, EventArgs.Empty);

            return(dialog.Result);
        }
 protected override void OnPreRender(EventArgs e)
 {
     ModalDialog.Hide();
     if (IsShown)
     {
         ModalDialog.Show();
     }
     base.OnPreRender(e);
 }
Esempio n. 8
0
    private void VoteForEntry(AgentPrivate admin, AgentPrivate agent)
    {
        string message = "Kick and ban " + agent.AgentInfo.Name + " ?";

        try
        {
            ModalDialog modalDialog = admin.Client.UI.ModalDialog;
            modalDialog.Show(message, "Yes", "No", (OperationCompleteEvent opc) =>
            {
                if (modalDialog.Response == "Yes")
                {
                    kicks = kicks + 1;
                    if (DebugLogging)
                    {
                        Log.Write(admin.AgentInfo.Name + " voted to ban " + agent.AgentInfo.Name);
                    }
                }
                else
                {
                    keeps = keeps + 1;
                    if (DebugLogging)
                    {
                        Log.Write(admin.AgentInfo.Name + " voted to keep " + agent.AgentInfo.Name);
                    }
                }
            });

            Wait(TimeSpan.FromSeconds(VoteTime));

            modalDialog.Cancel();

            if (DebugLogging)
            {
                Log.Write("kicks " + kicks + " keeps " + keeps);
            }
            if (kicks > keeps)
            {
                BanUser(agent);
            }
            else
            {
                if (DebugLogging)
                {
                    Log.Write("Voted to keep " + agent.AgentInfo.Name);
                }
            }
        }
        catch (Exception e)
        {
            if (DebugLogging)
            {
                Log.Write("Voting Exception: " + e);
            }
        }
    }
Esempio n. 9
0
    public override bool Execute(GameObject target)
    {
        DialogContent content = new DialogContent();

        content._content = "Objet Name : " + target.name;
        content._action  = () => ModalDialog.Shut();

        //RadialMenu.Shut();

        ModalDialog.Show(content);

        return(true);
    }
    private IEnumerator ConnectToGameServer()
    {
        connectionDialog.Show(DialogProperties.Connecting);

        yield return(new WaitForSeconds(3));

        serverController.Connect(connectionArgs);
    }
Esempio n. 11
0
        public void Show()
        {
            m_Dlg.Show();

            m_List.Initialize(null);

            if (m_StorageManager != null)
            {
                m_List.IsWaiting = true;

                StorageActionArgs args = new StorageActionArgs();
                args.ActionType  = StorageActionTypes.GetList;
                args.ContentType = ContentType;
                m_StorageManager.Invoke(XmlSerializationUtility.Obj2XmlStr(args, Common.Namespace), args);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Handles the RunPicklistBrowser event
        /// </summary>
        protected void OnRunPicklistBrowser()
        {
            var args  = ContinuationManager.Current.CurrentArgs as ClientPipelineArgs;
            var field = this.Info[this.ActiveField.Value];

            Assert.IsNotNull(args, "args");
            if (args.IsPostBack)
            {
                if (args.HasResult)
                {
                    string result = args.Result;
                    if (result == "-")
                    {
                        return;
                    }

                    var value = CrmCampaignIntegrations.Core.LookupValue.Parse(result);

                    field.LookupValue = value;

                    this.UpdateSettings(this.ActiveField.Value, true);
                }
            }
            else
            {
                var urlString = new UrlString("/sitecore modules/shell/Web Forms for Marketers/Shell/OpenXamlModalDialog/OpenXamlModalDialog.aspx");

                urlString.Add("type", "xaml");
                urlString.Add("control", "Sitecore.CrmCampaignIntegration.Shell.UI.Dialogs.LookupRecords");

                var attribute = (ICrmLookupAttributeMetadata)this.Metadata.GetAttribute(this.ActiveField.Value);
                urlString.Append("field", this.ActiveField.Value);

                var value = attribute.Targets.ToList().IndexOf(field.EntityReference);
                urlString.Append("targets", string.Join("|", attribute.Targets));
                urlString.Append("skey", Data.ID.NewID.ToString());
                urlString.Append("w", "620px");
                urlString.Append("h", "800px");

                ModalDialog.Show(urlString);

                args.WaitForPostBack();
            }
        }
Esempio n. 13
0
        private void btnChangeCustomImage_Click(object sender, RoutedEventArgs e)
        {
            if (m_ChangeCustomImageDialog == null)
            {
                m_ChangeCustomImageDialog = new ModalDialog()
                {
                    Width = 600, Height = 300, DialogStyle = ModalDialogStyles.OKCancel
                };
                m_ChangeCustomImageDialog.Caption   = Localization.ImageChoiceDialog_Caption;
                m_ChangeCustomImageDialog.DialogOk += new EventHandler <DialogResultArgs>(m_ChangeCustomImageDialog_DialogOk);
            }

            if (m_ImageChoice == null)
            {
                m_ImageChoice = new ImageChoiceControl();
                m_ChangeCustomImageDialog.Content = m_ImageChoice;
            }

            m_ImageChoice.Initialize();
            m_ChangeCustomImageDialog.Show();
        }
        void m_PreviewButton_Click(object sender, RoutedEventArgs e)
        {
            ModalDialog dlg = new ModalDialog();

            dlg.MinHeight = 300;
            dlg.MinWidth  = 400;
            dlg.Height    = 500;
            dlg.Width     = 600;
            dlg.Caption   = Localization.ValueCopyDialog_Caption;
            dlg.DialogOk += new EventHandler <DialogResultArgs>(ValueCopyDialog_OkButtonClick);

            ValueCopyControl CopyControl = new ValueCopyControl();

            CopyControl.CubeName           = CubeName;
            CopyControl.ConnectionID       = Connection;
            CopyControl.GetOlapDataLoader += new EventHandler <GetIDataLoaderArgs>(CopyControl_GetOlapDataLoader);
            CopyControl.LogManager         = this.LogManager;
            CopyControl.Initialize(m_CopyControl.GetCopySettings());
            dlg.Content = CopyControl;

            dlg.Show();
        }
Esempio n. 15
0
    private void AskForEntry(AgentPrivate agent)
    {
        if (DebugLogging)
        {
            Log.Write("Checking Access");
        }
        string message = "Allow " + agent.AgentInfo.Name + " to enter?";

        try
        {
            Visitor     admin       = Visitors[Admins[0]];
            ModalDialog modalDialog = admin.Agent.Client.UI.ModalDialog;
            modalDialog.Show(message, "Yes", "No", (OperationCompleteEvent opc) =>
            {
                if (modalDialog.Response == "Yes")
                {
                    if (DebugLogging)
                    {
                        Log.Write("Entry was granted.");
                    }
                    GrantEntry(agent);
                }
                else
                {
                    if (DebugLogging)
                    {
                        Log.Write("Entry was denied.");
                    }
                    BanUser(agent);
                }
            });
        } catch (Exception e)
        {
            if (DebugLogging)
            {
                Log.Write("Entry Exception: " + e);
            }
        }
    }
Esempio n. 16
0
 protected void OnActionClick(CategoryModel model, ModalDialog modal)
 {
     Selected = model;
     modal.Show();
     StateHasChanged();
 }
Esempio n. 17
0
 private async void GameCore_OnGameWin()
 {
     gameBar.StopTimer();
     modalDialog.Show("You won!");
     await StoreGameRecord(isGameWin : true);
 }
 internal void EnsureDialogVisible()
 {
     ModalDialog.Show();
 }
Esempio n. 19
0
 protected void OnActionClick(IncomeOverviewModel model, ModalDialog modal)
 {
     SelectedItem = model;
     modal.Show();
     StateHasChanged();
 }
        protected void ApplyChanges()
        {
            if (WorkQueues != null)
            {
                var toBeUpdatedList = new List <Model.WorkQueue>();
                foreach (Model.WorkQueue item in WorkQueues)
                {
                    if (item != null)
                    {
                        toBeUpdatedList.Add(item);
                    }
                }

                if (toBeUpdatedList.Count > 0)
                {
                    DateTime newScheduleTime = Platform.Time;

                    if (WorkQueueSettingsPanel.NewScheduledDateTime != null &&
                        WorkQueueSettingsPanel.ScheduleNow == false)
                    {
                        newScheduleTime = WorkQueueSettingsPanel.NewScheduledDateTime.Value;
                    }

                    if (newScheduleTime < Platform.Time && WorkQueueSettingsPanel.ScheduleNow == false)
                    {
                        MessageDialog.MessageType =
                            MessageBox.MessageTypeEnum.ERROR;
                        MessageDialog.Message = HttpContext.GetGlobalResourceObject("SR", "WorkQueueRescheduleFailed_MustBeInFuture") as string;
                        MessageDialog.Show();
                        ModalDialog.Show();
                    }
                    else
                    {
                        DateTime expirationTime =
                            newScheduleTime.AddSeconds(WorkQueueSettings.Default.WorkQueueExpireDelaySeconds);

                        WorkQueuePriorityEnum priority = WorkQueueSettingsPanel.SelectedPriority;

                        try
                        {
                            var  controller = new WorkQueueController();
                            bool result     =
                                controller.RescheduleWorkQueueItems(toBeUpdatedList, newScheduleTime, expirationTime,
                                                                    priority);
                            if (result)
                            {
                                if (WorkQueueUpdated != null)
                                {
                                    WorkQueueUpdated(toBeUpdatedList);
                                }
                            }
                            else
                            {
                                Platform.Log(LogLevel.Error, "Unable to reschedule work queue items for user");
                                MessageDialog.MessageType =
                                    MessageBox.MessageTypeEnum.ERROR;
                                MessageDialog.Message = "Unable to reschedule this/these work queue items";
                                MessageDialog.Show();
                            }
                        }
                        catch (Exception e)
                        {
                            Platform.Log(LogLevel.Error, "Unable to reschedule work queue items for user : {0}",
                                         e.StackTrace);

                            MessageDialog.MessageType =
                                MessageBox.MessageTypeEnum.ERROR;
                            MessageDialog.Message =
                                String.Format(HttpContext.GetGlobalResourceObject("SR", "WorkQueueRescheduleFailed_Exception") as string, e.Message);
                            MessageDialog.Show();
                        }
                    }
                }
            }
        }
Esempio n. 21
0
 // Token: 0x06000008 RID: 8 RVA: 0x000025B3 File Offset: 0x000007B3
 private static void showError(FileFormat format)
 {
     ModalDialog.Show(CamExporter._lclError, CamExporter.errorCodes[format].Localise(), ModalDialogButtons.Ok, ModalDialogResult.Ok);
 }
        /// <summary>
        /// Displays the add/edit device dialog box.
        /// </summary>
        public void Show()
        {
            //If the validation failed, keep everything as is, and
            //make sure the dialog stays visible.
            if (!Page.IsValid)
            {
                ModalDialog.Show();
                return;
            }

            if (Thread.CurrentPrincipal.IsInRole(AuthorityTokens.Study.EditDataAccess) && Study != null)
            {
                AuthorityGroupCheckBoxList.Items.Clear();

                var controller = new StudyDataAccessController();
                var list       = controller.ListDataAccessGroupsForStudy(Study.TheStudyStorage.Key);

                var adapter = new ServerPartitionDataAdapter();
                IList <AuthorityGroupDetail> accessAllStudiesList;
                var groups = adapter.GetAuthorityGroupsForPartition(Study.ThePartition.Key, true, out accessAllStudiesList);


                IList <ListItem> items = CollectionUtils.Map(
                    accessAllStudiesList,
                    delegate(AuthorityGroupDetail group)
                {
                    var item = new ListItem(@group.Name,
                                            @group.AuthorityGroupRef.ToString(false, false))
                    {
                        Enabled  = false,
                        Selected = true
                    };
                    item.Attributes["title"] = @group.Description;
                    return(item);
                });

                foreach (var group in groups)
                {
                    var item = new ListItem(@group.Name,
                                            @group.AuthorityGroupRef.ToString(false, false));
                    item.Attributes["title"] = @group.Description;

                    foreach (AuthorityGroupStudyAccessInfo s in list)
                    {
                        if (s.AuthorityOID.Equals(group.AuthorityGroupRef.ToString(false, false)))
                        {
                            item.Selected = true;
                        }
                    }

                    items.Add(item);
                }

                AuthorityGroupCheckBoxList.Items.AddRange(CollectionUtils.ToArray(items));
            }

            CancelButton.Visible = true;
            UpdateButton.Visible = true;

            ModalDialog.Show();
        }
        /// <summary>
        /// Displays the add/edit device dialog box.
        /// </summary>
        public void Show()
        {
            //If the validation failed, keep everything as is, and
            //make sure the dialog stays visible.
            if (!Page.IsValid)
            {
                RuleXmlTabPanel.TabIndex = 0;
                ModalDialog.Show();
                return;
            }

            // update the dropdown list
            RuleApplyTimeDropDownList.Items.Clear();
            RuleTypeDropDownList.Items.Clear();
            RuleXmlTabPanel.TabIndex = 0;
            ServerPartitionTabContainer.ActiveTabIndex = 0;

            var ep = new SampleRuleExtensionPoint();

            object[] extensions = ep.CreateExtensions();

            Dictionary <ServerRuleTypeEnum, IList <ServerRuleApplyTimeEnum> > ruleTypeList = LoadRuleTypes(extensions);

            if (EditMode)
            {
                ModalDialog.Title    = SR.DialogEditServerRuleTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;

                DefaultCheckBox.Checked    = _rule.DefaultRule;
                EnabledCheckBox.Checked    = _rule.Enabled;
                ExemptRuleCheckBox.Checked = _rule.ExemptRule;

                //if (_rule.DefaultRule)
                //	DefaultCheckBox.Enabled = false;

                RuleNameTextBox.Text = _rule.RuleName;

                SampleRuleDropDownList.Visible = false;
                SelectSampleRuleLabel.Visible  = false;

                // Fill in the drop down menus
                RuleTypeDropDownList.Items.Add(new ListItem(
                                                   ServerEnumDescription.GetLocalizedDescription(_rule.ServerRuleTypeEnum),
                                                   _rule.ServerRuleTypeEnum.Lookup));

                IList <ServerRuleApplyTimeEnum> list = new List <ServerRuleApplyTimeEnum>();


                if (ruleTypeList.ContainsKey(_rule.ServerRuleTypeEnum))
                {
                    list = ruleTypeList[_rule.ServerRuleTypeEnum];
                }

                foreach (ServerRuleApplyTimeEnum applyTime in list)
                {
                    RuleApplyTimeDropDownList.Items.Add(new ListItem(
                                                            ServerEnumDescription.GetLocalizedDescription(applyTime),
                                                            applyTime.Lookup));
                }


                if (RuleApplyTimeDropDownList.Items.FindByValue(_rule.ServerRuleApplyTimeEnum.Lookup) != null)
                {
                    RuleApplyTimeDropDownList.SelectedValue = _rule.ServerRuleApplyTimeEnum.Lookup;
                }

                RuleTypeDropDownList.SelectedValue = _rule.ServerRuleTypeEnum.Lookup;


                // Fill in the Rule XML
                var sw = new StringWriter();

                var xmlSettings = new XmlWriterSettings();

                xmlSettings.Encoding            = Encoding.UTF8;
                xmlSettings.ConformanceLevel    = ConformanceLevel.Fragment;
                xmlSettings.Indent              = true;
                xmlSettings.NewLineOnAttributes = false;
                xmlSettings.CheckCharacters     = true;
                xmlSettings.IndentChars         = "  ";

                XmlWriter tw = XmlWriter.Create(sw, xmlSettings);

                _rule.RuleXml.WriteTo(tw);

                tw.Close();

                RuleXmlTextBox.Text = sw.ToString();

                ServerRuleValidator.RuleTypeControl = RuleTypeDropDownList.SelectedValue;
            }
            else
            {
                ModalDialog.Title    = SR.DialogAddServerRuleTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;

                DefaultCheckBox.Checked    = false;
                EnabledCheckBox.Checked    = true;
                ExemptRuleCheckBox.Checked = false;

                RuleNameTextBox.Text = string.Empty;
                RuleXmlTextBox.Text  = string.Empty;

                SampleRuleDropDownList.Visible = true;
                SelectSampleRuleLabel.Visible  = true;

                // Do the drop down lists
                bool first = true;
                var  list  = new List <ServerRuleTypeEnum>();
                list.AddRange(ruleTypeList.Keys);

                // Sort the list by description
                list.Sort(
                    new Comparison <ServerRuleTypeEnum>(
                        delegate(ServerRuleTypeEnum type1, ServerRuleTypeEnum type2) { return(type1.Description.CompareTo(type2.Description)); }));

                foreach (ServerRuleTypeEnum type in list)
                {
                    if (first)
                    {
                        first = false;
                        SampleRuleDropDownList.Items.Clear();
                        SampleRuleDropDownList.Items.Add(new ListItem(string.Empty, string.Empty));

                        foreach (ISampleRule extension in extensions)
                        {
                            if (extension.Type.Equals(type))
                            {
                                SampleRuleDropDownList.Items.Add(new ListItem(extension.Description, extension.Name));
                            }
                        }

                        foreach (ServerRuleApplyTimeEnum applyTime in ruleTypeList[type])
                        {
                            RuleApplyTimeDropDownList.Items.Add(new ListItem(
                                                                    ServerEnumDescription.GetLocalizedDescription(applyTime),
                                                                    applyTime.Lookup));
                        }
                    }

                    RuleTypeDropDownList.Items.Add(new ListItem(
                                                       ServerEnumDescription.GetLocalizedDescription(type), type.Lookup));
                }

                ServerRuleValidator.RuleTypeControl = RuleTypeDropDownList.SelectedValue;
            }

            ModalDialog.Show();
            return;
        }
Esempio n. 24
0
 private void OnServerTimedOut(object sender, EventArgs args)
 {
     syncServer.ReceiveTimedOut -= OnServerTimedOut;
     HideWaitForOpponentDialog();
     matchEndedDialog.Show(DialogProperties.ServerTimedOut);
 }
Esempio n. 25
0
 public void Show()
 {
     DialogContent.ViewModel = ViewModel;
     DataBind();
     ModalDialog.Show();
 }
Esempio n. 26
0
 private void OnResetClicked()
 {
     modalDialog.Show("Actually reset statistic ?");
 }
        /// <summary>
        /// Displays the add/edit device dialog box.
        /// </summary>
        public void Show()
        {
            //If the validation failed, keep everything as is, and
            //make sure the dialog stays visible.
            if (!Page.IsValid)
            {
                ModalDialog.Show();
                return;
            }

            if (_partition != null)
            {
                AuthorityGroupCheckBoxList.Items.Clear();

                var adapter = new ServerPartitionDataAdapter();
                IList <AuthorityGroupDetail> accessAllStudiesList;
                IList <AuthorityGroupDetail> groups = adapter.GetAuthorityGroupsForPartition(_partition.Key, true, out accessAllStudiesList);

                IList <ListItem> items = CollectionUtils.Map(
                    groups,
                    delegate(AuthorityGroupDetail group)
                {
                    var item = new ListItem(@group.Name,
                                            @group.AuthorityGroupRef.ToString(false, false));
                    item.Attributes["title"] = @group.Description;
                    return(item);
                });

                AuthorityGroupCheckBoxList.Items.AddRange(CollectionUtils.ToArray(items));
            }

            var ep = new SampleRuleExtensionPoint();

            object[] extensions = ep.CreateExtensions();

            if (Mode == AddEditDataRuleDialogMode.Edit)
            {
                ModalDialog.Title    = SR.DialogEditDataRuleTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;

                DefaultCheckBox.Checked    = _rule.DefaultRule;
                EnabledCheckBox.Checked    = _rule.Enabled;
                ExemptRuleCheckBox.Checked = _rule.ExemptRule;


                RuleNameTextBox.Text = _rule.RuleName;

                SampleRuleDropDownList.Visible = false;
                SelectSampleRuleLabel.Visible  = false;


                // Fill in the Rule XML
                var sw = new StringWriter();

                var xmlSettings = new XmlWriterSettings
                {
                    Encoding            = Encoding.UTF8,
                    ConformanceLevel    = ConformanceLevel.Fragment,
                    Indent              = true,
                    NewLineOnAttributes = false,
                    CheckCharacters     = true,
                    IndentChars         = "  "
                };

                XmlWriter tw = XmlWriter.Create(sw, xmlSettings);

                XmlNode node2 = _rule.RuleXml.SelectSingleNode("/rule/condition");

                node2.WriteTo(tw);

                tw.Close();

                RuleXmlTextBox.Text = sw.ToString();

                DataRuleValidator.RuleTypeControl = ServerRuleTypeEnum.DataAccess.Lookup;

                AuthorityGroupCheckBoxList.ClearSelection();

                foreach (XmlNode node in _rule.RuleXml.SelectNodes("/rule/action/grant-access"))
                {
                    string   oid  = node.Attributes["authorityGroupOid"].Value;
                    ListItem item = AuthorityGroupCheckBoxList.Items.FindByValue(oid);
                    if (item != null)
                    {
                        item.Selected = true;
                    }
                }
            }
            else if (Mode == AddEditDataRuleDialogMode.New)
            {
                ModalDialog.Title    = SR.DialogAddDataRuleTitle;
                OKButton.Visible     = true;
                UpdateButton.Visible = false;

                DefaultCheckBox.Checked    = false;
                EnabledCheckBox.Checked    = true;
                ExemptRuleCheckBox.Checked = false;

                RuleNameTextBox.Text = string.Empty;
                RuleXmlTextBox.Text  = string.Empty;

                SampleRuleDropDownList.Visible = true;
                SelectSampleRuleLabel.Visible  = true;

                // Do the drop down lists
                SampleRuleDropDownList.Items.Clear();
                SampleRuleDropDownList.Items.Add(new ListItem(string.Empty, string.Empty));
                foreach (ISampleRule extension in extensions)
                {
                    if (extension.Type.Equals(ServerRuleTypeEnum.DataAccess))
                    {
                        SampleRuleDropDownList.Items.Add(new ListItem(extension.Description, extension.Name));
                    }
                }

                DataRuleValidator.RuleTypeControl = ServerRuleTypeEnum.DataAccess.Lookup;
            }
            else
            {
                ModalDialog.Title    = SR.DialogAddDataRuleTitle;
                OKButton.Visible     = true;
                UpdateButton.Visible = false;

                DefaultCheckBox.Checked    = _rule.DefaultRule;
                EnabledCheckBox.Checked    = _rule.Enabled;
                ExemptRuleCheckBox.Checked = _rule.ExemptRule;


                RuleNameTextBox.Text = _rule.RuleName;

                SampleRuleDropDownList.Visible = false;
                SelectSampleRuleLabel.Visible  = false;


                // Fill in the Rule XML
                var sw = new StringWriter();

                var xmlSettings = new XmlWriterSettings
                {
                    Encoding            = Encoding.UTF8,
                    ConformanceLevel    = ConformanceLevel.Fragment,
                    Indent              = true,
                    NewLineOnAttributes = false,
                    CheckCharacters     = true,
                    IndentChars         = "  "
                };

                XmlWriter tw = XmlWriter.Create(sw, xmlSettings);

                XmlNode node2 = _rule.RuleXml.SelectSingleNode("/rule/condition");

                node2.WriteTo(tw);

                tw.Close();

                RuleXmlTextBox.Text = sw.ToString();

                DataRuleValidator.RuleTypeControl = ServerRuleTypeEnum.DataAccess.Lookup;

                AuthorityGroupCheckBoxList.ClearSelection();

                foreach (XmlNode node in _rule.RuleXml.SelectNodes("/rule/action/grant-access"))
                {
                    string   oid  = node.Attributes["authorityGroupOid"].Value;
                    ListItem item = AuthorityGroupCheckBoxList.Items.FindByValue(oid);
                    if (item != null)
                    {
                        item.Selected = true;
                    }
                }
            }

            ModalDialog.Show();
            return;
        }