Example #1
0
        private static void ListenerTcpIp(ProgressOfUpdateAtStructAttribute Parent)
        {
            ProgressOfUpdateAtStructAttribute Progress = Parent.NonSerializedConfig.GetOnEntry;

            Progress.SetName("Сетевой протокол");
            Progress.NonSerializedConfig.Method = new Action(() =>
            {
                TimeSpan Interval = new TimeSpan(0, 2, 0);
                ListenSockets.SetConfigAndStart(ThreadPriority.Highest, ListenSockets.GetType().AssemblyQualifiedName, "Прослушка сокета", null, Progress, Interval,
                                                Interval
                                                , true, ConsoleColor.White);
            });
            Progress.Start();
        }
        public override MainParentClass Menu_Virtual(ProgressOfUpdateAtStructAttribute Parent)
        {
            ProgressOfUpdateAtStructAttribute Progress = Parent.NonSerializedConfig.GetOnEntry;

            Progress.SetName(nameof(ListenSockets));
            Progress.NonSerializedConfig.Method = new Action(() =>
            {
                Task.Run(() =>
                {
                    ConnectFromServer.StartListening(typeof(MethodsCall).AssemblyQualifiedName, 11000);
                });
            });
            Progress.Start();

            return(default);
        public override MainParentClass Menu_Virtual(ProgressOfUpdateAtStructAttribute Parent)
        {
            Users Users = new Users();
            ProgressOfUpdateAtStructAttribute Progress = Parent.NonSerializedConfig.GetOnEntry;

            Progress.SetName(nameof(HR_Methods));
            Progress.NonSerializedConfig.Method = new Action(() =>
            {
                Tuple <SQLiteConnection, string> tuple = ConnectToDataBase.TryToConnectToSQLite(LocalSettings.NewBasePath);

                using (SQLiteConnection SQLiteConnection = tuple.Item1)
                {
                    Users.User_s = GetUsers(SQLiteConnection);
                }
            });
            Progress.Start();

            return(Users);
        }
Example #4
0
        public static void OnLoad(ProgressOfUpdateAtStructAttribute Parent)
        {
            ProgressOfUpdateAtStructAttribute Progress = Parent.NonSerializedConfig.GetOnEntry;

            Progress.SetName("Запуск основных участком/модулей");
            Progress.NonSerializedConfig.Method = new Action(() =>
            {
                #region ServerMethods
                Thread thread_HR_Methods = new Thread(() =>
                {
                    bool StartConfiguration_AtNow = true;
                    TimeSpan HowOftenCheck        =
                        //default;
                        TimeSpan.FromMinutes(1);
                    TimeSpan Interval = new TimeSpan(1, 0, 0);
                    HR_Methods.SetConfigAndStart(ThreadPriority.BelowNormal, LocalSettings.HR_Methods.GetType().AssemblyQualifiedName, nameof(StructureValueForClient.HR), nameof(StructureValueForClient.HR), new ProgressOfUpdateAtStructAttribute(), Interval, HowOftenCheck, StartConfiguration_AtNow, ConsoleColor.Yellow);
                });
                thread_HR_Methods.Priority     = ThreadPriority.BelowNormal;
                thread_HR_Methods.IsBackground = true;
                thread_HR_Methods.Start();
                //thread_HR_Methods.Join();

                Thread thread_Users_Methods = new Thread(() =>
                {
                    bool StartConfiguration_AtNow = true;
                    TimeSpan HowOftenCheck        =
                        //default;
                        TimeSpan.FromMinutes(1);
                    TimeSpan Interval = new TimeSpan(1, 0, 0);
                    Users_Methods.SetConfigAndStart(ThreadPriority.BelowNormal, LocalSettings.Users_Methods.GetType().AssemblyQualifiedName, nameof(StructureValueForClient.Users), nameof(StructureValueForClient.Users), new ProgressOfUpdateAtStructAttribute(), Interval, HowOftenCheck, StartConfiguration_AtNow, ConsoleColor.Yellow);
                });
                thread_Users_Methods.Priority     = ThreadPriority.BelowNormal;
                thread_Users_Methods.IsBackground = true;
                thread_Users_Methods.Start();
                //thread_Users_Methods.Join();
                #endregion

                ListenerTcpIp(Progress); // Listen sockets Thread
            });
            Progress.Start();
        }