示例#1
0
        private void SerializeDynamicObject(IDynamicMetaObjectProvider dynamicObject, bool startEle)
        {
            var flag = new AssertFlag();

            var dymgr = new DynamicManager();

            if (startEle)
            {
                xmlWriter.WriteStartElement("Dynamic");
            }

            foreach (var name in dynamicObject.GetDynamicMemberNames())
            {
                object value;
                dymgr.TryGetMember(dynamicObject, name, out value);
                if (value == null)
                {
                    continue;
                }

                xmlWriter.WriteStartElement(name);
                Serialize(value);
                xmlWriter.WriteEndElement();
            }

            if (startEle)
            {
                xmlWriter.WriteEndElement();
            }
        }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        if (!(audioSource is null))
        {
            if (player is null)
            {
                player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
            }
            if (player.isSoulTime && soul)
            {
                audioSource.mute = false;
            }
            else if (!player.isSoulTime && !soul)
            {
                audioSource.mute = false;
            }
            else
            {
                audioSource.mute = true;
            }

            if (SceneManager.GetActiveScene().name == "Title")
            {
                instance1 = null;
                instance2 = null;
                Destroy(audioSource);
                Destroy(this);
            }
        }
    }
 public ProcessRemindHandlerBase(ProcessInstanceCacheFactory cache, SysProcessInstance pi, SysActivityInstance ai, UseTimeType useTime, SysWorkItem wi = null, int?result = new int?())
 {
     this.creator         = new RemindTemplateModelCreator(cache, pi, ai, useTime, wi, result);
     this._piCacheFactory = cache;
     this._context        = cache.Context;
     this._manager        = cache.Manager;
     this.InitRemindList();
 }
示例#4
0
        /**
         * @ 查询数据集,该方法仅支持对单表进行封装,泛型方法第一次重载
         * @ reader
         * */
        public List <T> GetDataResult <T>(DbDataReader reader) where T : class, new()
        {
            List <T> dataList = new List <T>();

            if (reader == null)
            {
                return(null);
            }

            try
            {
                DynamicManager <T> dm = new DynamicManager <T>();
                dm.InitDynamicObject(reader);
                do
                {
                    T returnObj = dm.CreateObject(reader);
                    dataList.Add(returnObj);
                } while (reader.Read());

                /*
                 * Type type = typeof(T);
                 * if (TableName.IsNullOrEmpty())
                 * {
                 *  TableName = type.Name;
                 * }
                 *
                 * int len = fields.Count();
                 * List<string> queryName = new List<string>();
                 * for (int i = 0; i < len; i++)
                 * {
                 *  queryName.Add(reader.GetName(i).ToLower());
                 * }
                 * PropertyInfo[] pis = type.GetProperties();
                 * do
                 * {
                 *  T result = new T();
                 *  for (int i = 0; i < pis.Length; i++)
                 *  {
                 *      PropertyInfo pi = pis[i];
                 *      if (queryName.Contains<string>(pi.Name.ToLower()) == false)
                 *          continue;
                 *      object rValue = reader[pi.Name];
                 *      if (rValue != null)
                 *          pi.SetValue(result, rValue, null);
                 *  }
                 *  dataList.Add(result);
                 * } while (Context.DbReader.Read());
                 * */
            }
            finally
            {
                Dispose(false);
            }
            return(dataList);
        }
示例#5
0
        private void SerializeDynamicObject(IDynamicMetaObjectProvider dynamicObject, bool startEle)
        {
            var flag = new AssertFlag();

            var dymgr = new DynamicManager();

            if (startEle)
            {
                xmlWriter.WriteStartElement("Dynamic");
            }

            var queue = new PriorityActionQueue();

            foreach (var name in dynamicObject.GetDynamicMemberNames())
            {
                object value;
                dymgr.TryGetMember(dynamicObject, name, out value);
                if (value == null)
                {
                    continue;
                }

                if (option.NodeStyle == XmlNodeStyle.Attribute && value.GetType().IsStringable())
                {
                    queue.Add(0, () =>
                    {
                        context.SerializeInfo = new PropertySerialzeInfo(ObjectType.DynamicObject, typeof(object), name);
                        xmlWriter.WriteAttributeString(name, value.ToString());
                        context.SerializeInfo = null;
                    });
                }
                else
                {
                    queue.Add(1, () =>
                    {
                        context.SerializeInfo = new PropertySerialzeInfo(ObjectType.DynamicObject, typeof(object), name);
                        WriteXmlElement(name, true, () => Serialize(value, type: value.GetType()));
                        context.SerializeInfo = null;
                    });
                }
            }

            queue.Invoke();

            if (startEle)
            {
                xmlWriter.WriteEndElement();
            }
        }
            private void GazeCore_OnDynamicGazeRecord(double timestamp, string objectid, Vector3 localgazepoint, Vector3 hmdpoint, Quaternion hmdrotation)
            {
                float durationMs = CognitiveVR_Preferences.S_SnapshotInterval * 1000;

                if (DynamicFocusTimes.ContainsKey(objectid))
                {
                    //update this key
                    var display = DynamicFocusTimes[objectid];
                    display.Time += durationMs;
                    DynamicFocusTimes[objectid] = display;
                }
                else
                {
                    //add new key to dictionary
                    string name;
                    if (DynamicManager.GetDynamicObjectName(objectid, out name))
                    {
                        DynamicFocusTimes.Add(objectid, new DynamicObjectDisplay(name, durationMs));
                    }
                }
            }
            private void FixationCore_OnFixationRecord(Fixation fixation)
            {
                if (!fixation.IsLocal)
                {
                    return;
                }

                if (DynamicFocusTimes.ContainsKey(fixation.DynamicObjectId))
                {
                    //update this key
                    var display = DynamicFocusTimes[fixation.DynamicObjectId];
                    display.Time += fixation.DurationMs;
                    DynamicFocusTimes[fixation.DynamicObjectId] = display;
                }
                else
                {
                    //add new key to dictionary
                    string name;
                    if (DynamicManager.GetDynamicObjectName(fixation.DynamicObjectId, out name))
                    {
                        DynamicFocusTimes.Add(fixation.DynamicObjectId, new DynamicObjectDisplay(name, fixation.DurationMs));
                    }
                }
            }
示例#8
0
    // Start is called before the first frame update
    private void Awake()
    {
        if (instance1 is null)
        {
            instance1 = this;
            DontDestroyOnLoad(audioSource);
        }
        else if (instance2 is null)
        {
            instance2 = this;
            DontDestroyOnLoad(audioSource);
        }
        else if (instance1 != this && instance2 != this)
        {
            Destroy(audioSource);
        }

        if (SceneManager.GetActiveScene().name == "Title")
        {
            instance1 = null;
            instance2 = null;
            Destroy(audioSource);
        }
    }
 public ProcessInstanceCacheFactory(DataContext ctx)
 {
     this._context      = ctx;
     this._processCache = new ProcessCacheFactory(ctx);
     this._manager      = new DynamicManager(ctx);
 }
示例#10
0
 internal PythonFunc(DataContext ctx) : base(ctx)
 {
     this._manager = new DynamicManager(ctx);
 }
示例#11
0
 public EntityCache(DynamicManager dm)
 {
     this._manager = dm;
 }