Exemplo n.º 1
0
            public ulong Add(Attribute a)
            {
                Debug.WriteLine("Adding new attribute:" + a.ToString());

                IntPtr nameAnsi  = Utility.StringToAnsiIntPtr(a.GetName());
                IntPtr valueAnsi = Utility.StringToAnsiIntPtr(a.GetValue());

                UInt32 size = UnmanagedAddAttribute(cAttrList, Attribute.UnmanagedNew(nameAnsi, valueAnsi, a.GetWeight()));

                Memory.LocalFree(nameAnsi);
                Memory.LocalFree(valueAnsi);

                Debug.WriteLine("Added attribute " + a.ToString() + ". New size=" + size);

                return(size);
            }
Exemplo n.º 2
0
            public ulong Add(Attribute a)
            {
                Debug.WriteLine("Adding new attribute:" + a.ToString());

                                IntPtr nameAnsi = Utility.StringToAnsiIntPtr(a.GetName());
                                IntPtr valueAnsi = Utility.StringToAnsiIntPtr(a.GetValue());

                                UInt32 size = UnmanagedAddAttribute(cAttrList, Attribute.UnmanagedNew(nameAnsi, valueAnsi, a.GetWeight()));

                                Memory.LocalFree(nameAnsi);
                                Memory.LocalFree(valueAnsi);

                                Debug.WriteLine("Added attribute " + a.ToString() + ". New size=" + size);

                                return size;
            }
Exemplo n.º 3
0
            public AttributeList(Attribute a)
            {
                IntPtr nameAnsi  = Utility.StringToAnsiIntPtr(a.GetName());
                IntPtr valueAnsi = Utility.StringToAnsiIntPtr(a.GetValue());

                cAttrList = UnmanagedNewFromAttribute(Attribute.UnmanagedNew(nameAnsi, valueAnsi, a.GetWeight()));

                Memory.LocalFree(nameAnsi);
                Memory.LocalFree(valueAnsi);

                if (cAttrList == IntPtr.Zero)
                {
                    throw new AttributeNullPtrException();
                }
            }
Exemplo n.º 4
0
            public AttributeList(Attribute a)
            {
                IntPtr nameAnsi = Utility.StringToAnsiIntPtr(a.GetName());
                                IntPtr valueAnsi = Utility.StringToAnsiIntPtr(a.GetValue());

                                cAttrList = UnmanagedNewFromAttribute(Attribute.UnmanagedNew(nameAnsi, valueAnsi, a.GetWeight()));

                                Memory.LocalFree(nameAnsi);
                                Memory.LocalFree(valueAnsi);

                                if (cAttrList == IntPtr.Zero)
                                {
                                        throw new AttributeNullPtrException();
                                }
            }