public ChildMenu(Form1 parent, ProductModel product, ModeWork mode) { InitializeComponent(); var result = typeof(ProductModel.TypeProduct).GetEnumValues(); Mode = mode; foreach (var item in result) { cbType.Items.Add(item); } btnCancel.Text = "Cancel"; Parent = parent; if (mode == ModeWork.Add) { SetModeAdd(product); } else if (mode == ModeWork.Edit) { SetModeEdit(product); } }
void key_OPEN(object parameter) { if (Wait.IsOpen) { return; } if (LongtaskPingCANCELING.isENABLE()) { return; } if (loc.openfile) { return; } loc.openfile = true; CollectionisCreate(); ModeWork.ResetMODEApplication(); _file = new FileWork(); _file.LOAD("", ViewModelMain.myLISTfull, text_title, chek_upd, chek__hoop); text_title = _file.text_title; loc.openfile = false; }
public async Task <string> AsyncOPEN(List <IPTVman.Model.ParamCanal> lst, string name) { var tcs = new TaskCompletionSource <string>(); //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& var taskload = Task.Run(() => { try { loc.asyncOPEN = true; Wait.Create("Идет анализ файла ", true); mode_work_with_links = true; bufferstring.Clear(); if (name != null) { Trace.WriteLine("start parsing >" + name + "<"); PARSING_FILE(lst, name); } else { loc.openfile = false; } Thread.Sleep(300); Wait.Close(); if (Event_UpdateLIST != null) { Event_UpdateLIST(typefilter.normal); } Wait.Close(); bufferstring.Clear(); ModeWork.ResetMODEApplication(); if (ModeWork.OpenWindow_db_update) { ModeWork.OpenWindow_db_updateREADY = true; } if (ModeWork.OpenWindow_radio) { ModeWork.OpenWindow_radioREADY = true; } tcs.SetResult("ok"); } catch (OperationCanceledException e) { tcs.SetException(e); } catch (Exception e) { tcs.SetException(e); } loc.asyncOPEN = false; return(tcs.Task); }); //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& try { var result = await taskload; if (Task_Completed != null) { Task_Completed(); } } catch (Exception ex) { dialog.Show("ОШИБКА-ПАРСИНГА ФАйЛА " + ex.Message.ToString()); } return(tcs.ToString()); }
public override string ToString() { return(base.ToString() + " ,door - " + IsOpen.ToString() + " mode work is : " + ModeWork.ToString() + " , temperature is : " + Temperature.ToString()); }