Пример #1
0
        public virtual void SetObjectData()
        {
            int persistedClassVersion = info.GetInt32("ClassPersistenceVersionFlowsheet");

            this.evapAndDryingSystem = (EvaporationAndDryingSystem)Storable.RecallStorableObject(info, context, "EvaporationAndDryingSystem", typeof(EvaporationAndDryingSystem));
            //this.appPrefs = (ApplicationPreferences)Storable.RecallStorableObject(info, context, "ApplicationPreferences", typeof(ApplicationPreferences));
            this.customEditor = (ProsimoUI.CustomEditor.CustomEditor)Storable.RecallStorableObject(info, context, "CustomEditor", typeof(ProsimoUI.CustomEditor.CustomEditor));
            //this.connectionManager = (ConnectionManager)Storable.RecallStorableObject(info, context, "ConnectionManager", typeof(ConnectionManager));
            ArrayList connections = info.GetValue("Connections", typeof(ArrayList)) as ArrayList;

            if (connections != null)
            {
                foreach (SolvableConnection sc in connections)
                {
                    sc.SetObjectData();
                }
            }
            this.flowsheetPrefs = (FlowsheetPreferences)Storable.RecallStorableObject(info, context, "FlowsheetPrefs", typeof(FlowsheetPreferences));

            ArrayList persistedControls = info.GetValue("PersistedControls", typeof(ArrayList)) as ArrayList;

            RestoreSolvableControls(persistedControls, connections);
            InitializeComponent();
            Init();

            if (persistedClassVersion <= 1)
            {
                RecallInitialization();
            }
        }
Пример #2
0
        public static Substance RecallSubstance(SerializationInfo info)
        {
            bool      isComposite = (bool)info.GetValue("IsCompositeSubstance", typeof(bool));
            Substance s;

            if (isComposite)
            {
                s = Storable.RecallStorableObject(info, "Substance", typeof(CompositeSubstance)) as CompositeSubstance;
            }
            else
            {
                s = Substance.RecallSubstance(info, "SubstanceName");
            }
            return(s);
        }
Пример #3
0
        //public virtual void SetObjectData(SerializationInfo info, StreamingContext context) {
        public virtual void SetObjectData()
        {
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionSolvableConnection", typeof(int));

            this.streamPoint = (ConnectionPoint)Storable.RecallStorableObject(info, context, "StreamPoint", typeof(ConnectionPoint));
            //this.streamPoint.SetObjectData(this.streamPoint.SerializationInfo, this.streamPoint.StreamingContext);
            //this.unitOpPoint.SetObjectData(this.unitOpPoint.SerializationInfo, this.unitOpPoint.StreamingContext);
            this.unitOpPoint = (ConnectionPoint)Storable.RecallStorableObject(info, context, "UnitOpPoint", typeof(ConnectionPoint));
            if (persistedClassVersion == 1)
            {
                StreamType st = (StreamType)info.GetValue("StreamType", typeof(StreamType));
                this.streamType = GetObjectType(st);
            }
            if (persistedClassVersion >= 2)
            {
                this.streamType = (Type)info.GetValue("StreamType", typeof(Type));
                this.flowsheet  = (Flowsheet)info.GetValue("Flowsheet", typeof(Flowsheet));
            }
        }