for (auto& i : decl.GetParameters().GetParams()) {
auto& pt = i->GetParameterType();
if(HasFile(pt.GetBaseType()))
- m += "_serverBase.ShareFile(" + i->GetID() + ");\n";
+ m += "_serverBase.TryShareFile(" + i->GetID() + ");\n";
}
return AddIndent(TAB_SIZE * 6, m);
});
const char CB_SHARE_FILE_DEF[] =
R"__cs_cb(
- private void ShareFile(IEnumerable<string> paths)
+ private void TryShareFile(IEnumerable<string> paths)
{
if (paths == null)
throw new ArgumentException("Invalid path");
foreach (string path in paths)
{
- ShareFile(path);
+ TryShareFile(path);
}
}
- private void ShareFile(string path)
+ private void TryShareFile(string path)
{
if (path == null)
throw new ArgumentException("Invalid path");
pt.GetBaseType().GetMetaType()->ToString() == "file")) {
st += GenTemplateString(CB_SHARE_FILE, [&]()->std::string {
std::string str = "";
- str += Tab(7) + "ShareFile(" + i->GetID() + ");";
+ str += Tab(7) + "TryShareFile(" + i->GetID() + ");";
return str;
});
}
public new string ServiceName;
- private static readonly string _tidlVersion = "<VERSION>";
private bool _online = false;
private Object _lock = new Object();
private List<CallbackBase> _delegateList = new List<CallbackBase>();
R"__cs_cb(
protected override void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result)
{
- if (result.Status == ConnectionStatus.OK) {
+ if (result.Status == ConnectionStatus.OK)
+ {
_online = true;
}
Discovered?.Invoke(this, peerInfo);
}
- protected override void OnPayloadReceived(Payload payload, PayloadTransferStatus status)
+ protected override void OnPayloadReceived(Payload payload, PayloadTransferStatus status)
{
- if(payload.PayloadType == PayloadType.FilePayload) {
+ if(payload.PayloadType == PayloadType.FilePayload)
+ {
FileReceived?.Invoke(this, (FilePayload)payload, status);
- } else {
+ }
+ else
+ {
Parcel parcelReceived;
try
R"__cs_cb(
/// <summary>
/// Starts discovering cion servers.
+ /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+ /// <privilege>http://tizen.org/privilege/internet</privilege>
/// </summary>
/// <exception cref="InvalidOperationException">Thrown when the discovery operation is already in progress.</exception>
- public new void TryDiscovery() {
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ public new void TryDiscovery()
+ {
base.TryDiscovery();
}
"param" + std::to_string(cnt), "result");
if (HasFile(pt.GetBaseType())) {
- m += "ShareFile(param" + std::to_string(cnt) + ");\n\n";
+ m += "TryShareFile(param" + std::to_string(cnt) + ");\n\n";
}
}
if (hasRet) {
m += ConvertTypeToSerializer(decl.GetType(), "retVal", "result");
if (HasFile(decl.GetType())) {
- m += "ShareFile(retVal);\n";
+ m += "TryShareFile(retVal);\n";
}
}
#ifndef IDLC_CS_CION_GEN_CS_STUB_GEN_CB_H_
#define IDLC_CS_CION_GEN_CS_STUB_GEN_CB_H_
-/**
- * <VERSION> Version of TIDL Compiler.
- */
const char CB_DATA_MEMBERS[] =
R"__cs_cb( private List<ServiceBase> _services = new List<ServiceBase>();
private Type _serviceType;
- private static readonly string _tidlVersion = "<VERSION>";
)__cs_cb";
const char CB_SERVICE_BASE_FRONT[] =
s.DisplayName = base.DisplayName;
s.ConnectionRequestClient = peerInfo;
s.ServerBase = this;
- s.OnConnectionRequest();
_services.Add(s);
+ s.OnConnectionRequest();
}
)__cs_cb";