This commit is contained in:
sc committed 2023-11-22 14:02:15 +08:00
commit ae35c93165
3 files changed
+30 -39

No files matched your search

+27 -21
View File
@@ -32,6 +32,7 @@ public class MainWindowViewModel : ViewModelBase
DataTable RecipedataTable = new DataTable(); //建立Recipe缓存
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
public string Sys_Time; //显示系统时间
string TEXT_SQLIP;
string TEXT_SQLNAME;
@@ -143,7 +144,31 @@ public class MainWindowViewModel : ViewModelBase
}
return lst;
}
/// <summary>
/// 循环事件设定
/// </summary>
public void CountDown()
{
//products = new ProductProvider().Select();
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
};
timer.Tick += Tick_Event;
timer.Start();
//设置定时器
// disTimer.Tick += new EventHandler(DisTimer_Tick);//每一秒执行的方法
// disTimer.Interval = new TimeSpan(10000000); //时间间隔为一秒。
// disTimer.Start();//计时开始
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
Sys_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
public class Product //stuff_Product
@@ -181,24 +206,5 @@ public class MainWindowViewModel : ViewModelBase
return DissolveName;
}
}
/// <summary>
/// StuffViewModeldl
/// </summary>
/* public RRODUCTiewModel()
{
//products = new ProductProvider().Select();
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
}*/
}