fixed #192
This commit is contained in:
1 parent
d9b94f83fe
commit
7f0330856d
20 files changed
+1159
-52
No files matched your search
@@ -104,12 +104,12 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
private void StartRecord()
|
||||
{
|
||||
ExternDllHelper.MciSendString("set wave bitpersample 8", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave samplespersec 20000", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave channels 2", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave format tag pcm", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("open new type WAVEAudio alias movie", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("record movie", "", 0, 0);
|
||||
Win32Helper.MciSendString("set wave bitpersample 8", "", 0, 0);
|
||||
Win32Helper.MciSendString("set wave samplespersec 20000", "", 0, 0);
|
||||
Win32Helper.MciSendString("set wave channels 2", "", 0, 0);
|
||||
Win32Helper.MciSendString("set wave format tag pcm", "", 0, 0);
|
||||
Win32Helper.MciSendString("open new type WAVEAudio alias movie", "", 0, 0);
|
||||
Win32Helper.MciSendString("record movie", "", 0, 0);
|
||||
|
||||
_stopwatch.Reset();
|
||||
_stopwatch.Start();
|
||||
@@ -135,9 +135,9 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
var cachePath = $"{AudioCachePath}\\{Guid.NewGuid().ToString()}";
|
||||
var cachePathWithQuotes = $"\"{cachePath}\"";
|
||||
ExternDllHelper.MciSendString("stop movie", "", 0, 0);
|
||||
ExternDllHelper.MciSendString($"save movie {cachePathWithQuotes}", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("close movie", "", 0, 0);
|
||||
Win32Helper.MciSendString("stop movie", "", 0, 0);
|
||||
Win32Helper.MciSendString($"save movie {cachePathWithQuotes}", "", 0, 0);
|
||||
Win32Helper.MciSendString("close movie", "", 0, 0);
|
||||
|
||||
_stopwatch.Stop();
|
||||
|
||||
|
||||
@@ -34,11 +34,6 @@ namespace HandyControlDemo.ViewModel
|
||||
/// </summary>
|
||||
private List<DemoInfoModel> _demoInfoList;
|
||||
|
||||
/// <summary>
|
||||
/// 当前选中的demo项
|
||||
/// </summary>
|
||||
private DemoItemModel _demoItemCurrent;
|
||||
|
||||
#endregion
|
||||
|
||||
public MainViewModel(DataService dataService)
|
||||
@@ -54,7 +49,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
Messenger.Default.Register<object>(this, MessageToken.ClearLeftSelected, obj =>
|
||||
{
|
||||
_demoItemCurrent = null;
|
||||
DemoItemCurrent = null;
|
||||
foreach (var item in DemoInfoList)
|
||||
{
|
||||
item.SelectedIndex = -1;
|
||||
@@ -67,6 +62,13 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
#region 属性
|
||||
|
||||
/// <summary>
|
||||
/// 当前选中的demo项
|
||||
/// </summary>
|
||||
public DemoItemModel DemoItemCurrent { get; private set; }
|
||||
|
||||
public DemoInfoModel DemoInfoCurrent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子内容
|
||||
/// </summary>
|
||||
@@ -141,9 +143,9 @@ namespace HandyControlDemo.ViewModel
|
||||
if (e.AddedItems.Count == 0) return;
|
||||
if (e.AddedItems[0] is DemoItemModel item)
|
||||
{
|
||||
if (Equals(_demoItemCurrent, item)) return;
|
||||
if (Equals(DemoItemCurrent, item)) return;
|
||||
|
||||
_demoItemCurrent = item;
|
||||
DemoItemCurrent = item;
|
||||
ContentTitle = item.Name;
|
||||
var obj = AssemblyHelper.ResolveByKey(item.TargetCtlName);
|
||||
var ctl = obj ?? AssemblyHelper.CreateInternalInstance($"UserControl.{item.TargetCtlName}");
|
||||
|
||||
Reference in new issue
Block a user