Пример #1
0
        /// <summary>
        /// Set the tool tip text
        /// </summary>
        private void setToolTipText()
        {
            //System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TileListViewItem));
            string text = resources.GetString("Name") + " " + completeName;

            iFolderObject ifolderObject = (iFolderObject)Tag;

            if (ifolderObject.iFolderWeb.IsSubscription)
            {
                //MessageBox.Show(string.Format("the size is: {0}", ifolderObject.iFolderWeb.Size));
                //remove the comment to display the size in bytes
                text += "\n" + completeLocation;                 //+"Size: " + completeStatus/*ifolderObject.iFolderWeb.Size*/ + "\n";
            }
            else
            {
                text += "\n" + resources.GetString("Location") + " " + completeLocation;

                if (ifolderObject.iFolderState.Equals(iFolderState.Normal))
                {
                    text += "\n" + completeStatus;
                }
                else
                {
                    text += "\n" + resources.GetString("Status") + " " + completeStatus;
                }
            }

            toolTip.SetToolTip(this, text);
        }
Пример #2
0
        /// <summary>
        /// Add an iFolder to the listview.
        /// </summary>
        /// <param name="ifolderObject">The iFolder object to add to the listview.</param>
        /// <returns>A TileListViewItem object which represents the iFolder.</returns>
        public TileListViewItem AddiFolderToListView(iFolderObject ifolderObject)
        {
            TileListViewItem tlvi = null;

            tlvi = new TileListViewItem(ifolderObject);
            tlvi = tileListView1.Items.Add(tlvi);
            tileListView1.Items.Sort();
            return(tlvi);
        }
Пример #3
0
 public TileListViewItem( iFolderObject ifolderObject )
     : this()
 {
     Tag = ifolderObject;
        ItemName = ifolderObject.iFolderWeb.Name;
        if ( ifolderObject.iFolderWeb.IsSubscription )
        {
         ItemLocation = string.Format("{0} {1}", resources.GetString("Owner"), ifolderObject.iFolderWeb.Owner);
        }
        else
        {
     ItemLocation = ifolderObject.iFolderWeb.UnManagedPath;
     }
 }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="ifolderObject">iFolder Object</param>
        public TileListViewItem(iFolderObject ifolderObject) :
            this()
        {
            Tag      = ifolderObject;
            ItemName = ifolderObject.iFolderWeb.Name;

            if (ifolderObject.iFolderWeb.IsSubscription)
            {
                //System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TileListViewItem));
                ItemLocation = string.Format("{0} {1}", resources.GetString("Owner"), ifolderObject.iFolderWeb.Owner);
            }
            else
            {
                ItemLocation = ifolderObject.iFolderWeb.UnManagedPath;
            }
        }
Пример #5
0
 private string getItemState( iFolderObject ifolderObject, uint objectsToSync, out int imageIndex )
 {
     string status;
        imageIndex = 0;
        if (ifolderObject.iFolderWeb.HasConflicts)
        {
     imageIndex = 5;
     status = TrayApp.Properties.Resources.statusConflicts;
        }
        else
        {
     switch (ifolderObject.iFolderState)
     {
      case iFolderState.Normal:
      {
       switch (ifolderObject.iFolderWeb.State)
       {
        case "Local":
     if( ifolderObject.iFolderWeb.encryptionAlgorithm == null || ifolderObject.iFolderWeb.encryptionAlgorithm == "")
     {
      if(ifolderObject.iFolderWeb.shared == true)
       imageIndex = 8;
      else
       imageIndex = 0;
     }
     else
      imageIndex = 7;
     status = string.Format( TrayApp.Properties.Resources.statusSynced, ifolderObject.iFolderWeb.LastSyncTime );
     break;
        case "Available":
        case "WaitConnect":
        case "WaitSync":
     if ( ifolderObject.iFolderWeb.IsSubscription )
     {
      imageIndex = 2;
      status = "";
     }
     else
     {
      imageIndex = 4;
                             status = TrayApp.Properties.Resources.WaitSync;
     }
     break;
        default:
     imageIndex = 0;
     status = TrayApp.Properties.Resources.statusUnknown;
     break;
       }
       break;
      }
      case iFolderState.Initial:
       imageIndex = 4;
       status = "Initial "+ifolderObject.iFolderWeb.State;
       break;
      case iFolderState.Disconnected:
                 {
                     imageIndex = 6;
                     status = TrayApp.Properties.Resources.disconnected;
                 }
     break;
      case iFolderState.FailedSync:
       imageIndex = 9;
       status = objectsToSync == 0 ?
        TrayApp.Properties.Resources.statusSyncFailure :
        string.Format(TrayApp.Properties.Resources.statusSyncItemsFailed, objectsToSync);
       break;
      case iFolderState.Synchronizing:
       imageIndex = 1;
       status = objectsToSync == 0 ?
        TrayApp.Properties.Resources.statusSyncing :
        string.Format(TrayApp.Properties.Resources.statusSyncingItems, objectsToSync);
       break;
      case iFolderState.SynchronizingLocal:
       imageIndex = 1;
       status = TrayApp.Properties.Resources.preSync;
       break;
             case iFolderState.NoPassphrase:
                 imageIndex = 9;
                 status = TrayApp.Properties.Resources.noPassphrase;
                 break;
      default:
       imageIndex = 0;
       status = TrayApp.Properties.Resources.statusUnknown;
       break;
     }
        }
        return status;
 }
Пример #6
0
 private void DownloadOrMerge( bool mergeFolder)
 {
     bool added;
        bool result;
        if ( selectedItem != null )
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     iFolderObject ifobj =
             new iFolderObject(((iFolderObject)selectedItem.Tag).iFolderWeb, iFolderState.Disconnected);
         result = AcceptiFolder(ifolder, out added, mergeFolder);
     if ( result && added )
     {
      ifobj.iFolderWeb.IsSubscription = false;
      lock (ht)
      {
       removeTileListViewItem( selectedItem );
                 iFolderObject ifolderobj = new iFolderObject(ifolder, iFolderState.Initial);
                 addiFolderToListView(ifolderobj);
                 if( acceptedFolders.Contains(ifobj.iFolderWeb.ID) )
        acceptedFolders.Remove(ifobj.iFolderWeb.ID);
       ifobj.iFolderWeb.UnManagedPath = DownloadPath;
       TileListViewItem tlvi = new TileListViewItem(ifobj);
       acceptedFolders.Add(ifobj.iFolderWeb.ID, tlvi);
                 ifolderobj = null;
                 tlvi = null;
      }
     }
     else if( result && !added )
     {
      syncLog.AddMessageToLog(DateTime.Now,
                 string.Format("Download of iFolder \"{0}\" failed",ifobj.iFolderWeb.Name));
     }
        }
 }
Пример #7
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);
      }
     }
        }
 }
Пример #8
0
 private void addiFolderToListView(iFolderObject ifolderObject)
 {
     iFolderWeb ifolder = ifolderObject.iFolderWeb;
        if ( !ifolder.IsSubscription )
        {
     lock (ht)
     {
      if (ht[ifolder.ID] == null)
      {
       TileListViewItem tlvi = new TileListViewItem( ifolderObject );
       int imageIndex;
       tlvi.Status = getItemState( ifolderObject, 0, out imageIndex );
       tlvi.ImageIndex = imageIndex;
       iFolderView.Items.Add(tlvi);
       iFolderView.Items.Sort();
       ht.Add(ifolder.ID, tlvi);
      }
     }
     Win32Window.ShChangeNotify(Win32Window.SHCNE_UPDATEITEM,
             Win32Window.SHCNF_PATHW,
             ifolder.UnManagedPath,
             IntPtr.Zero);
        }
        else
        {
     lock( ht )
     {
      if (ht[ifolder.ID] == null)
      {
       TileListViewItem tlvi = addiFolderToAvailableListView( ifolderObject );
       ht.Add( ifolder.ID, tlvi );
      }
     }
        }
     if (!thumbnailView)
     {
         showiFolderinListView();
     }
        updateView();
 }
Пример #9
0
 private void updateMenus(iFolderObject ifolderObject)
 {
     if ( ifolderObject == null )
        {
     iFolderActions.Visible = false;
         this.menuActionOpen.Enabled = this.menuActionAccept.Enabled = this.menuActionMerge.Enabled = this.menuActionProperties.Enabled =
      this.menuActionRemove.Enabled = this.menuActionResolve.Enabled = this.menuActionRevert.Enabled =
      this.menuActionShare.Enabled = this.menuActionSync.Enabled = false;
        }
        else
        {
     iFolderWeb ifolderWeb = ifolderObject.iFolderWeb;
     iFolderActions.Visible = true;
     if ( ifolderWeb.IsSubscription )
     {
      this.menuActionOpen.Enabled = this.menuActionProperties.Enabled =
       this.menuActionRevert.Enabled = this.menuActionShare.Enabled =
       this.menuActionSync.Enabled = this.menuActionResolve.Enabled = false;
      this.open.Visible = this.syncNow.Visible = this.share.Visible =
       this.revert.Visible = this.properties.Visible = this.resolve.Visible = false;
             this.menuActionRemove.Enabled = this.menuActionAccept.Enabled = this.menuActionMerge.Enabled = true;
      if( ifolderWeb.CurrentUserID != ifolderWeb.OwnerID)
      {
       this.menuRemove.Text = this.remove.Text = this.menuActionRemove.Text = this.resourceManager.GetString("RemoveMyMembership");
      }
      else
      {
       this.menuRemove.Text = this.remove.Text = this.menuActionRemove.Text = this.resourceManager.GetString("menuActionRemove.Text");
      }
             this.accept.Visible = this.merge.Visible = this.remove.Visible = true;
     }
     else
     {
             this.menuActionRemove.Enabled = this.menuActionAccept.Enabled = this.menuActionMerge.Enabled = false;
             this.accept.Visible = this.merge.Visible = this.remove.Visible = false;
      this.menuActionOpen.Enabled = this.menuActionProperties.Enabled =
       this.menuActionRevert.Enabled = this.menuActionShare.Enabled =
       this.menuActionSync.Enabled = true;
      int buttonDelta = resolve.Top - open.Top;
      if ( ifolderWeb.HasConflicts )
      {
       this.menuActionResolve.Enabled = this.resolve.Visible = true;
       syncNow.Top = resolve.Top + buttonDelta;
       share.Top = syncNow.Top + buttonDelta;
       revert.Top = share.Top + buttonDelta;
       properties.Top = revert.Top + buttonDelta;
      }
      else
      {
       this.menuActionResolve.Enabled = this.resolve.Visible = false;
       syncNow.Top = resolve.Top;
       share.Top = syncNow.Top + buttonDelta;
       revert.Top = share.Top + buttonDelta;
       properties.Top = revert.Top + buttonDelta;
      }
      if( ifolderObject.iFolderState == iFolderState.Initial )
      {
       this.open.Visible = this.share.Visible = this.revert.Visible = this.properties.Visible = false;
       this.menuOpen.Enabled = this.menuShare.Enabled = false;
       this.menuRevert.Enabled = this.menuProperties.Enabled = false;
       this.menuActionOpen.Enabled = this.menuActionShare.Enabled = false;
       this.menuActionRevert.Enabled = this.menuActionProperties.Enabled = false;
       return;
      }
      this.open.Visible = this.syncNow.Visible = this.share.Visible =
      this.revert.Visible = this.properties.Visible = true;
      this.menuOpen.Enabled = this.menuShare.Enabled = true;
      this.menuRevert.Enabled = this.menuProperties.Enabled = true;
     }
        }
 }
Пример #10
0
 public void refreshiFolders(string search)
 {
     if (search == null) search = "";
     search = this.toolStripBtnFilter.Text;
        Cursor.Current = Cursors.WaitCursor;
        Hashtable oldHt = new Hashtable();
     Hashtable tempHt = new Hashtable();
        lock(ht)
        {
     foreach ( TileListViewItem tlvi in ht.Values )
     {
      iFolderObject ifolderObject = (iFolderObject)tlvi.Tag;
      tempHt.Add( ifolderObject.ID, ifolderObject.iFolderState );
     }
        }
        try
        {
     panel2.SuspendLayout();
         if (selectedItem != null)
             updateMenus((iFolderObject)selectedItem.Tag);
         else
             updateMenus(null);
     foreach (iFolderWeb ifolder in ifolderArray)
     {
      if( search != null && ((String)ifolder.Name).ToLower().IndexOf(search.ToLower(),
                 0, ((String)ifolder.Name).Length) < 0)
       continue;
      iFolderState state = iFolderState.Normal;
        if (tempHt.Contains(ifolder.ID))
              {
                 state = (iFolderState)tempHt[ifolder.ID];
              }
             else
              {
                 iFolderObject ifobj = new iFolderObject(ifolder, state);
                 addiFolderToListView(ifobj);
                 ifobj = null;
               }
               oldHt.Add(ifolder.ID, state);
               if (this.acceptedFolders.Contains(ifolder.ID))
               {
                   this.acceptedFolders.Remove(ifolder.ID);
               }
         }
     foreach( System.Object obj in this.acceptedFolders.Values)
     {
      TileListViewItem tlv = (TileListViewItem)obj;
      iFolderObject ifobj = (iFolderObject)tlv.Tag;
      if( search != null && ((String)ifobj.iFolderWeb.Name).ToLower().IndexOf(search.ToLower(),
                 0, ((String)ifobj.iFolderWeb.Name).Length) < 0)
       continue;
      ifobj.iFolderWeb.IsSubscription = false;
      ifobj.iFolderState = iFolderState.Initial;
      addiFolderToListView( ifobj );
             oldHt.Add(ifobj.ID, ifobj.iFolderState);
     }
         string[] ifolders = new string[ht.Count];
         ht.Keys.CopyTo(ifolders, 0);
         foreach (string ifolderid in ifolders)
         {
            if (oldHt.ContainsKey(ifolderid) == false)
             {
                 removeTileListViewItem((TileListViewItem)ht[ifolderid]);
             }
         }
        }
        catch (Exception ex)
        {
     Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(TrayApp.Properties.Resources.iFolderError,
             TrayApp.Properties.Resources.iFolderErrorTitle,
             ex.Message, MyMessageBoxButtons.OK,
             MyMessageBoxIcon.Information);
     mmb.ShowDialog();
     mmb.Dispose();
        }
        iFolderView.Items.Sort();
        foreach (iFoldersListView ifListView in iFolderListViews.Values)
        {
     ifListView.FinalizeUpdate();
        }
        updateView();
        panel2.ResumeLayout();
     DomainsListUpdate();
     DomainsListUpdateComboBox();
        inRefresh = false;
     oldHt = null;
        Cursor.Current = Cursors.Default;
     if (!thumbnailView)
     {
         showiFolderinListView();
     }
        this.refreshTimer.Start();
 }
Пример #11
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;
 }
Пример #12
0
 private void menuRevert_Click(object sender, System.EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
        try
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     bool IsMaster = (ifolder.CurrentUserID == ifolder.OwnerID);
     RevertiFolder revertiFolder = new RevertiFolder();
     if( !IsMaster )
      revertiFolder.removeFromServer.Text = TrayApp.Properties.Resources.AlsoRemoveMembership;
     if ( revertiFolder.ShowDialog() == DialogResult.Yes )
     {
      Invalidate();
      Update();
      Cursor.Current = Cursors.WaitCursor;
      iFolderWeb newiFolder = ifWebService.RevertiFolder(ifolder.ID);
      Win32Window.ShChangeNotify(Win32Window.SHCNE_UPDATEITEM, Win32Window.SHCNF_PATHW, ifolder.UnManagedPath, IntPtr.Zero);
      if (newiFolder != null)
      {
       acceptedFolders.Remove(newiFolder.ID);
       if ( revertiFolder.RemoveFromServer )
       {
        if( IsMaster )
        {
     string defaultiFolderID = this.simiasWebService.GetDefaultiFolder( newiFolder.DomainID );
     if( defaultiFolderID == newiFolder.ID)
     {
      this.simiasWebService.DefaultAccount( newiFolder.DomainID, null );
     }
     ifWebService.DeleteiFolder(newiFolder.DomainID, newiFolder.ID);
        }
        ifWebService.DeclineiFolderInvitation( newiFolder.DomainID, newiFolder.ID );
       }
       else
       {
        {
                         this.removeTileListViewItem((TileListViewItem)ht[newiFolder.ID]);
                         iFolderObject ifolderobj = new iFolderObject(newiFolder, iFolderState.Normal);
                         addiFolderToListView(ifolderobj);
        }
       }
      }
      lock (ht)
      {
       removeTileListViewItem( selectedItem );
      }
     }
         refreshAll();
     updateView();
     revertiFolder.Dispose();
        }
        catch (Exception ex)
        {
     Cursor.Current = Cursors.Default;
     Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(TrayApp.Properties.Resources.iFolderRevertError, TrayApp.Properties.Resources.revertErrorTitle, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mmb.ShowDialog();
     mmb.Dispose();
        }
        Cursor.Current = Cursors.Default;
 }
Пример #13
0
 public TileListViewItem AddiFolderToListView( iFolderObject ifolderObject )
 {
     TileListViewItem tlvi = null;
        tlvi = new TileListViewItem( ifolderObject );
        tlvi = tileListView1.Items.Add( tlvi );
        tileListView1.Items.Sort();
        return tlvi;
 }
Пример #14
0
 private void addiFolderToListView(iFolderObject ifolderObject)
 {
     iFolderWeb ifolder = ifolderObject.iFolderWeb;
        lock (ht)
        {
     if (ht[ifolder.ID] == null)
     {
      string[] items = new string[3];
      int imageIndex;
      items[0] = ifolder.Name;
      items[1] = ifolder.IsSubscription ? ifolder.Owner : ifolder.UnManagedPath;
      items[2] = stateToString(ifolderObject, out imageIndex);
      ListViewItem lvi = new ListViewItem(items, imageIndex);
      lvi.Tag = ifolderObject;
      iFolderView.Items.Add(lvi);
      ht.Add(ifolder.ID, lvi);
     }
        }
 }
Пример #15
0
 private string stateToString(iFolderObject ifolderObject, out int imageIndex)
 {
     string status;
        imageIndex = 0;
        if (ifolderObject.iFolderWeb.HasConflicts)
        {
     imageIndex = 2;
     status = resourceManager.GetString("statusConflicts");
        }
        else
        {
     switch (ifolderObject.iFolderState)
     {
      case iFolderState.Normal:
      {
       switch (ifolderObject.iFolderWeb.State)
       {
        case "Local":
     status = resourceManager.GetString("statusOK");
     break;
        case "Available":
        case "WaitConnect":
        case "WaitSync":
     imageIndex = ifolderObject.iFolderWeb.IsSubscription ? 1 : 0;
     status = resourceManager.GetString(ifolderObject.iFolderWeb.State);
     break;
        default:
     imageIndex = 1;
     status = resourceManager.GetString("statusUnknown");
     break;
       }
       break;
      }
      case iFolderState.Disconnected:
       status = resourceManager.GetString("disconnected");
       break;
      case iFolderState.FailedSync:
       status = objectsToSync == 0 ?
        status = resourceManager.GetString("statusSyncFailure") :
        string.Format(resourceManager.GetString("statusSyncItemsFailed"), objectsToSync);
       break;
      case iFolderState.Synchronizing:
       status = string.Format(resourceManager.GetString("statusSyncingItems"), objectsToSync);
       break;
      case iFolderState.SynchronizingLocal:
       status = resourceManager.GetString("preSync");
       break;
      default:
       status = resourceManager.GetString("statusUnknown");
       break;
     }
        }
        return status;
 }
Пример #16
0
 private void menuRevert_Click(object sender, System.EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
        try
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     bool IsMaster = (ifolder.CurrentUserID == ifolder.OwnerID);
         IsDomainMaster = IsMaster;
     RevertiFolder revertiFolder = new RevertiFolder();
     if( !IsMaster )
      revertiFolder.removeFromServer.Text = TrayApp.Properties.Resources.AlsoRemoveMembership;
         revertiFolder.removeFromServer.Enabled = simiasWebService.GetDomainInformation(ifolder.DomainID).Authenticated;
         if ( revertiFolder.ShowDialog() == DialogResult.Yes )
     {
      Invalidate();
      Update();
      Cursor.Current = Cursors.WaitCursor;
             if (revertiFolder.RemoveFromServer)
                  ((iFolderObject)selectedItem.Tag).iFolderState = iFolderState.RevertAndDelete;
      iFolderWeb newiFolder = ifWebService.RevertiFolder(ifolder.ID);
      Win32Window.ShChangeNotify(Win32Window.SHCNE_UPDATEITEM, Win32Window.SHCNF_PATHW, ifolder.UnManagedPath, IntPtr.Zero);
      if (newiFolder != null)
      {
       acceptedFolders.Remove(newiFolder.ID);
       if ( revertiFolder.RemoveFromServer )
       {
                     selectediFolderID = newiFolder.ID;
                     selectedDomainID = newiFolder.DomainID;
            Thread revertiFolderThread;
            revertiFolderThread = new Thread(new ThreadStart(RemoveiFolderFromServer));
            revertiFolderThread.Name = "RevertAndDeleteiFolder";
            revertiFolderThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
            revertiFolderThread.IsBackground = true;
            revertiFolderThread.Priority = ThreadPriority.BelowNormal;
                     revertiFolderThread.Start();
       }
       else
       {
        {
                         this.removeTileListViewItem((TileListViewItem)ht[newiFolder.ID]);
                         iFolderObject ifolderobj = new iFolderObject(newiFolder, iFolderState.Normal);
                         addiFolderToListView(ifolderobj);
                         updateView();
        }
       }
      }
     }
     revertiFolder.Dispose();
        }
        catch (Exception ex)
        {
     Cursor.Current = Cursors.Default;
     Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(TrayApp.Properties.Resources.iFolderRevertError,
                 TrayApp.Properties.Resources.revertErrorTitle,
                 ex.Message,
                 MyMessageBoxButtons.OK,
                 MyMessageBoxIcon.Error);
     mmb.ShowDialog();
     mmb.Dispose();
        }
        Cursor.Current = Cursors.Default;
 }
Пример #17
0
 private void updateMenus(iFolderObject ifolderObject)
 {
     if ( ifolderObject == null )
        {
         initialButtonState();
         populateAllInfoWithNA();
        }
        else
        {
     iFolderWeb ifolderWeb = ifolderObject.iFolderWeb;
     if ( ifolderWeb.IsSubscription )
     {
             populateServeriFolderInfo(ifolderWeb);
      this.menuActionOpen.Enabled =
             this.menuActionProperties.Enabled =
      this.menuActionRevert.Enabled =
             this.menuActionShare.Enabled =
      this.menuActionSync.Enabled =
             this.menuActionResolve.Enabled = false;
             this.menuActionRemove.Enabled =
             this.menuActionAccept.Enabled =
             this.menuActionMerge.Enabled = true;
      if( ifolderWeb.CurrentUserID != ifolderWeb.OwnerID)
      {
                 this.MenuRemove.Text = TrayApp.Properties.Resources.RemoveMyMembership;
                 this.menuActionRemove.Text = Resources.RemoveMyMembershipText;
                 toolStripBtnDelete.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\remove_share_48.png"));
                 toolStripBtnDelete.Text = Resources.remove;
                 toolStripBtnDelete.ToolTipText = Resources.RemoveMyMembership;
             }
      else
      {
                 this.MenuRemove.Text = TrayApp.Properties.Resources.menuActionRemove;
                 this.menuActionRemove.Text = TrayApp.Properties.Resources.menuRemoveText;
                 toolStripBtnDelete.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\delete_48.png"));
                 toolStripBtnDelete.Text = Resources.delete;
                 toolStripBtnDelete.ToolTipText = Resources.menuActionRemove;
      }
             enableRemoteFoldersButtons(true);
     }
     else
     {
             populateLocaliFolderInfo(ifolderWeb);
             this.menuActionRemove.Enabled = this.menuActionAccept.Enabled = this.menuActionMerge.Enabled = false;
      this.menuActionOpen.Enabled = this.menuActionProperties.Enabled =
       this.menuActionRevert.Enabled = this.menuActionShare.Enabled =
       this.menuActionSync.Enabled = true;
            this.menuActionResolve.Enabled = this.toolStripBtnResolve.Enabled = this.toolStripBtnResolve.Visible = ifolderWeb.HasConflicts;
      if( ifolderObject.iFolderState == iFolderState.Initial )
      {
                 this.toolStripBtnShare.Enabled = false;
       this.CtxMenuOpen.Enabled = this.menuShare.Enabled = false;
       this.MenuRevert.Enabled = this.menuProperties.Enabled = false;
       this.menuActionOpen.Enabled = this.menuActionShare.Enabled = false;
       this.menuActionRevert.Enabled = this.menuActionProperties.Enabled = false;
       return;
      }
             enableRemoteFoldersButtons(false);
      this.CtxMenuOpen.Enabled = this.menuShare.Enabled = true;
      this.MenuRevert.Enabled = this.menuProperties.Enabled = true;
             if ((ifolderWeb.State == "Local" || ifolderWeb.State == "WaitSync") && ((ifolderObject.iFolderState == iFolderState.SynchronizingLocal) || (ifolderObject.iFolderState == iFolderState.Synchronizing)))
             {
                 this.toolStripBtnRevert.Enabled = this.menuActionRevert.Enabled = this.MenuRevert.Enabled = false;
             }
             else
             {
                 this.toolStripBtnRevert.Enabled = this.menuActionRevert.Enabled = this.MenuRevert.Enabled = true;
             }
     }
        }
 }
Пример #18
0
 private void updateMenus(iFolderObject ifolderObject)
 {
     if ( ifolderObject == null )
        {
         initialButtonState();
         populateAllInfoWithNA();
        }
        else
        {
     iFolderWeb ifolderWeb = ifolderObject.iFolderWeb;
     if ( ifolderWeb.IsSubscription )
     {
             populateServeriFolderInfo(ifolderWeb);
      this.menuActionOpen.Enabled =
             this.menuActionProperties.Enabled =
      this.menuActionRevert.Enabled =
             this.menuActionShare.Enabled =
      this.menuActionSync.Enabled =
             this.menuActionResolve.Enabled = false;
             this.menuActionRemove.Enabled =
             this.menuActionAccept.Enabled =
             this.menuActionMerge.Enabled = true;
      if( ifolderWeb.CurrentUserID != ifolderWeb.OwnerID)
      {
       this.MenuRemove.Text = this.menuActionRemove.Text = TrayApp.Properties.Resources.RemoveMyMembership;
      }
      else
      {
       this.MenuRemove.Text = this.menuActionRemove.Text = TrayApp.Properties.Resources.menuActionRemove;
      }
             enableRemoteFoldersButtons(true);
     }
     else
     {
             populateLocaliFolderInfo(ifolderWeb);
             this.menuActionRemove.Enabled = this.menuActionAccept.Enabled = this.menuActionMerge.Enabled = false;
      this.menuActionOpen.Enabled = this.menuActionProperties.Enabled =
       this.menuActionRevert.Enabled = this.menuActionShare.Enabled =
       this.menuActionSync.Enabled = true;
      if ( ifolderWeb.HasConflicts )
      {
       this.menuActionResolve.Enabled = true;
      }
      else
      {
       this.menuActionResolve.Enabled = this.toolStripBtnResolve.Enabled =
                     this.toolStripBtnResolve.Visible = false;
      }
      if( ifolderObject.iFolderState == iFolderState.Initial )
      {
                 this.toolStripBtnShare.Visible = this.toolStripBtnShare.Enabled = false;
       this.CtxMenuOpen.Enabled = this.menuShare.Enabled = false;
       this.MenuRevert.Enabled = this.menuProperties.Enabled = false;
       this.menuActionOpen.Enabled = this.menuActionShare.Enabled = false;
       this.menuActionRevert.Enabled = this.menuActionProperties.Enabled = false;
       return;
      }
             enableRemoteFoldersButtons(false);
      this.CtxMenuOpen.Enabled = this.menuShare.Enabled = true;
      this.MenuRevert.Enabled = this.menuProperties.Enabled = true;
     }
        }
 }
Пример #19
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;
 }
Пример #20
0
 private TileListViewItem addiFolderToAvailableListView( iFolderObject ifolderObject )
 {
     TileListViewItem tlvi = null;
        lock ( iFolderListViews )
        {
         iFoldersListView ifListView = null;
         ifListView = (iFoldersListView)iFolderListViews[ifolderObject.iFolderWeb.DomainID];
         if (ifListView == null)
             ifListView = AddDomainToUIList(simiasWebService.GetDomainInformation(ifolderObject.iFolderWeb.DomainID));
         tlvi = ifListView.AddiFolderToListView(ifolderObject);
         ifListView.Items.Sort();
         int imageIndex;
         tlvi.Status = getItemState(ifolderObject, 0, out imageIndex);
         tlvi.ImageIndex = imageIndex;
        }
        return tlvi;
 }
Пример #21
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;
 }
Пример #22
0
 private string getItemState( iFolderObject ifolderObject, uint objectsToSync, out int imageIndex )
 {
     string status;
        imageIndex = 0;
        if (ifolderObject.iFolderWeb.HasConflicts)
        {
     imageIndex = 5;
     status = resourceManager.GetString("statusConflicts");
        }
        else
        {
     switch (ifolderObject.iFolderState)
     {
      case iFolderState.Normal:
      {
       switch (ifolderObject.iFolderWeb.State)
       {
        case "Local":
     if( ifolderObject.iFolderWeb.encryptionAlgorithm == null || ifolderObject.iFolderWeb.encryptionAlgorithm == "")
     {
      if(ifolderObject.iFolderWeb.shared == true)
       imageIndex = 8;
      else
       imageIndex = 0;
     }
     else
      imageIndex = 7;
     status = string.Format( resourceManager.GetString("statusSynced"), ifolderObject.iFolderWeb.LastSyncTime );
     break;
        case "Available":
        case "WaitConnect":
        case "WaitSync":
     if ( ifolderObject.iFolderWeb.IsSubscription )
     {
      imageIndex = 2;
      status = "";
     }
     else
     {
      imageIndex = 4;
      status = resourceManager.GetString(ifolderObject.iFolderWeb.State);
     }
     break;
        default:
     imageIndex = 0;
     status = resourceManager.GetString("statusUnknown");
     break;
       }
       break;
      }
      case iFolderState.Initial:
       imageIndex = 4;
       status = "Initial "+ifolderObject.iFolderWeb.State;
       break;
      case iFolderState.Disconnected:
                 {
                     imageIndex = 6;
                     status = resourceManager.GetString("disconnected");
                 }
     break;
      case iFolderState.FailedSync:
       imageIndex = 9;
       status = objectsToSync == 0 ?
        resourceManager.GetString("statusSyncFailure") :
        string.Format(resourceManager.GetString("statusSyncItemsFailed"), objectsToSync);
       break;
      case iFolderState.Synchronizing:
       imageIndex = 1;
       status = objectsToSync == 0 ?
        resourceManager.GetString("statusSyncing") :
        string.Format(resourceManager.GetString("statusSyncingItems"), objectsToSync);
       break;
      case iFolderState.SynchronizingLocal:
       imageIndex = 1;
       status = resourceManager.GetString("preSync");
       break;
      default:
       imageIndex = 0;
       status = resourceManager.GetString("statusUnknown");
       break;
     }
        }
        return status;
 }