Esempio n. 1
0
        public static string AskQuestionServer(ToDoApplication application, string question, string serverfunction)
        {
            while (true)
            {
                Console.WriteLine(question);
                string answer = Console.ReadLine().Trim();

                if (string.IsNullOrWhiteSpace(answer))
                {
                    continue;
                }

                if (ExitCheck(answer))
                {
                    return("exit");
                }

                try
                {
                    var  mConnection      = application.HubConnection;
                    var  mHub             = application.Hub;
                    bool serverboolresult = false;

                    while (mConnection.State != ConnectionState.Connected)
                    {
                        mConnection.Start().Wait();
                    }
                    serverboolresult = mHub.Invoke <bool>(serverfunction, answer).Result;

                    if (!serverboolresult)
                    {
                        continue;
                    }

                    return(answer);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
Esempio n. 2
0
        public static bool ListCountGreaterZeroCheck(ToDoApplication Application)
        {
            try
            {
                bool ListCountGreaterZeroResult = false;
                var  mConnection = Application.HubConnection;
                var  mHub        = Application.Hub;

                while (mConnection.State != ConnectionState.Connected)
                {
                    mConnection.Start().Wait();
                }

                ListCountGreaterZeroResult = mHub.Invoke <bool>("ClientListCountGreaterThanZeroCheckRequest").Result;

                return(ListCountGreaterZeroResult);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            var application = new ToDoApplication();

            application.Run();
        }
Esempio n. 4
0
 public StartConnection(string Url, string HubProxyName, ToDoApplication Application)
 {
     mUrl          = Url;
     mHubProxyName = HubProxyName;
     mApplication  = Application;
 }