Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            commandLineOptions = ParseCommandLine(args);
              if (commandLineOptions != null)
              {
            if (commandLineOptions.RequestToken)
            {
              logger.Warn("Please visit following uri to retrieve your Slack token");
              logger.Warn(OAuthHelper.GetAuthorizationUri());
            }
            else
            {
              luxa4Slack = new Luxa4Slack(
            commandLineOptions.Token,
            commandLineOptions.ShowUnreadMentions,
            commandLineOptions.ShowUnreadMessages);

              try
              {
            luxa4Slack.Initialize();
            luxa4Slack.LuxaforFailure += OnLuxaforFailure;

            Console.ReadLine();
              }
              catch (Exception ex)
              {
            logger.Error(ex);
              }
              finally
              {
            luxa4Slack.Dispose();
              }
            }
              }
        }
Exemplo n.º 2
0
 private void Initialize()
 {
     if (string.IsNullOrWhiteSpace(this.token))
       {
     this.Dispatcher.Invoke(() => this.viewModel.ShowPreferencesCommand.Execute(null));
       }
       else
       {
     this.luxa4Slack = new Luxa4Slack(this.token, this.showUnreadMentions, this.showUnreadMessages);
     try
     {
       this.luxa4Slack.Initialize();
       this.luxa4Slack.LuxaforFailure += this.OnLuxaforFailure;
     }
     catch (Exception ex)
     {
       this.viewModel.ShowError($"Unable to initialize Luxa4Slack: {ex.Message}");
       this.Dispatcher.Invoke(() => this.viewModel.ExitApplicationCommand.Execute(null));
     }
       }
 }
Exemplo n.º 3
0
 private void Initialize()
 {
     if (string.IsNullOrWhiteSpace(this.token))
     {
         this.Dispatcher.Invoke(() => this.viewModel.ShowPreferencesCommand.Execute(null));
     }
     else
     {
         this.luxa4Slack = new Luxa4Slack(this.token, this.showUnreadMentions, this.showUnreadMessages, this.showStatus);
         try
         {
             this.luxa4Slack.Initialize();
             this.luxa4Slack.LuxaforFailure += this.OnLuxaforFailure;
         }
         catch (Exception ex)
         {
             this.viewModel.ShowError($"Unable to initialize Luxa4Slack: {ex.Message}");
             this.Dispatcher.Invoke(() => this.viewModel.ExitApplicationCommand.Execute(null));
         }
     }
 }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            commandLineOptions = ParseCommandLine(args);
            if (commandLineOptions != null)
            {
                if (commandLineOptions.RequestToken)
                {
                    logger.Warn("Please visit following uri to retrieve your Slack token");
                    logger.Warn(OAuthHelper.GetAuthorizationUri());
                }
                else
                {
                    luxa4Slack = new Luxa4Slack(
                        commandLineOptions.Token,
                        commandLineOptions.ShowUnreadMentions,
                        commandLineOptions.ShowUnreadMessages,
                        commandLineOptions.ShowStatus);

                    try
                    {
                        luxa4Slack.Initialize();
                        luxa4Slack.LuxaforFailure += OnLuxaforFailure;

                        Console.ReadLine();
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex);
                    }
                    finally
                    {
                        luxa4Slack.Dispose();
                    }
                }
            }
        }