Added starter method for directory root:good; adding json props and converters to directory classes

This commit is contained in:
Heath Volmer
2018-08-08 10:34:40 -06:00
parent e196ff1627
commit ad48b1ebac
4 changed files with 57 additions and 18 deletions

View File

@@ -90,6 +90,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
if (call != null)
Codec.AcceptCall(call);
}));
appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot));
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
@@ -114,6 +115,37 @@ namespace PepperDash.Essentials.AppServer.Messengers
return Codec.ActiveCalls.FirstOrDefault(c => c.Id == id);
}
/// <summary>
///
/// </summary>
void GetDirectoryRoot()
{
var dirCodec = Codec as IHasDirectory;
if (dirCodec == null)
{
// do something else?
return;
}
if (!dirCodec.PhonebookSyncState.InitialSyncComplete)
{
PostStatusMessage(new
{
initialSyncComplete = false
});
return;
}
var dir = dirCodec.DirectoryRoot;
PostStatusMessage(new
{
directory = new
{
folderId = dir.ResultsFolderId,
directory = dir.DirectoryResults
}
});
}
/// <summary>
/// Handler for codec changes
/// </summary>
@@ -122,6 +154,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
SendVtcFullMessageObject();
}
/// <summary>
///
/// </summary>
void SendIsReady()
{
PostStatusMessage(new
@@ -159,7 +194,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
sipPhoneNumber = info.SipPhoneNumber,
sipURI = info.SipUri
},
showSelfViewByDefault = Codec.ShowSelfViewByDefault
showSelfViewByDefault = Codec.ShowSelfViewByDefault,
hasDirectory = Codec is IHasDirectory
});
}

View File

@@ -62,7 +62,8 @@ namespace PepperDash.Essentials
var routeRoom = Room as IRunRouteAction;
if(routeRoom != null)
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c => routeRoom.RunRouteAction(c.SourceListItem)));
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c =>
routeRoom.RunRouteAction(c.SourceListItem)));
var defaultRoom = Room as IRunDefaultPresentRoute;
if(defaultRoom != null)

View File

@@ -15,6 +15,11 @@ namespace PepperDash.Essentials.Room.Cotija
[JsonProperty("auxFaders")]
public List<Volume> AuxFaders { get; set; }
public Volumes()
{
AuxFaders = new List<Volume>();
}
}
public class Volume

View File

@@ -537,25 +537,22 @@ namespace PepperDash.Essentials.UIDrivers.VC
var codec = Codec as IHasDirectory;
if (codec != null)
{
if (codec != null)
DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
true, 1300);
codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned);
if (codec.PhonebookSyncState.InitialSyncComplete)
SetCurrentDirectoryToRoot();
else
{
DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
true, 1300);
codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned);
if (codec.PhonebookSyncState.InitialSyncComplete)
SetCurrentDirectoryToRoot();
else
{
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
}
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
}
// If there is something here now, show it otherwise wait for the event
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
{
RefreshDirectory();
}
// If there is something here now, show it otherwise wait for the event
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
{
RefreshDirectory();
}
}
}