Exemplo n.º 1
0
        private void makeFakeSize(long eventId)
        {
            _size s = new _size();

            s.id          = 1; // not meaningful
            s.description = "";
            Sizes.Add(s);
        }
Exemplo n.º 2
0
 public void Set(double[] Values)
 {
     Sizes.Clear();
     foreach (var i in Values)
     {
         Sizes.Add(i);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationResizeService"/> class.
 /// </summary>
 public ApplicationResizeService()
 {
     Sizes.Add(new SizeItem(640, 480, SetWindowSize));
     Sizes.Add(new SizeItem(800, 600, SetWindowSize));
     Sizes.Add(new SizeItem(1024, 768, SetWindowSize));
     Sizes.Add(new SizeItem(1280, 1024, SetWindowSize));
     Sizes.Add(new SizeItem(1600, 1200, SetWindowSize));
 }
Exemplo n.º 4
0
        public void AddSize(SizeType sizeType)
        {
            if (Sizes.Any(size => size.Id == sizeType.Id))
            {
                return;
            }

            Sizes.Add(sizeType);
        }
Exemplo n.º 5
0
        public InputPageViewModel()
        {
            // Aggregate the sizes
            Sizes.AddRange(AdvancedSettings.Default.DefaultSizes);
            Sizes.Add(Settings.CustomSize);

            _showAdvancedCommand = new RelayCommand(ShowAdvanced);
            _resizeCommand       = new RelayCommand(Resize);
            _cancelCommand       = new RelayCommand(Cancel);
        }
Exemplo n.º 6
0
 public CreateProductViewModel()
 {
     foreach (Size size in Enum.GetValues(typeof(Size)))
     {
         Sizes.Add(new SizeInfoDTO()
         {
             Size = size, Quantity = 0
         });
     }
 }
Exemplo n.º 7
0
        private void AddControlToList(Control control)
        {
            if (!Sizes.ContainsKey(control))
            {
                Sizes.Add(control, control.Bounds);
            }

            foreach (Control child in control.Controls)
            {
                AddControlToList(child);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 値をすべて特定の型に変換する
        /// </summary>
        /// <typeparam name="T">型</typeparam>
        public override void ConvertAll <T>()
        {
            var tempSize   = GetArgSize <T>();
            var tempNumber = Values.Count / tempSize;

            Values = Values.GetRange(0, tempNumber * tempSize);
            Offsets.Clear();
            Numbers.Clear();
            Sizes.Clear();
            Offsets.Add(0);
            Numbers.Add(tempNumber);
            Sizes.Add(Values.Count);
        }
Exemplo n.º 9
0
        public void AddSize(IQueryable <sitesize> sizes)
        {
            // Reset Sizes
            Sizes.Clear();

            // Add each size
            foreach (var size in sizes)
            {
                _size s = new _size();
                s.id          = size.ID;
                s.description = size.description;
                Sizes.Add(s);
            }
        }
Exemplo n.º 10
0
        public bool AddSize(Size size)
        {
            Sizes sizes = new Sizes();

            sizes.SelectAll();
            if (sizes.Add(size))
            {
                return(sizes.Save());
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 11
0
 public void GetSizes(DataReader reader)
 {
     for (int i = 0; i < Positions.Count; i++)
     {
         if (i == (Positions.Count - 1))
         {
             Sizes.Add((int)reader.Stream.Length - Positions[i]);
         }
         else
         {
             Sizes.Add(Positions[i + 1] - Positions[i]);
         }
     }
 }
Exemplo n.º 12
0
        public void SetSizes(IEnumerable <SizeType> sizeTypes)
        {
            if (sizeTypes == null || !sizeTypes.Any())
            {
                return;
            }

            Sizes.Clear();

            foreach (var sizeType in sizeTypes)
            {
                Sizes.Add(sizeType);
            }
        }
Exemplo n.º 13
0
        public PizzaMenuApiModel()
        {
            Sizes.Add(new Size {
                Name = "Small", Price = 8d
            });
            Sizes.Add(new Size {
                Name = "Medium", Price = 10d
            });
            Sizes.Add(new Size {
                Name = "Large", Price = 12d
            });
            Sizes.Add(new Size {
                Name = "Extra-Large", Price = 15d
            });

            Crusts.Add(new Crust {
                Name = "Cracker", Price = 0d
            });
            Crusts.Add(new Crust {
                Name = "New York", Price = .50d
            });
            Crusts.Add(new Crust {
                Name = "Chicago", Price = .75d
            });

            Ingredients.Add(new Ingredient {
                Name = "Tomato Sauce", Price = 0d
            });
            Ingredients.Add(new Ingredient {
                Name = "Cheese", Price = 0d
            });
            Ingredients.Add(new Ingredient {
                Name = "Sausage", Price = .5d
            });
            Ingredients.Add(new Ingredient {
                Name = "Pepperoni", Price = .5d
            });
            Ingredients.Add(new Ingredient {
                Name = "Anchovies", Price = 1.25d
            });
            Ingredients.Add(new Ingredient {
                Name = "Pineapple", Price = .75d
            });
            Ingredients.Add(new Ingredient {
                Name = "Peppers", Price = .25d
            });
        }
            public SoundRawChunk(CacheBase Cache, int Offset)
            {
                EndianReader Reader = Cache.Reader;

                Reader.SeekTo(Offset);

                RawSize = Reader.ReadInt32();

                #region Size Chunk
                int iCount  = Reader.ReadInt32();
                int iOffset = Reader.ReadInt32() - Cache.Magic;
                for (int i = 0; i < iCount; i++)
                {
                    Sizes.Add(new Size(Cache, iOffset + 16 * i));
                }
                Reader.SeekTo(Offset + 16);
                #endregion
            }
        public NewAnimalViewModel()
        {
            AnimalData animalData = AnimalData.GetInstance();

            foreach (Size field in animalData.Sizes.ToList())
            {
                Sizes.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (Origin field in animalData.Origins.ToList())
            {
                Origins.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (Kind field in animalData.Kinds.ToList())
            {
                Kinds.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (Eat field in animalData.Eats.ToList())
            {
                Eats.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            // TODO #4 - populate the other List<SelectListItem>
            // collections needed in the view
        }
Exemplo n.º 16
0
        public new PixelFontSize AddFontSize(string path, Atlas atlas = null, bool outline = false)
        {
            Logger.Log("PixelFont", $"Loading font: {path}");

            PixelFontSize loadedSize = null;

            // load the vanilla font if it exists.
            if (patch_Calc.orig_XMLExists(path))
            {
                Logger.Log("PixelFont", "=> vanilla font file");
                XmlElement data = patch_Calc.orig_LoadXML(path)["font"];
                loadedSize = AddFontSize(path, data, atlas, outline);
                Sizes.Remove(loadedSize);
            }

            // load custom fonts
            string modPath = FileProxy._Modize(path);

            foreach (ModAsset modAsset in Everest.Content.Mods
                     .Select(mod => mod.Map)
                     .Where(map => map.ContainsKey(modPath))
                     .Select(map => map[modPath]))
            {
                Logger.Log("PixelFont", $"=> mod font file from {modAsset.Source.Name}");
                XmlElement    data        = loadXMLFromModAsset(modAsset)["font"];
                PixelFontSize newFontSize = AddFontSize(path, data, atlas, outline);
                Sizes.Remove(newFontSize);
                loadedSize = mergeFonts(loadedSize, newFontSize);
            }

            // add the merged font into the list of existing fonts.
            Sizes.Add(loadedSize);
            Sizes.Sort((PixelFontSize a, PixelFontSize b) => Math.Sign(a.Size - b.Size));

            return(loadedSize);
        }
Exemplo n.º 17
0
 public virtual void AddSize(Size size)
 {
     Sizes.Add(size);
     size.Product = this;
     DomainEvent.Raise(new SizeCreatedEvent(UrlName, size.Name, size.IsActive));
 }
Exemplo n.º 18
0
        public BinaryFormat Convert(FAD source)
        {
            source.Containers.Clear();
            //Updating files
            foreach (var child in Navigator.IterateNodes(Container))
            {
                byte[] temp = new byte[(int)child.Stream.Length];
                child.Stream.Read(temp, 0, (int)child.Stream.Length);
                source.Containers.Add(temp);
            }

            //Generate the exported file
            var writer = new DataWriter(Binary.Stream);

            //Write the header
            writer.Write(source.Header);

            //Write the files
            for (int i = 0; i < source.ImagesCount; i++)
            {
                //Add the position
                Positions.Add((uint)writer.Stream.Position);

                //Write the file header
                writer.Write(source.ContainerHeaders[i]);
                writer.Stream.PushCurrentPosition();

                //Write the file
                writer.Write(source.Containers[i]);
                writer.WritePadding(0, 0x10);
                Sizes.Add((uint)writer.Stream.Position - Positions[i]);



                //Updating values

                writer.Stream.PopPosition();
                writer.Stream.Position -= 0x28;
                writer.Write(Sizes[i]);
                writer.Stream.Position += 0x04;
                writer.Write(source.Containers[i].Length);
                writer.Stream.Position += (Sizes[i] - 0x14);
            }

            //Updating Header Values
            writer.Stream.Position = (0x20 * source.AnotherFilesCount) + 0x14 + 0xC;
            for (int i = 0; i < source.ImagesCount; i++)
            {
                //Skip the padding
                writer.Stream.Position += 8;

                //Write the size
                writer.Write(Sizes[i]);

                //Skip the padding
                writer.Stream.Position += 4;

                //Write the position
                writer.Write(Positions[i]);

                //Skip the padding
                writer.Stream.Position += 0xC;
            }

            return(Binary);
        }
Exemplo n.º 19
0
 public void AddSizes(string item)
 {
     Sizes.Add(item);
 }
Exemplo n.º 20
0
        private void EditRow()
        {
            var tmp = new SMLRowEditor
            {
                LayoutRoot =
                {
                    DataContext        = new SmlRowEditorViewModel
                    {
                        ColorCode    = ColorCode,
                        StyleCode    = StyleCode,
                        Description  = Description,
                        DeliveryDate = DeliveryDate,
                        SizeRange    = SizeRange,
                        Qty          = Qty,
                        SeasonCode   = SeasonCode,
                        BrandCode    = BrandCode,
                        //Seasons = new List<TblLkpSeason>(ParentObj.Seasons),
                        Brands         = new List <Brand>(ParentObj.Brands),
                        StatusList     = new List <GenericViewModel>(ParentObj.StatusList),
                        StatusSerial   = StatusSerial,
                        SelectedStatus = SelectedStatus
                    }
                }
            };

            tmp.InitiateCustomeEvents();
            tmp.Submit += (s, e) =>
            {
                var vm = (tmp.LayoutRoot.DataContext as SmlRowEditorViewModel);
                if (vm == null)
                {
                    return;
                }
                StyleCode      = vm.StyleCode;
                ColorCode      = vm.ColorCode;
                StyleCode      = vm.StyleCode;
                Description    = vm.Description;
                DeliveryDate   = vm.DeliveryDate;
                SizeRange      = vm.SizeRange;
                Qty            = vm.Qty;
                SeasonCode     = vm.SeasonCode;
                BrandCode      = vm.BrandCode;
                SelectedStatus = vm.SelectedStatus;
                if (!Sizes.Any())
                {
                    if (vm.SizeRangeWithSizes != null)
                    {
                        var sze = (from x in vm.SizeRangeWithSizes
                                   select x.SizeCode).Distinct()
                                  .Select(x => new SmlSizeDetails
                        {
                            ParentObject = this,
                            ParentSerial = Iserial,
                            SizeCode     = x
                        }).ToList();
                        foreach (var item in sze)
                        {
                            Sizes.Add(item);
                        }
                    }
                }

                // if (ObjStatus.IsNew)
                //Client.UpdateOrInsertTblSmlAsync(new tblSeasonalMasterList
                //    {
                //        BrandCode = BrandCode,
                //        ColorCode = ColorCode,
                //        CreationDate = DateTime.Now,
                //        DelivaryDate = DeliveryDate,
                //        Description = Description,
                //        SeasonCode = SeasonCode,
                //        SizeRange = SizeRange,
                //        StyleCode = StyleCode,
                //        Qty = Qty,
                //        StatusID = SelectedStatus.Iserial
                //    }, true, 0);
                //    else if (ObjStatus.IsSavedDBItem)
                //        Client.UpdateOrInsertTblSmlAsync(new tblSeasonalMasterList
                //        {
                //            Iserial = Iserial,
                //            BrandCode = BrandCode,
                //            ColorCode = ColorCode,
                //            CreationDate = CraetionDate,
                //            DelivaryDate = DeliveryDate,
                //            Description = Description,
                //            SeasonCode = SeasonCode,
                //            SizeRange = SizeRange,
                //            StyleCode = StyleCode,
                //            Qty = Qty,
                //            StatusID = SelectedStatus.Iserial
                //        }, false, 0);
                //};
                //tmp.Show();
            };
        }