Commit d031632f authored by Sylvain Berfini's avatar Sylvain Berfini

Added missing comments on public properties/methods/functions

parent cacc4f04
......@@ -33,7 +33,7 @@
</Grid.RowDefinitions>
<Rectangle
x:Name="Background"
x:Name="Background"
Fill="{StaticResource PhoneChromeBrush}"
Grid.RowSpan="2"/>
......
......@@ -33,13 +33,23 @@ namespace Linphone.Model
: base(connectionString)
{ }
/// <summary>
/// Database table which contains the received and sent messages
/// </summary>
public Table<ChatMessage> Messages;
}
/// <summary>
/// Object used to store/retrieve chat messages in/from the database
/// </summary>
[Table]
public class ChatMessage : INotifyPropertyChanged, INotifyPropertyChanging
{
private int messageID;
/// <summary>
/// Identifies each message with a unique value
/// </summary>
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public int MessageID
{
......@@ -59,6 +69,10 @@ namespace Linphone.Model
}
private string _localContact;
/// <summary>
/// SIP address of the sender if the chat message is incoming, else empty
/// </summary>
[Column(CanBeNull=false)]
public string LocalContact
{
......@@ -78,6 +92,10 @@ namespace Linphone.Model
}
private string _remoteContact;
/// <summary>
/// SIP address at wich the message was sent, else empty (if incoming)
/// </summary>
[Column(CanBeNull = false)]
public string RemoteContact
{
......@@ -97,6 +115,10 @@ namespace Linphone.Model
}
private bool _isIncoming;
/// <summary>
/// True if the message has been received, false if it has been sent
/// </summary>
[Column]
public bool IsIncoming
{
......@@ -116,6 +138,10 @@ namespace Linphone.Model
}
private string _message;
/// <summary>
/// The text contained in the message, can be empty
/// </summary>
[Column]
public string Message
{
......@@ -135,6 +161,10 @@ namespace Linphone.Model
}
private string _imageURL;
/// <summary>
/// URL of the image to download (incoming only) or filename of the image in the isolated storage
/// </summary>
[Column]
public string ImageURL
{
......@@ -154,6 +184,10 @@ namespace Linphone.Model
}
private long _timestamp;
/// <summary>
/// Timestamp at which the message has been received/sent, in seconds since January 1st, 1970
/// </summary>
[Column]
public long Timestamp
{
......@@ -173,6 +207,10 @@ namespace Linphone.Model
}
private bool _markedAsRead;
/// <summary>
/// True is the message has been read, otherwise false
/// </summary>
[Column]
public bool MarkedAsRead
{
......@@ -192,6 +230,10 @@ namespace Linphone.Model
}
private int _status;
/// <summary>
/// Stores the LinphoneChatMessageState (Idle, InProgress, Delivered, NotDelivered)
/// </summary>
[Column]
public int Status
{
......@@ -210,10 +252,15 @@ namespace Linphone.Model
}
}
// Version column aids update performance.
/// <summary>
/// Version column aids update performance.
/// </summary>
[Column(IsVersion = true)]
private Binary _version;
/// <summary>
/// Returns the local contact if the message is incoming, else returns the remote contact
/// </summary>
public string Contact
{
get
......
......@@ -54,6 +54,9 @@ namespace Linphone.Views
}
}
/// <summary>
/// Changes the camera used to capture video
/// </summary>
public void ToggleCameras()
{
LinphoneManager.Instance.ToggleCameras();
......
......@@ -486,6 +486,10 @@ namespace Linphone.Model
Logger.Msg("[LinphoneManager] AudioEndpointChanged:" + sender.GetAudioEndpoint().ToString());
}
/// <summary>
/// Enables the speaker in the current call
/// </summary>
/// <param name="enable">true to enable, false to disable</param>
public void EnableSpeaker(bool enable)
{
if (enable)
......
......@@ -751,6 +751,9 @@ namespace Linphone.Model
#endregion
#region Implementation of the ISettingsManager interface
/// <summary>
/// Loads the call settings.
/// </summary>
public void Load()
{
dict[SendDTMFsRFC2833KeyName] = LinphoneManager.Instance.LinphoneCore.GetUseRFC2833ForDTMFs().ToString();
......@@ -762,6 +765,9 @@ namespace Linphone.Model
dict[SelfViewEnabledKeyName] = LinphoneManager.Instance.LinphoneCore.IsSelfViewEnabled().ToString();
}
/// <summary>
/// Saves the call settings.
/// </summary>
public void Save()
{
if (ValueChanged(SendDTMFsRFC2833KeyName))
......@@ -900,6 +906,10 @@ namespace Linphone.Model
private const string TunnelModeKeyName = "TunnelMode";
#endregion
/// <summary>
/// Configures the Tunnel using the given mode
/// </summary>
/// <param name="mode">mode to apply</param>
public static void ConfigureTunnel(String mode)
{
if (LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable()) {
......@@ -937,6 +947,9 @@ namespace Linphone.Model
}
}
/// <summary>
/// Configures the Tunnel using the current setting value
/// </summary>
public static void ConfigureTunnel()
{
NetworkSettingsManager settings = new NetworkSettingsManager();
......
......@@ -22,7 +22,8 @@ namespace Linphone.Model
/// Saves an image sent or received in the media library of the device.
/// </summary>
/// <param name="fileName">File's name in the isolated storage</param>
public static void SavePictureInMediaLibrary(string fileName)
/// <returns>true if the operation succeeds</returns>
public static bool SavePictureInMediaLibrary(string fileName)
{
MediaLibrary library = new MediaLibrary();
byte[] data;
......@@ -39,8 +40,10 @@ namespace Linphone.Model
}
library.SavePicture(fileName, data);
return true;
}
catch { }
return false;
}
/// <summary>
......@@ -126,7 +129,13 @@ namespace Linphone.Model
return image;
}
public static void SaveImageInLocalFolder(BitmapImage image, string fileName)
/// <summary>
/// Saves a BitmapImage as a JPEG file in the local storage
/// </summary>
/// <param name="image">The bitmap image to save</param>
/// <param name="fileName">The file's name to use</param>
/// <returns>true if the operation succeeds</returns>
public static bool SaveImageInLocalFolder(BitmapImage image, string fileName)
{
try
{
......@@ -144,10 +153,12 @@ namespace Linphone.Model
file.Flush();
file.Close();
bitmap = null;
return true;
}
}
}
catch { }
return false;
}
}
}
......@@ -227,9 +227,8 @@ namespace Linphone.Views
Utils.SaveImageInLocalFolder(image, fileName);
//Upload the image
string boundary = "----------" + DateTime.Now.Ticks.ToString();
string response;
string boundary = "----------" + DateTime.Now.Ticks.ToString();
using (var client = new HttpClient())
{
_httpPostClient = client;
......@@ -500,7 +499,10 @@ namespace Linphone.Views
NavigationService.Navigate(new Uri("/Views/Contacts.xaml", UriKind.RelativeOrAbsolute));
}
void bubble_MessageDeleted(object sender, ChatMessage message)
/// <summary>
/// Callback called when a user selects the delete context menu
/// </summary>
public void bubble_MessageDeleted(object sender, ChatMessage message)
{
MessagesList.Children.Remove(sender as UserControl);
DatabaseManager.Instance.Messages.DeleteOnSubmit(message);
......
......@@ -10,8 +10,14 @@ using Windows.Storage;
namespace Linphone.Views
{
/// <summary>
/// Displays the logs collected by LinphoneCore.
/// </summary>
public partial class Console : BasePage
{
/// <summary>
/// Public constructor
/// </summary>
public Console()
{
InitializeComponent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment