Esempio n. 1
0
        internal Shell(Surface surface, ShellProp shellprop)
        {
            BaseS     = surface;
            shellProp = shellprop;
            this.Type = Structure.Type.Shell;

            //register for cache
            ID = TracedShellManager.GetNextUnusedID();
            TracedShellManager.RegisterShellforID(ID, this);
        }
Esempio n. 2
0
        public static Shell FromSurface(Surface Surface, ShellProp ShellProp)
        {
            // TODO: IsPlanar logic should be added here! HANDLETHE ERROR.
            Shell   tShell;
            ShellID tShellid = null;
            //TraceUtils.GetTraceData(TRACE_ID) as ShellID;

            Dictionary <string, ISerializable> getObjs = ProtoCore.Lang.TraceUtils.GetObjectFromTLS();

            foreach (var k in getObjs.Keys)
            {
                tShellid = getObjs[k] as ShellID;
            }

            if (tShellid == null)
            {
                // trace cache log didnoy return an objec, create new one !
                tShell = new Shell(Surface, ShellProp);
                // Set Label
                tShell.Label = String.Format("dyn_{0}", tShell.ID.ToString());
            }
            else
            {
                tShell = TracedShellManager.GetShellbyID(tShellid.IntID);

                tShell.BaseS     = Surface;
                tShell.shellProp = ShellProp;
            }

            // Set the trace data on the return to be this Shell
            //TraceUtils.SetTraceData(TRACE_ID, new ShellID { IntID = tShell.ID });
            Dictionary <string, ISerializable> objs = new Dictionary <string, ISerializable>();

            objs.Add(TRACE_ID, new ShellID {
                IntID = tShell.ID
            });
            ProtoCore.Lang.TraceUtils.SetObjectToTLS(objs);

            return(tShell);
        }