private void ForwardReleaseComplete() { _releaseProgress = 0f; _fillingType = FillingType.FORWARD; gauge.fillOrigin = _direction == Direction.LEFT ? (int)FillOrigin.LEFT : (int)FillOrigin.RIGHT; _isReleased = false; }
public FillingModel(SerializationInfo info, StreamingContext context) : base(info, context) { code = (string)info.GetValue("Code", typeof(string)); fillingType = (FillingType)info.GetValue("FillingType", typeof(FillingType)); profileType = (ProfileType)info.GetValue("ProfileType", typeof(ProfileType)); parent = (Surface)info.GetValue("SurfaceParent", typeof(Surface)); }
/// <inheritdoc /> public string Fill(int data, int fillLength, string character = "0", FillingType fillingType = FillingType.Left) { if (character.Length > 1 || string.IsNullOrEmpty(character)) { throw new ArgumentException(Literals.b_FillingCharacterLengthMustBeOne, nameof(character)); } int numberOfCharactersToFill = fillLength - data.ToString().Length; string fillString = numberOfCharactersToFill > 0 ? new string(char.Parse(character), numberOfCharactersToFill) : string.Empty; return(fillingType == FillingType.Left ? $"{fillString}{data}" : $"{data}{fillString}"); }
public Filling(Surface surfaceParent, FillingType fillingType, ProfileType profileType) : base() { if (surfaceParent.ChildrenCount > 0) { throw new ArgumentException("Invalid surface parent provided."); } Model = new FillingModel(); Model.PropertyChanged += Model_PropertyChanged; Model.SurfaceParent = surfaceParent; Model.FillingType = fillingType; Model.ProfileType = profileType; BoundsChanged += Filling_BoundsChanged; }
private void SelectedFillingType_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!FillingSelected) { return; } FillingType fillingType = SelectedFillingType.SelectedItem as FillingType; Filling filling = SelectionEventHandler.SelectedNode as Filling; if (filling == null) { return; } if (!filling.Model.FillingType.Equals(fillingType)) { filling.Model.FillingType = fillingType; filling.Repaint(); } }
public static FillingType ToModel(this FillingTypeViewModel fillingTypeViewModel) { if (fillingTypeViewModel == null) { throw new ArgumentNullException("fillingTypeViewModel"); } FillingType fillingType = new FillingType(); fillingType.Id = fillingTypeViewModel.Id; fillingType.Glass = fillingTypeViewModel.Glass; fillingType.Name = fillingTypeViewModel.Name; fillingType.Description = fillingTypeViewModel.Description; fillingType.Width = fillingTypeViewModel.Width; fillingType.Height = fillingTypeViewModel.Height; fillingType.Weight = fillingTypeViewModel.Weight; fillingType.Tolerance = fillingTypeViewModel.Tolerance; fillingType.Price = fillingTypeViewModel.Price; return(fillingType); }
public override void Restore() { FillingType original = Original as FillingType; if (original == null) { throw new InvalidOperationException( "View model does not have an original value."); } Id = original.Id; Name = original.Name; Glass = original.Glass; Width = original.Width; Height = original.Height; Weight = original.Weight; Price = original.Price; Tolerance = original.Tolerance; Description = original.Description; }
public GlazedCandy(FillingType filling, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { Filling = filling; }
public FillingTypeViewModel(FillingType fillingType) { Original = fillingType; Restore(); }
public long OrderSend(Instrument instr, OrderType type, FillingType fill, int volume, string price, string expiration = "", string comment = "", int magic = 0) { Message sendMessage = pub.NewMessage(MessageKeyType.KeyName, "FutAddOrder"); SchemeFortsMsg.FutAddOrder msg = new SchemeFortsMsg.FutAddOrder(sendMessage.Data); (sendMessage as DataMessage).UserId = 0; msg.client_code = "RTY"; msg.isin = instr.ShortName; msg.type = (int)fill; msg.dir = (int)type; msg.amount = volume; msg.price = price; msg.date_exp = expiration; msg.comment = comment; msg.ext_id = magic; Execution = true; pub.Post(sendMessage, PublishFlag.NeedReply); sendMessage.Dispose(); while (Execution) Thread.Sleep(1); return Ticket; }
public override void OnClick() { _fillingType = _fillingType == FillingType.FORWARD ? FillingType.BACKWARD : FillingType.FORWARD; gauge.fillOrigin = gauge.fillOrigin == (int)FillOrigin.LEFT ? (int)FillOrigin.RIGHT : (int)FillOrigin.LEFT; }
private void BackwardReleaseComplete() { _releaseProgress += 1f; _fillingType = FillingType.FORWARD; gauge.fillOrigin = _direction == Direction.LEFT ? (int)FillOrigin.LEFT : (int)FillOrigin.RIGHT; }