Esempio n. 1
0
        internal static CustomMetadata FromSWIG(SWIG.Object obj)
        {
            CustomMetadata ret = new CustomMetadata();

            ret.Entries = new List <CustomMetadataEntry>();

            if (mut.WaitOne(1000))
            {
                try
                {
                    SWIG.storj_uplink.prepare_get_custommetadata(obj);

                    for (int i = 0; i < obj.custom.count; i++)
                    {
                        var entry = SWIG.storj_uplink.get_next_custommetadata();
                        ret.Entries.Add(new CustomMetadataEntry()
                        {
                            Key = entry.key, Value = entry.value
                        });
                    }
                }
                finally
                {
                    mut.ReleaseMutex();
                }
            }

            return(ret);
        }
Esempio n. 2
0
        internal static Object FromSWIG(SWIG.Object original, bool disposeObjectInfo = true)
        {
            Object ret = new Object();

            ret.Key            = original.key;
            ret.IsPrefix       = original.is_prefix;
            ret.SystemMetaData = SystemMetadata.FromSWIG(original.system);
            ret.CustomMetaData = CustomMetadata.FromSWIG(original);

            if (disposeObjectInfo)
            {
                SWIG.storj_uplink.free_object(original);
            }

            return(ret);
        }