コード例 #1
0
 private void ForwardReleaseComplete()
 {
     _releaseProgress = 0f;
     _fillingType     = FillingType.FORWARD;
     gauge.fillOrigin = _direction == Direction.LEFT ? (int)FillOrigin.LEFT : (int)FillOrigin.RIGHT;
     _isReleased      = false;
 }
コード例 #2
0
ファイル: FillingModel.cs プロジェクト: alibghz/urcie
 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));
 }
コード例 #3
0
        /// <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}");
        }
コード例 #4
0
ファイル: Filling.cs プロジェクト: alibghz/urcie
        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;
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
ファイル: ModelViewModelHelper.cs プロジェクト: alibghz/urcie
        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);
        }
コード例 #7
0
        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;
        }
コード例 #8
0
ファイル: GlazedCandy.cs プロジェクト: SprayGOD/exercises
 public GlazedCandy(FillingType filling, ManufacturerType manufacturer, int weight, int sugar) :
     base(manufacturer, weight, sugar)
 {
     Filling = filling;
 }
コード例 #9
0
 public FillingTypeViewModel(FillingType fillingType)
 {
     Original = fillingType;
     Restore();
 }
コード例 #10
0
ファイル: MPDLL.cs プロジェクト: Groxan/RepVol
        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;
        }
コード例 #11
0
 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;
 }
コード例 #12
0
 private void BackwardReleaseComplete()
 {
     _releaseProgress += 1f;
     _fillingType      = FillingType.FORWARD;
     gauge.fillOrigin  = _direction == Direction.LEFT ? (int)FillOrigin.LEFT : (int)FillOrigin.RIGHT;
 }