Пример #1
0
 public GlobalProperties(iFolderWebService ifolderWebService, SimiasWebService simiasWebService, IProcEventClient eventClient)
 {
     syncCollectionDelegate = new SyncCollectionDelegate(syncCollection);
     syncFileDelegate = new SyncFileDelegate(syncFile);
     createChangeEventDelegate = new CreateChangeEventDelegate(createChangeEvent);
     deleteEventDelegate = new DeleteEventDelegate(deleteEvent);
     addDomainToListDelegate = new AddDomainToListDelegate(AddDomainToList);
     refreshiFoldersDelegate = new RefreshiFoldersDelegate(refreshiFoldersInvoke);
     InitializeComponent();
     MoreInitialization();
     PluginEnhancedMenu();
     infoMessage = new NoiFolderMessage();
     panel2.Controls.Add(infoMessage);
     progressBar1.Visible = false;
     ifWebService = ifolderWebService;
     this.simiasWebService = simiasWebService;
     this.eventClient = eventClient;
     eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(global_collectionSyncHandler));
     eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(global_fileSyncHandler));
     updateEnterpriseTimer = new System.Timers.Timer(1000);
     updateEnterpriseTimer.AutoReset = false;
     updateEnterpriseTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateEnterpriseTimer_Elapsed);
     ht = new Hashtable();
     progressBar1.Minimum = 0;
     this.StartPosition = FormStartPosition.CenterScreen;
     try
     {
         this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico"));
         largeImageList = new ImageList();
         largeImageList.ImageSize = new Size(48, 48);
         largeImageList.ColorDepth = ColorDepth.Depth32Bit;
         largeImageList.TransparentColor = Color.Black;
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-sync48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-download48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-upload48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-waiting48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-conflict48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-error48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\encrypt_ilock_48.gif")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder_user_48.png")));
         largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-warning48.png")));
         iFolderView.LargeImageList = largeImageList;
     }
     catch { }
 }
Пример #2
0
 public FormsTrayApp()
 {
     syncCollectionDelegate = new SyncCollectionDelegate(syncCollection);
        syncFileDelegate = new SyncFileDelegate(syncFile);
        createChangeEventDelegate = new CreateChangeEventDelegate(createChangeEvent);
        notifyMessageDelegate = new NotifyMessageDelegate(notifyMessage);
     appRestart = Novell.Win32Util.Win32Window.RegisterWindowMsg("AppCreated");
     RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Novell\iFolder");
     string language = regKey.GetValue("language") as String;
     if (language != null)
     {
         try
         {
             Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);
         }
         catch { }
     }
        string windowName = FormsTrayApp.resourceManager.GetString("iFolderServices") + Environment.UserName;
        Novell.Win32Util.Win32Window window = Novell.Win32Util.Win32Window.FindWindow(null, windowName);
        if (window != null)
        {
         Novell.Win32Util.Win32Window iFolderWindow = Novell.Win32Util.Win32Window.FindWindow(null, resourceManager.GetString("myiFolders"));
         if (iFolderWindow != null)
         {
             iFolderWindow.SendMsg(HWND_BOARDCAST, appRestart, IntPtr.Zero, IntPtr.Zero);
         }
     shutdown = true;
        }
        else
        {
     iFolderLogPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "iFolder");
     if (!Directory.Exists(iFolderLogPath))
     {
      Directory.CreateDirectory(iFolderLogPath);
     }
     this.simiasManager = new Manager( Environment.GetCommandLineArgs() );
     InitializeComponent();
     this.Text = FormsTrayApp.resourceManager.GetString("iFolderServices") + Environment.UserName;
     this.components = new System.ComponentModel.Container();
     this.ClientSize = new System.Drawing.Size(292, 266);
     try
     {
      string basePath = Path.Combine(Application.StartupPath, "res");
      startupIcon = new Icon(Path.Combine(basePath, "ifolder_waiting_16.ico"));
      shutdownIcon = new Icon(Path.Combine(basePath, "ifolder_download_16.ico"));
      trayIcon = new Icon(Path.Combine(basePath, "ifolder_16.ico"));
      syncIcons[0] = new Icon(trayIcon, trayIcon.Size);
      for (int i = 0; i < numberOfSyncIcons; i++)
      {
       string syncIcon = string.Format(Path.Combine(basePath, "ifolder_sync{0}.ico"), i+1);
       syncIcons[i] = new Icon(syncIcon);
      }
      this.ShowInTaskbar = false;
      this.WindowState = FormWindowState.Minimized;
      Win32Window win32Window = new Win32Window();
      win32Window.Handle = this.Handle;
      win32Window.MakeToolWindow();
      shellNotifyIcon = new ShellNotifyIcon(this.Handle);
      shellNotifyIcon.Text = resourceManager.GetString("iFolderServicesStarting");
      shellNotifyIcon.Icon = startupIcon;
      if( !iFolderComponent.DisplayTrayIconEnabled )
                   shellNotifyIcon.Visible = false;
      shellNotifyIcon.ContextMenu = contextMenu1;
      shellNotifyIcon.Click += new Novell.CustomUIControls.ShellNotifyIcon.ClickDelegate(shellNotifyIcon_Click);
      shellNotifyIcon.BalloonClick += new Novell.CustomUIControls.ShellNotifyIcon.BalloonClickDelegate(shellNotifyIcon_BalloonClick);
      shellNotifyIcon.ContextMenuPopup += new Novell.CustomUIControls.ShellNotifyIcon.ContextMenuPopupDelegate(shellNotifyIcon_ContextMenuPopup);
         }
     catch
     {
     }
     }
        this.Closing += new System.ComponentModel.CancelEventHandler(this.FormsTrayApp_Closing);
        this.Load += new System.EventHandler(FormsTrayApp_Load);
 }
Пример #3
0
 public GlobalProperties(iFolderWebService ifolderWebService, SimiasWebService simiasWebService, IProcEventClient eventClient)
 {
     syncCollectionDelegate = new SyncCollectionDelegate(syncCollection);
        syncFileDelegate = new SyncFileDelegate(syncFile);
        createChangeEventDelegate = new CreateChangeEventDelegate(createChangeEvent);
        deleteEventDelegate = new DeleteEventDelegate(deleteEvent);
        InitializeComponent();
        progressBar1.Visible = false;
        ifWebService = ifolderWebService;
        this.simiasWebService = simiasWebService;
        this.eventClient = eventClient;
        eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(global_collectionSyncHandler));
        eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(global_fileSyncHandler));
        updateEnterpriseTimer = new System.Timers.Timer(1000);
        updateEnterpriseTimer.AutoReset = false;
        updateEnterpriseTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateEnterpriseTimer_Elapsed);
        ht = new Hashtable();
        progressBar1.Minimum = 0;
        this.StartPosition = FormStartPosition.CenterScreen;
        try
        {
     this.Icon = new Icon(Path.Combine(Application.StartupPath, @"ifolder_app.ico"));
     this.iFolderView.SmallImageList = new ImageList();
     iFolderView.SmallImageList.Images.Add(new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_loaded.ico")));
     iFolderView.SmallImageList.Images.Add(new Icon(Path.Combine(Application.StartupPath, @"res\serverifolder.ico")));
     iFolderView.SmallImageList.Images.Add(new Icon(Path.Combine(Application.StartupPath, @"res\ifolderconflict.ico")));
     toolBar1.ImageList = new ImageList();
     toolBar1.ImageList.ImageSize = new Size(24, 24);
     toolBar1.ImageList.TransparentColor = Color.White;
     toolBar1.ImageList.Images.AddStrip(Image.FromFile(Path.Combine(Application.StartupPath, @"res\mtoolbar_nor.bmp")));
     toolBar1.DisabledImageList = new ImageList();
     toolBar1.DisabledImageList.ImageSize = new Size(24, 24);
     toolBar1.DisabledImageList.TransparentColor = Color.White;
     toolBar1.DisabledImageList.Images.AddStrip(Image.FromFile(Path.Combine(Application.StartupPath, @"res\mtoolbar_dis.bmp")));
     toolBar1.HotImageList = new ImageList();
     toolBar1.HotImageList.ImageSize = new Size(24, 24);
     toolBar1.HotImageList.TransparentColor = Color.White;
     toolBar1.HotImageList.Images.AddStrip(Image.FromFile(Path.Combine(Application.StartupPath, @"res\mtoolbar_hot.bmp")));
     toolBarCreate.ImageIndex = 0;
     toolBarSetup.ImageIndex = 1;
     toolBarShare.ImageIndex = 2;
     toolBarResolve.ImageIndex = 3;
     toolBarSync.ImageIndex = 4;
        }
        catch {}
        this.MinimumSize = this.Size;
 }