Exemplo n.º 1
0
        /// <summary>
        /// Note that x is a dummy var here that is intended to force replicated dispatch
        /// it's not actually used
        /// </summary>
        /// <param name="x">Dummy var used to force replicated dispatch</param>
        /// <param name="failWithException">Fail dispatch with an exception rather than </param>
        public IncrementerTracedClass(int x, bool failWithException)
        {
            if (failWithException)
            {
                throw new ArgumentException("Failure requested");
            }

            var retVal = TraceUtils.GetTraceData(__TEMP_REVIT_TRACE_ID);

            if (retVal != null)
            {
                wasTraced = true;

                IDHolder idHolder = (IDHolder)retVal;
                ID = idHolder.ID;
            }
            else
            {
                nextID++;
                ID = nextID;
                TraceUtils.SetTraceData(__TEMP_REVIT_TRACE_ID, new IDHolder()
                {
                    ID = nextID
                });
            }
        }
Exemplo n.º 2
0
        public WrapperObject(int x)
        {
            WrapperGuid = Guid.NewGuid();

            var traceVal = TraceUtils.GetTraceData(__TEMP_REVIT_TRACE_ID);

            if (traceVal != null)
            {
                IDHolder idHolder = (IDHolder)traceVal;
                ID = idHolder.ID;
            }
            else
            {
                nextID++;
                ID = nextID;
                TraceUtils.SetTraceData(__TEMP_REVIT_TRACE_ID, new IDHolder()
                {
                    ID = nextID
                });
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Note that x is a dummy var here that is intended to force replicated dispatch
        /// it's not actually used
        /// </summary>
        /// <param name="x"></param>
        public IncrementerTracedClass(int x)
        {
            var retVal = TraceUtils.GetTraceData(__TEMP_REVIT_TRACE_ID);

            if (retVal != null)
            {
                wasTraced = true;

                IDHolder idHolder = (IDHolder)retVal;
                ID = idHolder.ID;
            }
            else
            {
                nextID++;
                ID = nextID;
                TraceUtils.SetTraceData(__TEMP_REVIT_TRACE_ID, new IDHolder()
                {
                    ID = nextID
                });
            }
        }