Beispiel #1
0
 /// <summary>
 /// Returns native container request.
 /// </summary>
 /// <returns></returns>
 internal ContainersReqNative ToNative()
 {
     return(new ContainersReqNative
     {
         App = App,
         ContainersPtr = BindingUtils.CopyFromObjectList(Containers),
         ContainersLen = (UIntPtr)(Containers?.Count ?? 0),
         ContainersCap = UIntPtr.Zero
     });
 }
Beispiel #2
0
 /// <summary>
 /// Returns ShareMDataReqNative
 /// </summary>
 /// <returns></returns>
 internal ShareMDataReqNative ToNative()
 {
     return(new ShareMDataReqNative
     {
         App = App,
         MDataPtr = BindingUtils.CopyFromObjectList(MData),
         MDataLen = (UIntPtr)(MData?.Count ?? 0),
         MDataCap = UIntPtr.Zero
     });
 }
        internal FilesMap(FilesMapNative native)
        {
            var nativeFiles = new List <FileInfoNative>();

            nativeFiles = BindingUtils.CopyToObjectList <FileInfoNative>(native.FilesPtr, (int)native.FilesLen);
            Files       = new List <FileInfo>();
            foreach (var item in nativeFiles)
            {
                Files.Add(new FileInfo(item));
            }
        }
 /// <summary>
 /// Returns native authentication response (AuthGrantedNative).
 /// </summary>
 /// <returns></returns>
 internal AuthGrantedNative ToNative()
 {
     return(new AuthGrantedNative
     {
         AppKeys = AppKeys.ToNative(),
         AccessContainerInfo = AccessContainerInfo,
         AccessContainerEntry = AccessContainerEntry.ToNative(),
         BootstrapConfigPtr = BindingUtils.CopyFromByteArray(BootstrapConfig),
         BootstrapConfigLen = (UIntPtr)(BootstrapConfig?.Length ?? 0)
     });
 }
 internal AppKeysNative ToNative()
 {
     return(new AppKeysNative
     {
         FullIdPtr = BindingUtils.CopyFromByteArray(FullId),
         FullIdLen = (UIntPtr)(FullId?.Length ?? 0),
         EncKey = EncKey,
         EncPublicKey = EncPublicKey,
         EncSecretKeyPtr = BindingUtils.CopyFromByteArray(EncSecretKey),
         EncSecretKeyLen = (UIntPtr)(EncSecretKey?.Length ?? 0)
     });
 }
 internal PublishedImmutableDataNative ToNative()
 {
     return(new PublishedImmutableDataNative
     {
         XorUrl = XorUrl,
         XorName = XorName,
         DataPtr = BindingUtils.CopyFromByteArray(Data),
         DataLen = (UIntPtr)(Data?.Length ?? 0),
         ResolvedFrom = ResolvedFrom.ToNative(),
         MediaType = MediaType
     });
 }
 /// <summary>
 /// Returns native authentication request.
 /// </summary>
 /// <returns></returns>
 internal AuthReqNative ToNative()
 {
     return(new AuthReqNative
     {
         App = App,
         AppContainer = AppContainer,
         AppPermissionTransferCoins = AppPermissionTransferCoins,
         AppPermissionPerformMutations = AppPermissionPerformMutations,
         AppPermissionGetBalance = AppPermissionGetBalance,
         ContainersPtr = BindingUtils.CopyFromObjectList(Containers),
         ContainersLen = (UIntPtr)(Containers?.Count ?? 0)
     });
 }
 internal void Free()
 {
     BindingUtils.FreeList(ref FilesPtr, ref FilesLen);
 }
 /// <summary>
 /// Initialise a new wallet spendable balances object from native wallet spendable balances.
 /// </summary>
 /// <param name="native"></param>
 internal WalletSpendableBalances(WalletSpendableBalancesNative native)
 {
     WalletBalances = BindingUtils.CopyToObjectList <WalletSpendableBalanceInfo>(
         native.WalletBalancesPtr,
         (int)native.WalletBalancesLen);
 }
 internal void Free()
 {
     BindingUtils.FreeList(ref FileMetaDataPtr, ref FileMetaDataLen);
 }
 internal void Free()
 {
     BindingUtils.FreeList(ref FullIdPtr, ref FullIdLen);
     BindingUtils.FreeList(ref EncSecretKeyPtr, ref EncSecretKeyLen);
 }
Beispiel #12
0
 /// <summary>
 /// Initialise IPC response message.
 /// </summary>
 /// <param name="reqId"></param>
 /// <param name="serialisedCfgPtr"></param>
 /// <param name="serialisedCfgLen"></param>
 public UnregisteredIpcMsg(uint reqId, IntPtr serialisedCfgPtr, UIntPtr serialisedCfgLen)
 {
     ReqId         = reqId;
     SerialisedCfg = BindingUtils.CopyToByteArray(serialisedCfgPtr, (int)serialisedCfgLen);
 }
 internal FileInfo(FileInfoNative native)
 {
     FileName     = native.FileName;
     FileMetaData = BindingUtils.CopyToObjectList <FileMetaDataItem>(native.FileMetaDataPtr, (int)native.FileMetaDataLen);
 }
Beispiel #14
0
 /// <summary>
 /// Initialise a new container request object from native container request.
 /// </summary>
 /// <param name="native"></param>
 internal ContainersReq(ContainersReqNative native)
 {
     App        = native.App;
     Containers = BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen);
 }
 internal ProcessedEntries(ProcessedEntriesNative native)
 {
     Entries = BindingUtils.CopyToObjectList <ProcessedEntry>(native.ProcessedEntriesPtr, (int)native.ProcessedEntriesLen);
 }
 /// <summary>
 /// Free the wallet spendable balances pointer.
 /// </summary>
 internal void Free()
 {
     BindingUtils.FreeList(ref WalletBalancesPtr, ref WalletBalancesLen);
 }
Beispiel #17
0
 /// <summary>
 /// Initialise a new Mutable Data share request object from native request.
 /// </summary>
 /// <param name="native"></param>
 internal ShareMDataReq(ShareMDataReqNative native)
 {
     App   = native.App;
     MData = BindingUtils.CopyToObjectList <ShareMData>(native.MDataPtr, (int)native.MDataLen);
 }
Beispiel #18
0
 /// <summary>
 /// Free the container pointer.
 /// </summary>
 internal void Free()
 {
     BindingUtils.FreeList(ref ContainersPtr, ref ContainersLen);
 }
 /// <summary>
 /// Initialise the processed file from native file info.
 /// </summary>
 /// <param name="native"></param>
 internal ProcessedFiles(ProcessedFilesNative native)
 {
     Files = BindingUtils.CopyToObjectList <ProcessedFile>(
         native.ProcessedFilesPtr,
         (int)native.ProcessedFilesLen);
 }
Beispiel #20
0
 /// <summary>
 /// Free bootstrap config pointer.
 /// </summary>
 internal void Free()
 {
     AccessContainerEntry.Free();
     BindingUtils.FreeList(ref BootstrapConfigPtr, ref BootstrapConfigLen);
 }
 internal void Free()
 {
     BindingUtils.FreeList(ref ProcessedEntriesPtr, ref ProcessedEntriesLen);
 }
Beispiel #22
0
 /// <summary>
 /// Initialise a new access container entry object from native access container entry
 /// </summary>
 /// <param name="native"></param>
 internal AccessContainerEntry(AccessContainerEntryNative native)
 {
     Containers = BindingUtils.CopyToObjectList <ContainerInfo>(native.ContainersPtr, (int)native.ContainersLen);
 }