Beispiel #1
0
        protected void RemoveInstanceCore <TInstance>(string extName)
        {
            var cell = StateCells.FirstOrDefault(p => p.InstanceType == typeof(TInstance) && p.ExtName == extName);

            if (cell != null)
            {
                StateCells.Remove(cell);
            }
        }
Beispiel #2
0
        protected void SetInstanceCore <TInstance>(TInstance instance, string extName)
        {
            var cell = StateCells.FirstOrDefault(p => p.InstanceType == typeof(TInstance) && p.ExtName == extName);

            if (cell != null)
            {
                cell.Instance = instance;
            }
            else
            {
                StateCells.Add(new InstanceCell(typeof(TInstance))
                {
                    Instance = instance,
                    ExtName  = extName
                });
            }
        }