Example #1
0
        private void GetServiceEntries()
        {
            App.Current.Dispatcher.BeginInvoke((Action) delegate() { Services.Clear(); });

            using (GenerateItemsWrapper(out IntPtr ptr, out int itemsCount))
            {
                for (int i = 0; i < itemsCount; i++)
                {
                    ServiceEntry temp = (ServiceEntry)Marshal.PtrToStructure(ptr, typeof(ServiceEntry));
                    App.Current.Dispatcher.BeginInvoke((Action) delegate()
                    {
                        Services.Add(temp.ToObservableServiceEntry());
                    });
                    ptr += Marshal.SizeOf(temp);
                }
            }
        }