Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new PipReferences from a pip
        /// </summary>
        public static PipReference FromPip(Pip pip)
        {
            Contract.Requires(pip != null);

            var visualizationInformation = EngineModel.VisualizationInformation;
            var context   = visualizationInformation.Context.Value;
            var scheduler = visualizationInformation.Scheduler.Value;

            return(new PipReference()
            {
                Id = PipGraph.GetUInt32FromPip(pip),
                Hash = pip.SemiStableHash.ToString("X16", CultureInfo.InvariantCulture),
                Description = pip.GetDescription(context),
                State = scheduler.GetPipState(pip.PipId),
            });
        }