예제 #1
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);
        }
예제 #2
0
        private async Task ShowCreateStickyNote()
        {
            var options = new ModalDialogOptions
            {
                Style = "modal-base",
                BackgroundClickToClose = false
            };
            ModalDialogResult modalResult = await ModalService.ShowDialogAsync <AddStickyNote>("Create a sticky note", options);

            var result = modalResult.ReturnParameters;

            if (!modalResult.Success)
            {
                return;
            }
            var note      = result.Get <StickyNote>("StickyNoteModel");
            var userNotes = LocalStorage.GetItem <UserStickyNotes>($"{AppState.UserName}-StickyNotes");

            if (userNotes == null || userNotes?.StickyNotes?.Count == 0)
            {
                AppState.UserStickyNotes ??= new UserStickyNotes {
                    UserName = AppState.UserName
                };
                AppState.UserStickyNotes.StickyNotes ??= new List <StickyNote>();
            }
            else
            {
                AppState.UserStickyNotes = userNotes;
            }
            AppState.UserStickyNotes.StickyNotes.Add(note);
            _selectOption = "Sticky";
            LocalStorage.SetItem($"{AppState.UserName}-StickyNotes", AppState.UserStickyNotes);
            AppState.StickyNote = note;
        }
예제 #3
0
 private void Cancel2Button_Click(object sender, RoutedEventArgs e)
 {
     if (_buttons == ModalDialogButtons.YesNoCancel)
     {
         _result = ModalDialogResult.Cancel;
     }
     HideHandlerDialog();
 }
예제 #4
0
        public async void OnClickEdit(ItemClickEventArgs e)
        {
            StateHasChanged();

            var parameters = new ModalDialogParameters();

            parameters.Add("Link", e.Data as UserLinkViewModel);
            ModalDialogResult result = await ModalDialog.ShowDialogAsync <Edit>("Edit Form", null, parameters);

            if (result.Success)
            {
                UserLinkVM = result.ReturnParameters.Get <UserLinkViewModel>("Link");
                await OnUpdate.InvokeAsync(new ChangeEventArgs { Value = UserLinkVM });
            }
            StateHasChanged();
        }
 /// <summary>
 /// Closes the dialog and returns the specified result and returnValue to the client script caller.
 /// </summary>
 /// <param name="result"></param>
 /// <param name="returnValue">Value to pass to the client script callback method defined when opening the Modal Dialog.</param>
 protected void EndOperation(ModalDialogResult result, string returnValue)
 {
     if (this.IsInDialogMode)
     {
         Page.Response.Clear();
         Page.Response.Write(String.Format(CultureInfo.InvariantCulture,
                                           "<script type=\"text/javascript\">window.frameElement.commonModalDialogClose({0}, {1});</script>",
                                           new object[]
         {
             (int)result,
             String.IsNullOrEmpty(returnValue) ? "null" : returnValue
         }));
         Page.Response.End();
     }
     else
     {
         RedirectOnOK();
     }
 }
예제 #6
0
 /// <summary>
 /// Call after completing custom logic in the Application Page.
 /// </summary>
 /// <param name="result">Result code to pass to the output. Available results: -1 = invalid; 0 = cancel; 1 = OK</param>
 /// <param name="returnValue">Value to pass to the callback method defined when opening the Modal Dialog.</param>
 public void EndOperation(ModalDialogResult result, string returnValue)
 {
     if (IsPopUI)
     {
         if (string.IsNullOrEmpty(PageToRedirectOnOK))
         {
             Page.Response.Clear();
             Page.Response.Write(String.Format(CultureInfo.InvariantCulture, "<script type=\"text/javascript\">window.frameElement.commonModalDialogClose({0}, {1});</script>",
                                               new object[] {
                 (int)result,
                 String.IsNullOrEmpty(returnValue) ? "null" :  returnValue
             }));
             Page.Response.End();
         }
         else
         {
             ScriptManager.RegisterStartupScript((Page)this, typeof(EnhancedLayoutsPage), "RedirectToCreatedPage", "window.frameElement.navigateParent('" + SPHttpUtility.EcmaScriptStringLiteralEncode(SPHttpUtility.UrlPathEncode(PageToRedirectOnOK, false)) + "');", true);
         }
     }
     else
     {
         RedirectOnOK();
     }
 }
예제 #7
0
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     _result = _buttons == ModalDialogButtons.OkCancel ? ModalDialogResult.Cancel : ModalDialogResult.No;
     HideHandlerDialog();
 }
예제 #8
0
 private void OkButton_Click(object sender, RoutedEventArgs e)
 {
     _result = _buttons == ModalDialogButtons.Ok ? ModalDialogResult.Ok : ModalDialogResult.Yes;
     HideHandlerDialog();
 }
 /// <summary>
 /// Closes the dialog and returns the specified result to the client script caller.
 /// </summary>
 /// <param name="result"></param>
 protected void EndOperation(ModalDialogResult result)
 {
     EndOperation(result, this.PageToRedirectOnOK);
 }
예제 #10
0
 private void CloseImage_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     DialogResult = Miscellaneous.ModalDialogResult.Cancel;
     FadeOut();
     e.Handled = true;
 }
예제 #11
0
 void modalUserControl_OKClicked(object sender, EventArgs e)
 {
     DialogResult = Miscellaneous.ModalDialogResult.OK;
     FadeOut();
 }
예제 #12
0
        public void Close()
        {
            DialogResult = Miscellaneous.ModalDialogResult.Cancel;

            FadeOut();
        }
예제 #13
0
 /// <summary>
 /// Call after completing custom logic in the Application Page.
 /// </summary>
 /// <param name="result">Result code to pass to the output. Available results: -1 = invalid; 0 = cancel; 1 = OK</param>
 public void EndOperation(ModalDialogResult result)
 {
     EndOperation(result, PageToRedirectOnOK);
 }