Example #1
0
 private static void SetButtonsClickEvents(Button save, Button cancel, Views.DialogWindow dialogWindow, TextBox fileName, TextBox extension, CheckBox hidden, string path)
 {
     cancel.Click += delegate
     {
         dialogWindow.Close();
     };
     save.Click += delegate
     {
         FileInfo     fileInfo     = new FileInfo(path);
         FileSecurity fileSecurity = fileInfo.GetAccessControl();
         string       user         = System.Environment.UserName;
         fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.FullControl, AccessControlType.Allow));
         fileInfo.SetAccessControl(fileSecurity);
         FileProperties file = new FileProperties()
         {
             CheckboxName = fileInfo.FullName,
             FileName     = fileInfo.Name,
             CreatedTime  = fileInfo.CreationTime,
             Size         = System.String.Format("{0}KB", fileInfo.Length / 1024),
         };
         file.GetFileName(path);
         file.SetExtension(extension.Text, path);
         if (hidden.IsChecked == true)
         {
             file.isHidden = true;
         }
         else
         {
             file.isHidden = false;
         }
         file.HideFile(path);
         file.ChangeName(fileName.Text, path);
         dialogWindow.Close();
     };
 }
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
            if (wndConfirmacion != null)
            {
                wndConfirmacion.Hide();
            }
            if (wndConfirmacionCondiciones != null)
            {
                wndConfirmacionCondiciones.Close();
            }
            if (errorWnd != null)
            {
                errorWnd.Close();
            }

            TimerService.Stop();
            if ((navigationContext.Uri.OriginalString != "CuponesAutorizadoView") &
                (navigationContext.Uri.OriginalString != "CuponesLoginView") &
                (navigationContext.Uri.OriginalString != "CuponesInicioView") &
                (navigationContext.Uri.OriginalString != "CuponesCondicionesView") &
                (navigationContext.Uri.OriginalString != "CuponesRegistroView"))
            {
                navigationContext.NavigationService.Region.Context = null;
                return;
            }
        }
Example #3
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     if (errorWnd != null)
     {
         errorWnd.Close();
     }
     TimerService.Stop();
 }