Exemplo n.º 1
0
 public bool AcceptiFolder(iFolderWeb ifolder, out bool added, bool mergeFolder)
 {
     bool result = false;
     added = false;
     if (ifolder.MigratediFolder > 0)
     {
         if (MigrationWindow.OldiFoldersPresent() == true)
         {
             System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(FormsTrayApp));
             MyMessageBox mmb = new MyMessageBox(resManager.GetString("MigrationMergePrompt.Text"), resManager.GetString("MigrationAlert"), "", MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question);
             DialogResult res = mmb.ShowDialog();
             if (res == DialogResult.OK)
             {
                 Novell.FormsTrayApp.MigrationWindow migrationWindow = new MigrationWindow(this.ifWebService, this.simiasWebService);
                 migrationWindow.Merge = true;
                 migrationWindow.iFolderName = ifolder.Name;
                 migrationWindow.ShowDialog();
                 string loc = migrationWindow.iFolderLocation;
                 string uName = migrationWindow.UserName;
                 if (loc == null || uName == null)
                 {
                     return false;
                 }
                 else
                 {
                     result = acceptiFolder(ifolder, loc, out added, true);
                     if (result == true)
                     {
                         MigrationWindow.RemoveRegistryForUser(uName);
                     }
                 }
                 return result;
             }
         }
     }
        string selectedPath = string.Empty;
        FolderBrowserDialog browserDialog = new FolderBrowserDialog();
        Cursor.Current = Cursors.WaitCursor;
        while (true)
        {
     browserDialog.ShowNewFolderButton = true;
     browserDialog.SelectedPath = selectedPath;
         if (!mergeFolder)
         {
             browserDialog.Description = string.Format(TrayApp.Properties.Resources.acceptDescription, ifolder.Name);
         }
         else
         {
             browserDialog.Description = string.Format(TrayApp.Properties.Resources.mergeDescription, ifolder.Name);
         }
     DialogResult dialogResult = browserDialog.ShowDialog();
     if ( dialogResult == DialogResult.OK )
     {
      browserDialog.Dispose();
      Invalidate();
      Update();
             result = acceptiFolder(ifolder, browserDialog.SelectedPath, out added, mergeFolder);
             if (result && !added)
             {
                 break;
             }
      else if ( result )
      {
                 if (!mergeFolder)
                     DownloadPath = browserDialog.SelectedPath + ifolder.Name;
                 else
                     DownloadPath = browserDialog.SelectedPath;
       break;
      }
     }
     else
     {
      browserDialog.Dispose();
      break;
     }
        }
        Cursor.Current = Cursors.Default;
     refreshAll();
        return result;
 }
Exemplo n.º 2
0
 private void populateServeriFolderInfo(iFolderWeb ifolderWeb)
 {
     enableServerFolderLabels(true);
     int displayableLength = 20;
     this.titleName.Text = TrayApp.Properties.Resources.name + ":  " + FormatString(ifolderWeb.Name, displayableLength);
     this.titleOwner.Text = TrayApp.Properties.Resources.owner + ":  " + ifolderWeb.Owner;
     if (ifolderWeb.encryptionAlgorithm != null && ifolderWeb.encryptionAlgorithm != "")
         this.titleEncrypted.Text = Resources.type + ":  " + Resources.encrypted;
     else
         this.titleEncrypted.Text = Resources.type + ":  " + Resources.regular;
     try
     {
         iFolderUser[] ifolderUsers = ifWebService.GetiFolderUsers(ifolderWeb.ID);
         foreach (iFolderUser ifolderUser in ifolderUsers)
         {
             if (ifolderUser.UserID.Equals(ifolderWeb.CurrentUserID))
                 this.titleAccess.Text = Resources.access + ":  " + ifolderUser.Rights.ToString();
         }
     }
     catch { }
     this.titleServerorSize.Text = Resources.server + ":  " +
         simiasWebService.GetDomainInformation(ifolderWeb.DomainID).Host;
     this.titleLastSyncTime.Text = Resources.lastSyncTime + ":  " + Resources.na;
 }
Exemplo n.º 3
0
 public bool AcceptiFolder(iFolderWeb ifolder, out bool added)
 {
     return AcceptiFolder(ifolder, out added, false);
 }
Exemplo n.º 4
0
 public void UpdateDisplay( iFolderWeb ifolder, string path)
 {
     (Novell.FormsTrayApp.FormsTrayApp.globalProp()).UpdateDisplay(ifolder, path);
 }
Exemplo n.º 5
0
 public static bool AdvancedConflictResolver(iFolderWebService ifWebService, iFolderWeb selectedItem)
 {
     const string assemblyName = @"lib\plugins\EnhancedConflictResolution.dll";
     const string enhancedConflictResolverClass = "Novell.EnhancedConflictResolution.EnhancedConflictResolver";
     const string showConflictResolverMethod = "Show";
     System.Object[] args = new System.Object[3];
     try
     {
         if (assemblyName != null)
         {
             Assembly idAssembly = Assembly.LoadFrom(assemblyName);
             if (idAssembly != null)
             {
                 Type type = idAssembly.GetType(enhancedConflictResolverClass);
                 if (null != type)
                 {
                     args[0] = ifWebService;
                     args[1] = Application.StartupPath;
                     args[2] = selectedItem;
                     System.Object enhancedConflictResolver = Activator.CreateInstance(type, args);
                     try
                     {
                         MethodInfo method = type.GetMethod(showConflictResolverMethod, Type.EmptyTypes);
                         if (null != method)
                         {
                             method.Invoke(enhancedConflictResolver, null);
                             return true;
                         }
                     }
                     catch (Exception e)
                     {
                         FormsTrayApp.log.Info("Message {0}, type {1}, trace {2} ", e.Message, e.GetType(), e.StackTrace);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         FormsTrayApp.log.Info("Message {0}, type {1}, trace {2} ", ex.Message, ex.GetType(), ex.StackTrace);
     }
     return false;
 }
Exemplo n.º 6
0
 public void UpdateDisplay( iFolderWeb ifolderWeb, string DownloadPath)
 {
     iFolderObject ifobj = new iFolderObject(ifolderWeb, iFolderState.Initial);
        addiFolderToListView(ifobj);
        if( acceptedFolders.Contains(ifolderWeb.ID) )
     acceptedFolders.Remove(ifolderWeb.ID);
        ifolderWeb.UnManagedPath = DownloadPath;
        TileListViewItem tlvi = new TileListViewItem(ifobj);
        acceptedFolders.Add(ifolderWeb.ID, tlvi);
     ifobj = null;
     tlvi = null;
 }
Exemplo n.º 7
0
 public iFolderObject(iFolderWeb ifolderWeb, iFolderState ifolderState)
 {
     this.ifolderWeb = ifolderWeb;
        this.ifolderState = ifolderState;
 }
Exemplo n.º 8
0
 public iFolderWeb GetiFolder(string iFolderID)
 {
     iFolderWeb ifolder = null;
        ArrayList collectionList;
        Store store = Store.GetStore();
        Collection col = store.GetCollectionByID(iFolderID);
        if (col != null)
        {
     if(col.IsType(col, iFolderWeb.iFolderType))
      ifolder = new iFolderWeb(col);
     else
      ifolder = null;
        }
        else
        {
     CollectionInfo ci = DiscoveryFramework.GetLocalCollectionInfo(iFolderID);
         if(ci == null)
             ci = DiscoveryFramework.GetCollectionInfo(iFolderID);
     ifolder = new iFolderWeb(ci);
        }
        return ifolder;
 }
Exemplo n.º 9
0
 public iFolderWeb GetiFolderByLocalPath(string LocalPath)
 {
     iFolderWeb ifolder = null;
        Collection col = SharedCollection.GetCollectionByPath(LocalPath);
        if(col != null)
        {
     ifolder = new iFolderWeb(col);
        }
        return ifolder;
 }
Exemplo n.º 10
0
 public iFolderWeb RevertiFolder(string iFolderID)
 {
     iFolderWeb ifolder = null;
                 CollectionInfo cinfo = SharedCollection.RevertSharedCollection(iFolderID);
                 if (cinfo != null)
                 {
                         ifolder = new iFolderWeb(cinfo);
                 }
                 return ifolder;
 }
Exemplo n.º 11
0
 public iFolderWeb AcceptiFolderInvitation( string DomainID,
   string iFolderID,
   string LocalPath)
 {
     Store store = Store.GetStore ();
       CollectionInfo cinfo = DiscoveryFramework.GetLocalCollectionInfo (iFolderID);
     if(cinfo == null)
         cinfo = DiscoveryFramework.GetCollectionInfo(iFolderID);
     if(cinfo == null)
      throw new Exception("Invalid iFolderID");
        string path = Path.Combine(LocalPath, cinfo.DirNodeName);
        if (Directory.Exists(path))
     throw new Exception("PathExists");
        CollectionPathStatus pStatus;
        pStatus = SharedCollection.CheckCollectionPath(path);
        switch(pStatus)
        {
     case CollectionPathStatus.ValidPath:
      break;
     case CollectionPathStatus.RootOfDrivePath:
      throw new Exception("RootOfDrivePath");
     case CollectionPathStatus.InvalidCharactersPath:
      throw new Exception("InvalidCharactersPath");
     case CollectionPathStatus.AtOrInsideStorePath:
      throw new Exception("AtOrInsideStorePath");
     case CollectionPathStatus.ContainsStorePath:
      throw new Exception("ContainsStorePath");
     case CollectionPathStatus.NotFixedDrivePath:
      throw new Exception("NotFixedDrivePath");
     case CollectionPathStatus.SystemDirectoryPath:
      throw new Exception("SystemDirectoryPath");
     case CollectionPathStatus.SystemDrivePath:
      throw new Exception("SystemDrivePath");
     case CollectionPathStatus.IncludesWinDirPath:
      throw new Exception("IncludesWinDirPath");
     case CollectionPathStatus.IncludesProgFilesPath:
      throw new Exception("IncludesProgFilesPath");
     case CollectionPathStatus.DoesNotExistPath:
      throw new Exception("DoesNotExistPath");
     case CollectionPathStatus.NoReadRightsPath:
      throw new Exception("NoReadRightsPath");
     case CollectionPathStatus.NoWriteRightsPath:
      throw new Exception("NoWriteRightsPath");
     case CollectionPathStatus.ContainsCollectionPath:
      throw new Exception("ContainsCollectionPath");
     case CollectionPathStatus.AtOrInsideCollectionPath:
      throw new Exception("AtOrInsideCollectionPath");
        }
        DiscoveryFramework.CreateProxy (store, cinfo, DomainID, iFolderID, Path.GetFullPath (path));
        iFolderWeb ifolder = new iFolderWeb(cinfo);
     ifolder.State = "Available";
        ifolder.Role = "Master";
     ifolder.UnManagedPath = path;
     ifolder.IsSubscription = false;
        return ifolder;
 }
Exemplo n.º 12
0
 public iFolderWeb AcceptiFolderInvitation1( string DomainID,
                                                                                            string iFolderID,
                                                                                         string LocalPath)
 {
     Store store = Store.GetStore();
                 POBox poBox = Simias.POBox.POBox.FindPOBox(store,
                                         DomainID,
                                         store.GetUserIDFromDomainID(DomainID));
                 Node node = poBox.GetNodeByID(iFolderID);
                 if(node == null)
                         throw new Exception("Invalid iFolderID : id : "+ iFolderID);
                 Subscription sub = new Subscription(node);
                 string path = Path.Combine(LocalPath, sub.DirNodeName);
                 if (Directory.Exists(path))
                         throw new Exception("PathExists");
                 CollectionPathStatus pStatus;
        pStatus = SharedCollection.CheckCollectionPath(path);
                 switch(pStatus)
                 {
                         case CollectionPathStatus.ValidPath:
                                 break;
                         case CollectionPathStatus.RootOfDrivePath:
                                 throw new Exception("RootOfDrivePath");
                         case CollectionPathStatus.InvalidCharactersPath:
                                 throw new Exception("InvalidCharactersPath");
                         case CollectionPathStatus.AtOrInsideStorePath:
                                 throw new Exception("AtOrInsideStorePath");
                         case CollectionPathStatus.ContainsStorePath:
                                 throw new Exception("ContainsStorePath");
                         case CollectionPathStatus.NotFixedDrivePath:
                                 throw new Exception("NotFixedDrivePath");
                         case CollectionPathStatus.SystemDirectoryPath:
                                 throw new Exception("SystemDirectoryPath");
                         case CollectionPathStatus.SystemDrivePath:
                                 throw new Exception("SystemDrivePath");
                         case CollectionPathStatus.IncludesWinDirPath:
                                 throw new Exception("IncludesWinDirPath");
                         case CollectionPathStatus.IncludesProgFilesPath:
                                 throw new Exception("IncludesProgFilesPath");
                         case CollectionPathStatus.DoesNotExistPath:
                                 throw new Exception("DoesNotExistPath");
                         case CollectionPathStatus.NoReadRightsPath:
                                 throw new Exception("NoReadRightsPath");
                         case CollectionPathStatus.NoWriteRightsPath:
                                 throw new Exception("NoWriteRightsPath");
                         case CollectionPathStatus.ContainsCollectionPath:
                                 throw new Exception("ContainsCollectionPath");
                         case CollectionPathStatus.AtOrInsideCollectionPath:
                                 throw new Exception("AtOrInsideCollectionPath");
                 }
                 sub.CollectionRoot = Path.GetFullPath(LocalPath);
                 if(sub.SubscriptionState == SubscriptionStates.Ready)
                 {
                         poBox.Commit(sub);
     sub.CreateSlave(store);
                 }
                 else
                 {
                         sub.Accept(store, SubscriptionDispositions.Accepted);
                         poBox.Commit(sub);
                 }
                 iFolderWeb ifolder = new iFolderWeb(sub);
                 return ifolder;
 }
Exemplo n.º 13
0
 private void apply_Click(object sender, System.EventArgs e)
 {
     this.processChanges();
        try
        {
     connectToWebService();
     string id = currentiFolder.ID;
     currentiFolder = null;
     currentiFolder = ifWebService.GetiFolder(id);
        }
        catch (Exception ex)
        {
     MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("iFolderReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mmb.ShowDialog();
        }
 }
Exemplo n.º 14
0
 private void nodeEvent(iFolderWeb ifolder, iFolderUser ifolderUser, string eventData)
 {
     try
        {
     if (ifolder != null)
     {
      currentiFolder = ifolder;
     }
     else if (ifolderUser != null)
     {
      ListViewItem lvi;
      lock (subscrHT)
      {
       lvi = (ListViewItem)subscrHT[ifolderUser.ID];
      }
      if (lvi != null)
      {
       ShareListMember slMember = (ShareListMember)lvi.Tag;
       slMember.iFolderUser = ifolderUser;
       lvi.Tag = slMember;
       updateListViewItem(lvi);
      }
      else if (eventData.Equals("NodeCreated"))
      {
       addiFolderUserToListView(ifolderUser);
      }
     }
     else
     {
      lock (subscrHT)
      {
       ListViewItem lvi = (ListViewItem)subscrHT[eventData];
       if (lvi != null)
       {
        lvi.Remove();
        subscrHT.Remove(eventData);
        lock (userIDHT)
        {
     ListViewItem lvitem = (ListViewItem)userIDHT[((ShareListMember)lvi.Tag).iFolderUser.UserID];
     if ((lvitem != null) && (subscrHT[((ShareListMember)lvitem.Tag).iFolderUser.ID] == null))
     {
      userIDHT.Remove(((ShareListMember)lvi.Tag).iFolderUser.UserID);
     }
        }
       }
      }
     }
        }
        catch
        {
        }
 }
Exemplo n.º 15
0
 public void AddiFolderToAcceptediFolders(iFolderWeb ifolder, TileListViewItem selecteditem, String Path)
 {
     if (Path != null)
         DownloadPath = Path;
     if (selecteditem != null)
         removeTileListViewItem(selecteditem);
     if (ht.ContainsKey(ifolder.ID))
     {
         removeTileListViewItem((TileListViewItem)ht[ifolder.ID]);
     }
     iFolderObject ifolderobj = new iFolderObject(ifolder, iFolderState.Initial);
     addiFolderToListView(ifolderobj);
     if (acceptedFolders.Contains(ifolderobj.iFolderWeb.ID))
         acceptedFolders.Remove(ifolderobj.iFolderWeb.ID);
     ifolderobj.iFolderWeb.UnManagedPath = DownloadPath;
     TileListViewItem tlvi = new TileListViewItem(ifolderobj);
     acceptedFolders.Add(ifolderobj.iFolderWeb.ID, tlvi);
     ifolderobj = null;
     tlvi = null;
 }
Exemplo n.º 16
0
 public iFolderWeb GetiFolderInvitation(string POBoxID, string iFolderID)
 {
     iFolderWeb ifolder = null;
        CollectionInfo ci = DiscoveryFramework.GetLocalCollectionInfo(iFolderID);
     if(ci == null)
         ci = DiscoveryFramework.GetCollectionInfo(iFolderID);
        ifolder = new iFolderWeb(ci);
        return ifolder;
 }
Exemplo n.º 17
0
 public void AddToAcceptedFolders(iFolderWeb ifWeb)
 {
     iFolderObject ifobj = new iFolderObject(ifWeb, iFolderState.Initial);
     addiFolderToListView(ifobj);
     TileListViewItem tlvi = new TileListViewItem(ifobj);
     acceptedFolders.Add(ifWeb.ID, tlvi);
     ifobj = null;
     tlvi = null;
 }
Exemplo n.º 18
0
 private bool DownloadiFolder(iFolderWeb defaultiFolder)
 {
     bool status = false;
     if (defaultiFolder.encryptionAlgorithm == null || defaultiFolder.encryptionAlgorithm == "")
     {
         status = true;
     }
     else
     {
         string passphrasecheck = null;
         passphrasecheck = simws.GetPassPhrase(domainInfo.ID);
         if (passphrasecheck == null || passphrasecheck == "")
         {
             VerifyPassphraseDialog vpd = new VerifyPassphraseDialog(domainInfo.ID, this.simws);
             vpd.ShowDialog();
             status = vpd.PassphraseStatus;
         }
         else
         {
             status = true;
         }
     }
     if (status == true)
     {
         try
         {
             string downloadpath = this.LocationEntry.Text;
             DirectoryInfo di = new DirectoryInfo(downloadpath);
             if (di.Name == defaultiFolder.Name)
             {
                 downloadpath = Directory.GetParent(this.LocationEntry.Text).ToString();
                 di = new DirectoryInfo(downloadpath);
             }
             di.Create();
             iFolderWeb ifolder = null;
             if (System.IO.Directory.Exists(Path.Combine(downloadpath, defaultiFolder.Name)))
             {
                 MyMessageBox mmb = new MyMessageBox(resManager.GetString("selectoption"), resManager.GetString("alreadyexists"), String.Empty, MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button1);
                 if (mmb.ShowDialog() == DialogResult.OK)
                 {
                     ifolder = this.ifws.MergeiFolder(defaultiFolder.DomainID, defaultiFolder.ID, Path.Combine(downloadpath, defaultiFolder.Name));
                 }
                 else
                     return false;
             }
             else
                 ifolder = this.ifws.AcceptiFolderInvitation(defaultiFolder.DomainID, defaultiFolder.ID, downloadpath);
             AccountWizard wiz = (AccountWizard)this.Parent;
             if (ifolder != null && wiz != null)
             {
                 wiz.GlobalProps.AddiFolderToAcceptediFolders(ifolder, null, downloadpath);
             }
             wiz.UpdateDisplay(ifolder, Path.Combine(downloadpath, ifolder.Name));
         }
         catch (Exception ex)
         {
             DisplayErrorMesg(ex);
             return false;
         }
         return true;
     }
     else return status;
 }
Exemplo n.º 19
0
 private bool acceptiFolder(iFolderWeb ifolder, string path, out bool added, bool mergeFolder)
 {
     bool download = false;
     bool result = true;
     bool repeatFlag = false;
     added = true;
     if (GetDriveType(Path.GetPathRoot(path)) == DRIVE_FIXED)
     {
         if (Win32Security.AccessAllowed(path))
         {
             try
             {
                 if (ifolder.encryptionAlgorithm == null || ifolder.encryptionAlgorithm == "")
                 {
                     download = true;
                 }
                 else
                 {
                     string passphrasecheck = null;
                     passphrasecheck = simiasWebService.GetPassPhrase(ifolder.DomainID);
                     if (passphrasecheck == null || passphrasecheck == "")
                     {
                         VerifyPassphraseDialog vpd = new VerifyPassphraseDialog(ifolder.DomainID, simiasWebService);
                         vpd.ShowDialog();
                         download = vpd.PassphraseStatus;
                     }
                     else
                     {
                         download = true;
                     }
                 }
                 if (download)
                 {
                     Cursor = Cursors.WaitCursor;
                     if (mergeFolder == true)
                     {
             string mergediFolder = path;
             if(System.IO.Path.GetFileName(mergediFolder) != ifolder.Name)
             {
              throw new Exception("FolderDoesNotExist");
             }
                         if (Directory.Exists(mergediFolder) == false)
                         {
                             throw new Exception("PathDoesNotExist");
                         }
                         if (ifWebService.IsiFolder(mergediFolder) == true)
                         {
                             throw new Exception("AtOrInsideCollectionPath");
                         }
                         ifWebService.MergeiFolder(ifolder.DomainID, ifolder.ID, mergediFolder);
                         Cursor = Cursors.Default;
                     }
                     else
                     {
                          DirectoryInfo di = new DirectoryInfo(path);
                         if (di.Name == ifolder.Name)
                         {
                             path = Directory.GetParent(path).ToString();
                         }
                         if( System.IO.Directory.Exists( Path.Combine(path,ifolder.Name)) )
                         {
                             MyMessageBox mmb = new MyMessageBox(Resources.OkMergeCancel,Resources.Folderexists, String.Empty, MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button1);
                       if (mmb.ShowDialog() == DialogResult.OK)
                 {
                                 ifWebService.MergeiFolder(ifolder.DomainID, ifolder.ID, Path.Combine(path, ifolder.Name));
                             }
                             else
                                 return false;
                }
                   else
                       ifWebService.AcceptiFolderInvitation(ifolder.DomainID, ifolder.ID, path);
                         Cursor = Cursors.Default;
                     }
                 }
                 else
                 {
                     result = true;
                     added = false;
                 }
             }
             catch (Exception ex)
             {
                 Cursor = Cursors.Default;
                 added = false;
                 MyMessageBox mmb;
                 if (ex.Message.IndexOf("260") != -1)
                 {
                     mmb = new MyMessageBox("The iFolder path is too long for the File System. Download failed", "Path Too Long", string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                     repeatFlag = true;
                 }
                 else if (ex.Message.IndexOf("PathExists") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathExistsError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("AtOrInsideStorePath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathInStoreError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("AtOrInsideCollectionPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathIniFolderError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("IncludesWinDirPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathIncludesWinDirError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("IncludesProgFilesPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.PathIncludesProgFilesDirError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("PathDoesNotExist") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.PathDoesNotExist, TrayApp.Properties.Resources.pathInvalidErrorTitle, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("FolderDoesNotExist") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.FolderDoesNotExistError, TrayApp.Properties.Resources.FolderDoesNotExistErrorTitle, TrayApp.Properties.Resources.FolderDoesNotExistErrorDesc, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.acceptError, string.Empty, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 if (!repeatFlag)
                     result = false;
             }
         }
         else
         {
             result = false;
             MyMessageBox mmb = new MyMessageBox(TrayApp.Properties.Resources.accessDenied, string.Empty, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
             mmb.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show(TrayApp.Properties.Resources.networkPath, TrayApp.Properties.Resources.pathInvalidErrorTitle);
         result = false;
     }
     return result;
 }
Exemplo n.º 20
0
 private void createChangeEvent(iFolderWeb ifolder, string eventData)
 {
     if (ifolder != null)
        {
     if (eventData.Equals("NodeCreated"))
     {
      {
       iFolderObject ifobject = new iFolderObject(ifolder, iFolderState.Normal);
                 addiFolderToListView(ifobject);
                 ifobject = null;
       if ( !ifolder.IsSubscription )
       {
        Win32Window.ShChangeNotify(Win32Window.SHCNE_UPDATEITEM, Win32Window.SHCNF_PATHW, ifolder.UnManagedPath, IntPtr.Zero);
       }
       if (!ifolder.IsSubscription)
       {
        lock (ht)
        {
     TileListViewItem[] lvia = new TileListViewItem[ht.Count];
     ht.Values.CopyTo(lvia, 0);
     foreach(TileListViewItem lvi in lvia)
     {
      iFolderObject ifo = lvi.Tag as iFolderObject;
      if (ifo.iFolderWeb.IsSubscription &&
       (ifo.iFolderWeb.CollectionID == ifolder.CollectionID))
      {
       ht.Remove(ifo.iFolderWeb.ID);
       lvi.Remove();
       break;
      }
     }
        }
       }
      }
     }
     else
     {
      TileListViewItem tlvi;
      lock (ht)
      {
       tlvi = (TileListViewItem)ht[ifolder.ID];
      }
             if (tlvi != null)
      {
       ((iFolderObject)tlvi.Tag).iFolderWeb = ifolder;
       updateListViewItem(tlvi);
      }
     }
        }
 }
Exemplo n.º 21
0
 private void createChangeEvent(iFolderWeb ifolder, iFolderUser ifolderUser, string eventData)
 {
     try
        {
     if (ifolder.HasConflicts)
     {
      if (Preferences.NotifyCollisionEnabled)
      {
       ifolderFromNotify = ifolder;
       string message = string.Format(resourceManager.GetString("collisionMessage"), ifolder.Name);
       notifyType = NotifyType.Collision;
       shellNotifyIcon.DisplayBalloonTooltip(resourceManager.GetString("actionRequiredTitle"), message, BalloonType.Info);
      }
     }
     else if (ifolder.State.Equals("Available") && eventData.Equals("NodeCreated"))
     {
      if (Preferences.NotifyShareEnabled)
      {
       ifolderFromNotify = ifolder;
       string title = string.Format(resourceManager.GetString("subscriptionTitle"), ifolder.Name);
       string message = string.Format(resourceManager.GetString("subscriptionMessage"), ifolder.Owner);
       notifyType = NotifyType.Subscription;
       shellNotifyIcon.DisplayBalloonTooltip(title, message, BalloonType.Info);
      }
     }
     else if (ifolderUser != null)
     {
      if (Preferences.NotifyJoinEnabled)
      {
       ifolderFromNotify = ifolder;
       string message = string.Format(resourceManager.GetString("newMemberMessage"),
        (ifolderUser.FN != null) && !ifolderUser.FN.Equals(string.Empty) ? ifolderUser.FN : ifolderUser.Name,
        ifolder.Name);
       notifyType = NotifyType.NewMember;
       shellNotifyIcon.DisplayBalloonTooltip(resourceManager.GetString("newMemberTitle"), message, BalloonType.Info);
      }
     }
        }
        catch {}
 }
Exemplo n.º 22
0
 public iFolderWeb GetMinimaliFolder(string iFolderID, int infoToFetch)
 {
     if(infoToFetch == 0)
     return GetiFolder(iFolderID);
        iFolderWeb ifolder = null;
        Store store = Store.GetStore();
        Collection col = store.GetCollectionByID(iFolderID);
        if (col != null)
        {
     if(col.IsType(col, iFolderWeb.iFolderType))
      ifolder = new iFolderWeb(col, infoToFetch);
     else
      ifolder = null;
        }
        else
        {
     CollectionInfo ci = DiscoveryFramework.GetLocalCollectionInfo(iFolderID);
     if(ci == null)
      ci = DiscoveryFramework.GetCollectionInfo(iFolderID);
     ifolder = new iFolderWeb(ci);
        }
        return ifolder;
 }