mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Initial implmentation of directory search
This commit is contained in:
parent
999982f789
commit
768bbf9298
2 changed files with 51 additions and 7 deletions
|
|
@ -41,6 +41,26 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
Codec = codec;
|
Codec = codec;
|
||||||
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
||||||
codec.IsReadyChange += new EventHandler<EventArgs>(codec_IsReadyChange);
|
codec.IsReadyChange += new EventHandler<EventArgs>(codec_IsReadyChange);
|
||||||
|
|
||||||
|
var dirCodec = codec as IHasDirectory;
|
||||||
|
if (dirCodec != null)
|
||||||
|
{
|
||||||
|
dirCodec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dirCodec_DirectoryResultReturned);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||||
|
{
|
||||||
|
var dir = e.Directory;
|
||||||
|
PostStatusMessage(new
|
||||||
|
{
|
||||||
|
currentDirectory = e.Directory
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -91,6 +111,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
Codec.AcceptCall(call);
|
Codec.AcceptCall(call);
|
||||||
}));
|
}));
|
||||||
appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot));
|
appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot));
|
||||||
|
appServerController.AddAction(MessagePath + "/directoryById", new Action<string>(s => GetDirectory(s)));
|
||||||
|
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(s => DirectorySearch(s)));
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
|
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
|
||||||
|
|
@ -115,6 +137,33 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
return Codec.ActiveCalls.FirstOrDefault(c => c.Id == id);
|
return Codec.ActiveCalls.FirstOrDefault(c => c.Id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="s"></param>
|
||||||
|
void DirectorySearch(string s)
|
||||||
|
{
|
||||||
|
var dirCodec = Codec as IHasDirectory;
|
||||||
|
if (dirCodec != null)
|
||||||
|
{
|
||||||
|
dirCodec.SearchDirectory(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
void GetDirectory(string id)
|
||||||
|
{
|
||||||
|
var dirCodec = Codec as IHasDirectory;
|
||||||
|
if(dirCodec == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dirCodec.GetDirectoryFolderContents(id);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -135,14 +184,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dir = dirCodec.DirectoryRoot;
|
|
||||||
PostStatusMessage(new
|
PostStatusMessage(new
|
||||||
{
|
{
|
||||||
currentDirectory = new
|
currentDirectory = dirCodec.DirectoryRoot
|
||||||
{
|
|
||||||
folderId = dir.ResultsFolderId,
|
|
||||||
items = dir.DirectoryResults
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit a9e9334eb0a3ea0d4d5d060565586df5bd305507
|
Subproject commit d3babc375ec02690385b03618845e04262ab42f0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue