Пример #1
0
 /// <summary>
 /// Shut it down as if it has no power. Controls won't react and screen will be empty
 /// </summary>
 private void PowerOff()
 {
     EntryList.Clear();
     StopRefresh();
     TurnOnOff(false);
     RescanElements();
 }
Пример #2
0
        public void ShuffleEntries()
        {
            int          count      = EntryList.Count();
            List <Entry> ListtoSort = new List <Entry>(EntryList);
            List <int>   rngList    = new List <int>();
            Random       r          = new Random();

            for (int i = 0; i < count; i++)
            {
                while (true)
                {
                    int newrng = r.Next(0, count);
                    if (!rngList.Contains(EntryList[newrng].UniqueID))
                    {
                        rngList.Add(EntryList[newrng].UniqueID); break;
                    }
                }
            }
            ListtoSort = ListtoSort.OrderBy(x => rngList.IndexOf(x.UniqueID)).ToList();
            EntryList.Clear();
            for (int i = 0; i < count; i++)
            {
                EntryList.Add(ListtoSort[i]);
            }
        }
Пример #3
0
 protected async Task StartRaffle()
 {
     Console.WriteLine($"{DateTime.Now}: Starting the Raffle");
     Modal.Show("Confirm Raffle Start", typeof(raffler.Pages.StartRaffleConfirmation));
     EntryList.Clear();
     Console.WriteLine($"{DateTime.Now}: Started the Raffle");
     //ToggleEnabledButtons(false, true, true);
     StateHasChanged();
     await Task.CompletedTask;
 }
Пример #4
0
        public void SetReplacement(IList <ReplacementEntry> indexList)
        {
            EntryList.Clear();
            foreach (ReplacementEntry Index in indexList)
            {
                EntryList.Add(Index);
            }

            if (listOptions.SelectedIndex < 0 && EntryList.Count > 0)
            {
                listOptions.SelectedIndex = 0;
            }
        }
Пример #5
0
 public void EntriesClear()
 {
     if (IsBusy)
     {
         if (AllowExceptions)
         {
             throw new InvalidOperationException("Wheel is currently busy");
         }
         else
         {
             return;
         }
     }
     EntryList.Clear();
     Refresh();
 }
Пример #6
0
        /// <summary>
        /// Clears this collection by removing all its members and optionally disposing them.
        /// </summary>
        /// <param name="disposeMembers">True to dispose the removed members, false to just
        /// remove them.</param>
        public void Clear(bool disposeMembers = true)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }

            if (disposeMembers)
            {
                var list = _Members.ToArray(); foreach (var member in list)
                {
                    member.Dispose();
                }
                Array.Clear(list, 0, list.Length);
            }

            _Members.Clear();
        }
Пример #7
0
        private void UpdateEntryList(JpegMetaData metadata)
        {
            EntryList.Clear();

            var exposureModeEntry = FindFirstEntry(metadata, ExifKeys.ExposureProgram);

            if (exposureModeEntry != null)
            {
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.ExposureProgram),
                                          MetaDataValueConverter.ExposuteProgramName(exposureModeEntry.UIntValues[0])));
            }

            var ssEntry = FindFirstEntry(metadata, ExifKeys.ExposureTime);

            if (ssEntry != null)
            {
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.ExposureTime),
                                          MetaDataValueConverter.ShutterSpeed(ssEntry.UFractionValues[0].Numerator, ssEntry.UFractionValues[0].Denominator)));
            }

            var focalLengthEntry = FindFirstEntry(metadata, ExifKeys.FocalLength);

            if (focalLengthEntry != null)
            {
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.FocalLength),
                                          GetStringValue(metadata, ExifKeys.FocalLength) + "mm"));
            }

            foreach (uint key in GeneralMetaDataKeys)
            {
                if (FindFirstEntry(metadata, key) == null)
                {
                    continue;
                }
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(key),
                                          GetStringValue(metadata, key)));
            }

            var wbEntry       = FindFirstEntry(metadata, ExifKeys.WhiteBalanceMode);
            var wbDetailEntry = FindFirstEntry(metadata, ExifKeys.WhiteBalanceDetailType);

            if (wbEntry != null && wbDetailEntry != null)
            {
                string value;
                if (wbEntry.UIntValues[0] == 0x0)
                {
                    value = SystemUtil.GetStringResource("WB_Auto");
                }
                else
                {
                    value = MetaDataValueConverter.WhitebalanceName(wbDetailEntry.UIntValues[0]);
                }
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.WhiteBalanceMode), value));
            }

            var evEntry = FindFirstEntry(metadata, ExifKeys.ExposureCompensation);

            if (evEntry != null)
            {
                EntryList.Add(CreateEntry(SystemUtil.GetStringResource("MetaDataName_ExposureCompensation"), MetaDataValueConverter.EV(evEntry.DoubleValues[0])));
            }

            var meteringModeEntry = FindFirstEntry(metadata, ExifKeys.MeteringMode);

            if (meteringModeEntry != null)
            {
                EntryList.Add(CreateEntry(SystemUtil.GetStringResource("MetaDataName_MeteringMode"), MetaDataValueConverter.MeteringModeName(meteringModeEntry.UIntValues[0])));
            }

            var flashEntry = FindFirstEntry(metadata, ExifKeys.Flash);

            if (flashEntry != null)
            {
                EntryList.Add(CreateEntry(SystemUtil.GetStringResource("MetaDataName_Flash"), MetaDataValueConverter.FlashNames(flashEntry.UIntValues[0])));
            }

            var heightEntry = FindFirstEntry(metadata, ExifKeys.ImageHeight);
            var widthEntry  = FindFirstEntry(metadata, ExifKeys.ImageWidth);

            if (heightEntry != null && widthEntry != null)
            {
                EntryList.Add(CreateEntry(SystemUtil.GetStringResource("MetaDataName_ImageSize"),
                                          widthEntry.UIntValues[0] + " x " + heightEntry.UIntValues[0]));
            }

            var makerEntry = FindFirstEntry(metadata, ExifKeys.CameraMaker);
            var modelEntry = FindFirstEntry(metadata, ExifKeys.CameraModel);

            if (makerEntry != null && modelEntry != null)
            {
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.CameraModel),
                                          makerEntry.StringValue + " " + modelEntry.StringValue));
            }

            var lensNameEntry = FindFirstEntry(metadata, ExifKeys.LensModel);

            if (lensNameEntry != null)
            {
                EntryList.Add(CreateEntry(MetaDataValueConverter.MetaDataEntryName(ExifKeys.LensModel), lensNameEntry.StringValue));
            }

            var geotagEntry = FindFirstEntry(metadata, ExifKeys.GpsLatitude);

            if (geotagEntry != null)
            {
                EntryList.Add(CreateEntry(SystemUtil.GetStringResource("MetaData_Geotag"), MetaDataValueConverter.Geoinfo(metadata.GpsIfd)));
            }
        }
Пример #8
0
 void ShowInvalidData()
 {
     EntryList.Clear();
     EntryList.Add(CreateEntry("NO DATA"));
 }
Пример #9
0
 void ShowInvalidData()
 {
     EntryList.Clear();
     EntryList.Add(CreateEntry(SystemUtil.GetStringResource("Exif_NoData")));
 }