Пример #1
0
        public object Clone()
        {
            var cube = (Cube)MemberwiseClone();

            cube.Origin = (float[])Origin?.Clone();
            cube.Size   = (float[])Size?.Clone();
            cube.Uv     = (float[])Uv?.Clone();

            return(cube);
        }
Пример #2
0
            public MarketDataMessage InitNext()
            {
                if (LastIteration)
                {
                    throw new InvalidOperationException("LastIteration == true");
                }

                var mdMsg = (MarketDataMessage)Origin.Clone();

                if (_firstIteration)
                {
                    _firstIteration = false;

                    _nextFrom = _currFrom + _step;

                    if (_nextFrom > _maxFrom)
                    {
                        _nextFrom = _maxFrom;
                    }

                    mdMsg.TransactionId = _adapter.TransactionIdGenerator.GetNextId();
                    mdMsg.From          = _currFrom;
                    mdMsg.To            = _nextFrom;

                    CurrTransId = mdMsg.TransactionId;
                }
                else
                {
                    _iterationInterval.Sleep();

                    if (Origin.To == null && _nextFrom >= _maxFrom)
                    {
                        // on-line
                        mdMsg.From = null;
                    }
                    else
                    {
                        _currFrom  = _nextFrom;
                        _nextFrom += _step;

                        if (_nextFrom > _maxFrom)
                        {
                            _nextFrom = _maxFrom;
                        }

                        mdMsg.TransactionId = _adapter.TransactionIdGenerator.GetNextId();
                        mdMsg.From          = _currFrom;
                        mdMsg.To            = _nextFrom;

                        CurrTransId = mdMsg.TransactionId;
                    }
                }

                return(mdMsg);
            }
Пример #3
0
 public Entity Clone() => new Entity()
 {
     Number     = Number,
     Parent     = Parent,
     Angles     = Angles.Clone(),
     Colormap   = Colormap,
     Effects    = Effects,
     Frame      = Frame,
     ModelIndex = ModelIndex,
     Origin     = Origin.Clone(),
     Skin       = Skin,
 };
 public EntityConfiguration Clone()
 {
     return(new EntityConfiguration
     {
         TextureKey = TextureKey,
         EntityType = EntityType,
         Health = Health,
         Mana = Mana,
         Lifetime = Lifetime,
         DimensionRange = DimensionRange?.Clone(),
         Dimensions = Dimensions?.Clone(),
         Origin = Origin?.Clone(),
         Components = Components?.ToList(),
         CollideFilter = CollideFilter,
         CollideWithFilters = CollideWithFilters?.ToList()
     });
 }
Пример #5
0
        private void ProgressForm_Activated(object sender, EventArgs e)
        {
            var handler = new ProgressEventHandler.ProgressHandler(genData2_OnProgress);

            try
            {
                if (!IsProcessing)
                {
                    this.Refresh();
                    IsProcessing = false;
                    OriginGenerator.OnProgress      += new ProgressEventHandler.ProgressHandler(genData1_OnProgress);
                    DestinationGenerator.OnProgress += handler;

                    this.ErrorLocation            = "Loading " + destinationProgressControl.DatabaseName;
                    Origin                        = OriginGenerator.Process();
                    originProgressControl.Message = "Complete";
                    originProgressControl.Value   = OriginGenerator.GetMaxValue();

                    this.ErrorLocation = "Loading " + originProgressControl.DatabaseName;
                    Destination        = DestinationGenerator.Process();

                    originClone = (Schema.Model.IDatabase)Origin.Clone(null);

                    this.ErrorLocation = "Comparing Databases";
                    Destination        = Comparer.Compare(Origin, Destination);
                    Origin             = originClone;

                    destinationProgressControl.Message = "Complete";
                    destinationProgressControl.Value   = DestinationGenerator.GetMaxValue();
                }
            }
            catch (Exception err)
            {
                this.Error = err;
            }
            finally
            {
                OriginGenerator.OnProgress      -= handler;
                DestinationGenerator.OnProgress -= handler;
                this.Dispose();
            }
        }
Пример #6
0
 public Rectangle Clone()
 {
     return(new Rectangle(Origin.Clone(), Size.Clone()));
 }
 public void Apply(Origin Origin)
 {
     for (var i = 0; i < Frames.Length; i++) Frames[i].Origin = Origin.Clone();
 }
            public MarketDataMessage InitNext()
            {
                if (LastIteration)
                {
                    throw new InvalidOperationException("LastIteration == true");
                }

                if (_firstIteration)
                {
                    _firstIteration = false;

                    var mdMsg = (MarketDataMessage)Origin.Clone();
                    mdMsg.TransactionId = _adapter.TransactionIdGenerator.GetNextId();
                    mdMsg.From          = _currFrom;
                    mdMsg.To            = _currFrom + _step;

                    CurrTransId = mdMsg.TransactionId;
                    _nextFrom   = mdMsg.To.Value;

                    if (Origin.To == null)
                    {
                        LastIteration = _nextFrom > DateTimeOffset.Now;
                    }
                    else
                    {
                        LastIteration = _nextFrom >= Origin.To.Value;
                    }

                    return(mdMsg);
                }
                else
                {
                    _iterationInterval.Sleep();

                    _currFrom  = _nextFrom;
                    _nextFrom += _step;

                    if (Origin.To == null)
                    {
                        LastIteration = _nextFrom > DateTimeOffset.Now;
                    }
                    else
                    {
                        LastIteration = _nextFrom >= Origin.To.Value;
                    }

                    if (LastIteration)
                    {
                        var mdMsg = (MarketDataMessage)Origin.Clone();
                        mdMsg.From = _currFrom;
                        return(mdMsg);
                    }
                    else
                    {
                        var mdMsg = (MarketDataMessage)Origin.Clone();
                        mdMsg.TransactionId = _adapter.TransactionIdGenerator.GetNextId();
                        mdMsg.From          = _currFrom;
                        mdMsg.To            = _nextFrom;

                        CurrTransId = mdMsg.TransactionId;

                        return(mdMsg);
                    }
                }
            }