public static Tuple <StructureValueForClient, string> CheckAutoRefresh(StructureValueForClient StructureValueForClient) { StructureValueForClient Text = default; ProgressOfUpdateAtStructAttribute Progress = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full(); Progress.NonSerializedConfig.IsInTask = false; Progress.NonSerializedConfig.Method = new Action(() => { Text = AutoRefresh_ServerPart.CheckAutoRefresh(StructureValueForClient); }); Progress.Start(); return(new Tuple <StructureValueForClient, string>(Text, Progress.ExceptionMessage)); }
public static Tuple <StructureValueForClient, string> GetParamatersForClientReady(List <string> ListNameOfValue) // Для запроса по нажатию, получает уже готовый результат { StructureValueForClient ReturnStruct = default; ProgressOfUpdateAtStructAttribute Progress = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full(); Progress.NonSerializedConfig.IsInTask = false; Progress.NonSerializedConfig.Method = new Action(() => { DateTime Start = DateTime.Now; try { ReturnStruct = AutoRefresh_ServerPart.GetParamatersForClientReady(ListNameOfValue); } catch (Exception ex) { try { ReturnStruct = AutoRefresh_ServerPart.GetParamatersForClientReady(ListNameOfValue); } catch (Exception exx) { } } TimeSpan TimeSpend = DateTime.Now - Start; ReturnStruct.TimeServerOnGetProperties = TimeSpend; ReturnStruct.TimeServerWhenGetProperties = DateTime.Now.TimeOfDay; }); Progress.Start(); return(new Tuple <StructureValueForClient, string>(ReturnStruct, Progress.ExceptionMessage)); }
static void Main(string[] args) { //Helper.CheckDirectories(); var CurrentDomain = AppDomain.CurrentDomain.BaseDirectory; var GetDirectoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Console.WriteLine("AppDomain.CurrentDomain.BaseDirectory: {0}", CurrentDomain); Console.WriteLine("Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location): {0}", GetDirectoryName); ManualResetEvent manualResetEvent = new ManualResetEvent(true); manualResetEvent.WaitOne(); ConsoleWriteLine.WriteInConsole(null, null, null, "Project started", ConsoleColor.White); Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime; Process.GetCurrentProcess().PriorityBoostEnabled = true; Helper_WINWORD.Clear(); Helper_EXCEL.Clear(); ClearNormal(); ProgressOfUpdateAtStructAttribute Standart = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full(); ValueForClient.DeserializeConfig(new TimeSpan(0, 5, 0)); // Deserialization data'es if (ValueForClient.ReadyStructure.ProgressOfUpdate is null ? true : ValueForClient.ReadyStructure.ProgressOfUpdate.List_ProgressOfUpdateAtStructAttribute.Count != 1) { Progress = Standart; ValueForClient.ReadyStructure.ProgressOfUpdate = new ProgressOfUpdate() { List_ProgressOfUpdateAtStructAttribute = new List <ProgressOfUpdateAtStructAttribute>() { Progress } }; }