Esempio n. 1
0
        public CoreGroup[] GetGroup(uint startFrom, uint size)
        {
            uint groupSize = GetGroupSize();

            if (groupSize > startFrom)
            {
                object groupObject = new CoreDll.adGroup();
                int    sizeOfGroup = Marshal.SizeOf(groupObject);
                size = Math.Min(groupSize - startFrom, size);
                byte[]      buffer     = new byte[sizeOfGroup * size];
                CoreGroup[] groups     = new CoreGroup[size];
                UIntPtr[]   pStartFrom = new UIntPtr[1];
                pStartFrom[0] = new UIntPtr(startFrom);
                UIntPtr[] pSize = new UIntPtr[1];
                pSize[0] = new UIntPtr(size);
                if (m_dll.adGroupGet(m_handle, Marshal.UnsafeAddrOfPinnedArrayElement(pStartFrom, 0),
                                     Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0),
                                     Marshal.UnsafeAddrOfPinnedArrayElement(pSize, 0)) == CoreDll.Error.Ok)
                {
                    for (uint i = 0; i < pSize[0].ToUInt32(); ++i)
                    {
                        IntPtr          pGroup = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, (int)(i * sizeOfGroup));
                        CoreDll.adGroup group  = (CoreDll.adGroup)Marshal.PtrToStructure(pGroup, groupObject.GetType());
                        groups[i] = new CoreGroup(ref group, this);
                    }
                }
                return(groups);
            }
            return(null);
        }
Esempio n. 2
0
 public void ChangeCurrentThumbnail(CoreGroup group, int index)
 {
     if (OnCurrentThumbnailChanged != null)
     {
         OnCurrentThumbnailChanged(group, index);
     }
 }
 public ThumbnailGroupPanel(CoreLib core, AntiDupl.NET.Options options, CoreGroup group, ThumbnailGroupTable thumbnailGroupTable)
 {
     m_core                = core;
     m_options             = options;
     m_group               = group;
     m_thumbnailGroupTable = thumbnailGroupTable;
     InitializeComponents();
 }
Esempio n. 4
0
 public void SetThumbnail(CoreGroup group, int index)
 {
     m_group = group;
     m_index = index;
     m_pictureBoxPanel.UpdateImage(ImageInfo);
     m_pictureBoxPanel.UpdateImagePadding(m_group.sizeMax);
     m_pictureBoxPanel.Refresh();
 }
Esempio n. 5
0
 public bool Rename(CoreGroup group, int index, string newFileName)
 {
     if (m_core.Rename(group.id, index, newFileName))
     {
         UpdateGroups();
         return(true);
     }
     return(false);
 }
Esempio n. 6
0
 public ThumbnailPanel(CoreLib core, AntiDupl.NET.Options options, CoreGroup group, int index, ThumbnailGroupPanel thumbnailGroupPanel)
 {
     m_core                = core;
     m_options             = options;
     m_group               = group;
     m_index               = index;
     m_thumbnailGroupPanel = thumbnailGroupPanel;
     InitializeComponents();
     SetImageInfo();
 }