Esempio n. 1
0
 private void FormsTrayApp_Load(object sender, System.EventArgs e)
 {
     if (shutdown)
        {
     this.Close();
        }
        else
        {
         try
         {
             if (!Preferences.HideiFolderInTray)
             {
                 ShowStartupScreen();
             }
             Environment.CurrentDirectory = Application.StartupPath;
             for (int i = 0; i < 3; i++)
             {
                 Process[] processArray = Process.GetProcessesByName("simias");
                 foreach (Process proc in processArray)
                 {
                     if (proc != null)
                     {
                         simiasManager.Stop();
                     }
                 }
             }
             ifWebService = null;
             simiasWebService = null;
             eventQueue = new Queue();
             workEvent = new AutoResetEvent(false);
             eventClient = new IProcEventClient(new IProcEventError(errorHandler), null);
             preferences = new Preferences(ifWebService, simiasWebService, simiasManager);
             preferences.EnterpriseConnect += new Novell.FormsTrayApp.Preferences.EnterpriseConnectDelegate(preferences_EnterpriseConnect);
             preferences.ChangeDefaultDomain += new Novell.FormsTrayApp.Preferences.ChangeDefaultDomainDelegate(preferences_EnterpriseConnect);
             preferences.RemoveDomain += new Novell.FormsTrayApp.Preferences.RemoveDomainDelegate(preferences_RemoveDomain);
             preferences.ShutdownTrayApp += new Novell.FormsTrayApp.Preferences.ShutdownTrayAppDelegate(preferences_ShutdownTrayApp);
             preferences.UpdateDomain += new Novell.FormsTrayApp.Preferences.UpdateDomainDelegate(preferences_UpdateDomain);
             preferences.DisplayiFolderDialog += new Novell.FormsTrayApp.Preferences.DisplayiFolderDialogDelegate(preferences_DisplayiFolderDialog);
             preferences.CreateControl();
             IntPtr handle = preferences.Handle;
             syncLog = new SyncLog();
             syncLog.CreateControl();
             handle = syncLog.Handle;
             infolog = new SyncLog();
             infolog.Customize();
             globalProperties = new GlobalProperties(ifWebService, simiasWebService, eventClient);
             globalProperties.RemoveDomain += new Novell.FormsTrayApp.GlobalProperties.RemoveDomainDelegate(globalProperties_RemoveDomain);
             globalProperties.PreferenceDialog = preferences;
             globalProperties.SyncLogDialog = syncLog;
             globalProperties.CreateControl();
             handle = globalProperties.Handle;
             if (RegularStart)
             {
                 DelayedStart();
             }
             else
             {
                 try
                 {
                     LogInit();
                 }
                 catch { }
                 shellNotifyIcon.Text = resourceManager.GetString("iFolderServices");
                 shellNotifyIcon.Icon = trayIcon;
                 SimiasTimer = new System.Windows.Forms.Timer();
                 SimiasTimer.Interval = 120000;
                 SimiasTimer.Tick += new EventHandler(SimiasTimer_Tick);
                 SimiasTimer.Start();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(string.Format("Exception: {0}--{1}", ex.Message, ex.StackTrace));
             ShutdownTrayApp(ex);
         }
         finally
         {
             CloseStartupScreen();
         }
        }
 }
Esempio n. 2
0
 public AccountWizard( iFolderWebService ifWebService, SimiasWebService simiasWebService, Manager simiasManager, bool firstAccount, Preferences prefs )
 {
     this.simiasManager = simiasManager;
        this.simiasWebService = simiasWebService;
        this.ifWebService = ifWebService;
        this.prefs = prefs;
        InitializeComponent();
        this.welcomePage = new WelcomePage();
        this.serverPage = new ServerPage( firstAccount );
        this.identityPage = new IdentityPage();
        this.verifyPage = new VerifyPage( firstAccount );
        this.completionPage = new CompletionPage();
        this.defaultiFolderPage = new DefaultiFolderPage(this.ifWebService, this.simiasWebService, this.domainInfo);
        this.welcomePage.DescriptionText = Resource.GetString("WelcomePageDescription");
        this.welcomePage.ActionText = Resource.GetString("WelcomePageAction");
        this.welcomePage.Location = new System.Drawing.Point(0, 0);
        this.welcomePage.Name = Resource.GetString("WelcomePageName");
        this.welcomePage.Size = new System.Drawing.Size(496, 304);
        this.welcomePage.TabIndex = 1;
        this.welcomePage.WelcomeTitle = Resource.GetString("WelcomePageTitle");
        this.serverPage.HeaderTitle = Resource.GetString("ServerPageHeaderTitle");
        this.serverPage.Location = new System.Drawing.Point(0, 0);
        this.serverPage.Name = Resource.GetString("ServerPageName");
        this.serverPage.Size = new System.Drawing.Size(496, 304);
        this.serverPage.TabIndex = 1;
        this.identityPage.HeaderTitle = Resource.GetString("IdentityPageHeaderTitle");
        this.identityPage.Location = new System.Drawing.Point(0, 0);
        this.identityPage.Name = Resource.GetString("IdentityPageName");
        this.identityPage.Size = new System.Drawing.Size(496, 304);
        this.identityPage.TabIndex = 1;
        this.verifyPage.HeaderTitle = Resource.GetString("VerifyPageHeaderTitle");
        this.verifyPage.Location = new System.Drawing.Point(0, 0);
        this.verifyPage.Name = Resource.GetString("VerifyPageName");
        this.verifyPage.Size = new System.Drawing.Size(496, 304);
        this.verifyPage.TabIndex = 1;
        this.defaultiFolderPage.Name = "defaultiFolderPage";
        this.defaultiFolderPage.Location = new System.Drawing.Point(0, 0);
        this.defaultiFolderPage.Size = new System.Drawing.Size(496, 304);
        this.defaultiFolderPage.HeaderTitle = Resource.GetString("DefaultiFolder");
        this.completionPage.DescriptionText = Resource.GetString("CompletionPageDT");
        this.completionPage.Location = new System.Drawing.Point(0, 0);
        this.completionPage.Name = "completionPage";
        this.completionPage.Size = new System.Drawing.Size(496, 304);
        this.completionPage.TabIndex = 1;
        this.completionPage.WelcomeTitle = Resource.GetString("CompletionPageWT");
        this.Controls.Add(this.welcomePage);
        this.Controls.Add(this.serverPage);
        this.Controls.Add(this.identityPage);
        this.Controls.Add(this.verifyPage);
        this.Controls.Add(this.defaultiFolderPage);
        this.Controls.Add(this.completionPage);
        try
        {
     this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico"));
        }
        catch {}
        pages = new BaseWizardPage[maxPages];
        pages[0] = this.welcomePage;
        pages[1] = this.serverPage;
        pages[2] = this.identityPage;
        pages[3] = this.verifyPage;
        pages[4] = this.defaultiFolderPage;
        pages[5] = this.completionPage;
        try
        {
     Image image = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder_account_wiz.png"));
     this.welcomePage.Watermark = image;
     this.completionPage.Watermark = image;
     image = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-add-account48.png"));
     this.serverPage.Thumbnail = image;
     this.verifyPage.Thumbnail = image;
     this.identityPage.Thumbnail = image;
     this.defaultiFolderPage.Thumbnail = image;
        }
        catch {}
        foreach (BaseWizardPage page in pages)
        {
     page.Hide();
        }
        pages[0].ActivatePage(0);
 }
Esempio n. 3
0
 public AccountWizard(iFolderWebService ifWebService, SimiasWebService simiasWebService, Manager simiasManager, bool firstAccount, Preferences prefs, string ip)
     : this(ifWebService, simiasWebService, simiasManager, firstAccount, prefs)
 {
     this.serverPage.ServerAddress = ip;
     this.serverPage.DisableServerEntry();
 }
Esempio n. 4
0
 public AccountWizard(iFolderWebService ifWebService, SimiasWebService simiasWebService, Manager simiasManager, bool firstAccount, Preferences prefs, GlobalProperties gProps)
     : this(ifWebService, simiasWebService, simiasManager, firstAccount, prefs)
 {
     this.globalProperties = gProps;
 }
Esempio n. 5
0
 private void FormsTrayApp_Load(object sender, System.EventArgs e)
 {
     if (shutdown)
        {
     this.Close();
        }
        else
        {
     try
     {
      Environment.CurrentDirectory = Application.StartupPath;
      simiasManager.Start();
      SetWebServiceInformation(simiasManager.WebServiceUri, simiasManager.DataPath);
      ifWebService = new iFolderWebService();
      ifWebService.Url = simiasManager.WebServiceUri + "/iFolder.asmx";
      simiasWebService = new SimiasWebService();
      simiasWebService.Url = simiasManager.WebServiceUri + "/Simias.asmx";
      eventQueue = new Queue();
      workEvent = new AutoResetEvent(false);
      eventClient = new IProcEventClient(new IProcEventError(errorHandler), null);
      eventClient.Register();
      if (!eventError)
      {
       eventClient.SetEvent(IProcEventAction.AddNodeChanged, new IProcEventHandler(trayApp_nodeEventHandler));
       eventClient.SetEvent(IProcEventAction.AddNodeCreated, new IProcEventHandler(trayApp_nodeEventHandler));
       eventClient.SetEvent(IProcEventAction.AddNodeDeleted, new IProcEventHandler(trayApp_nodeEventHandler));
       eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(trayApp_collectionSyncHandler));
       eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(trayApp_fileSyncHandler));
       eventClient.SetEvent(IProcEventAction.AddNotifyMessage, new IProcEventHandler(trayApp_notifyMessageHandler));
      }
      preferences = new Preferences(ifWebService, simiasWebService, simiasManager);
      preferences.EnterpriseConnect += new Novell.FormsTrayApp.Preferences.EnterpriseConnectDelegate(preferences_EnterpriseConnect);
      preferences.ChangeDefaultDomain += new Novell.FormsTrayApp.Preferences.ChangeDefaultDomainDelegate(preferences_EnterpriseConnect);
      preferences.RemoveDomain += new Novell.FormsTrayApp.Preferences.RemoveDomainDelegate(preferences_RemoveDomain);
      preferences.ShutdownTrayApp += new Novell.FormsTrayApp.Preferences.ShutdownTrayAppDelegate(preferences_ShutdownTrayApp);
      preferences.UpdateDomain += new Novell.FormsTrayApp.Preferences.UpdateDomainDelegate(preferences_UpdateDomain);
      preferences.CreateControl();
      IntPtr handle = preferences.Handle;
      syncLog = new SyncLog();
      syncLog.CreateControl();
      handle = syncLog.Handle;
      LocalService.Start(simiasWebService, simiasManager.WebServiceUri, simiasManager.DataPath);
      LocalService.Start(ifWebService, simiasManager.WebServiceUri, simiasManager.DataPath);
      simiasRunning = true;
      globalProperties = new GlobalProperties(ifWebService, simiasWebService, eventClient);
      globalProperties.RemoveDomain += new Novell.FormsTrayApp.GlobalProperties.RemoveDomainDelegate(globalProperties_RemoveDomain);
      globalProperties.PreferenceDialog = preferences;
      globalProperties.SyncLogDialog = syncLog;
      globalProperties.CreateControl();
      handle = globalProperties.Handle;
      bool accountPrompt = false;
      try
      {
       globalProperties.InitializeServerList();
       DomainInformation[] domains;
       domains = this.simiasWebService.GetDomains(false);
       foreach(DomainInformation dw in domains)
       {
        try
        {
     if (dw.IsSlave)
     {
      preferences.AddDomainToList(dw);
     }
     globalProperties.AddDomainToList(dw);
     preferences.SetProxyForDomain( dw.HostUrl, false );
        }
        catch {}
       }
       if (domains.Length.Equals(0))
       {
        accountPrompt = true;
       }
      }
      catch {}
      if (worker == null)
      {
       worker = new Thread(new ThreadStart(eventThreadProc));
       worker.Start();
      }
      shellNotifyIcon.Text = resourceManager.GetString("iFolderServices");
      shellNotifyIcon.Icon = trayIcon;
      updateOverlayIcons();
      if (accountPrompt)
      {
       notifyType = NotifyType.CreateAccount;
       shellNotifyIcon.DisplayBalloonTooltip(resourceManager.GetString("createAccountTitle"), resourceManager.GetString("createAccount"), BalloonType.Info);
      }
     }
     catch (Exception ex)
     {
      ShutdownTrayApp(ex);
     }
        }
 }