Exemplo n.º 1
0
 public void InvokeAdvancedDlg([MarshalAs(UnmanagedType.LPWStr)] string dllPath, [MarshalAs(UnmanagedType.LPWStr)] string path, int tabPage, bool modal)
 {
     string windowName = string.Format(resourceManager.GetString("iFolderProperties"), Path.GetFileName(path));
        Win32Window win32Window = Win32Util.Win32Window.FindWindow(null, windowName);
        if (win32Window != null)
        {
     win32Window.BringWindowToTop();
        }
        else
        {
     try
     {
      iFolderAdvanced ifolderAdvanced = new iFolderAdvanced();
      ifolderAdvanced.Name = path;
      ifolderAdvanced.Text = windowName;
      connectToWebService();
      ifolderAdvanced.CurrentiFolder = ifWebService.GetiFolderByLocalPath(path);
      ifolderAdvanced.LoadPath = dllPath;
      ifolderAdvanced.ActiveTab = tabPage;
      if (modal)
      {
       ifolderAdvanced.ShowDialog();
      }
      else
      {
       ifolderAdvanced.Show();
      }
     }
     catch (WebException e)
     {
      MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("propertiesDialogError"), resourceManager.GetString("propertiesErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
      mmb.ShowDialog();
      ifWebService = null;
      if (e.Status == WebExceptionStatus.ProtocolError)
      {
       LocalService.ClearCredentials();
      }
     }
     catch (Exception e)
     {
      MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("propertiesDialogError"), resourceManager.GetString("propertiesErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
      mmb.ShowDialog();
     }
        }
 }