コード例 #1
0
        public void CreateItem(string xtPath, string name)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.CreateItem(name);
            }
        }
コード例 #2
0
        public void MoveBack(string xtPath)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.MoveBack();
            }
        }
コード例 #3
0
        public void Assign(string xtPath, string propertyName, object value, object[] indexer)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.Assign(propertyName, value, indexer);
            }
        }
コード例 #4
0
        public void RemoveItemByName(string xtPath, string name)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.RemoveItemByName(name);
            }
        }
コード例 #5
0
        public void RemoveAll(string xtPath)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.RemoveAll();
            }
        }
コード例 #6
0
        public void RemoveItem(string xtPath, object indexer)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.RemoveItem(indexer);
            }
        }
コード例 #7
0
        public void SetCurrebtIndexer(string xtPath, object indexer)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.SetCurrebtIndexer(indexer);
            }
        }
コード例 #8
0
        public void Invoke(string xtPath, string methodName, object[] ps)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.Invoke(methodName, ps);
            }
        }
コード例 #9
0
        public virtual void RemoveEventHandler(string xtPath, string eventName, object methodOwner, string methodName)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.RemoveEventHandler(eventName, methodOwner, methodName);
            }
        }
コード例 #10
0
        public object ItemByName(string xtPath, string name)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                return(rais.Item(name));
            }
            return(null);
        }
コード例 #11
0
        public object NewItem(string xtPath)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                return(rais.NewItem());
            }
            return(null);
        }
コード例 #12
0
        public object CurrentIndexer(string xtPath)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                return(rais.CurrentIndexer());
            }
            return(null);
        }
コード例 #13
0
        public object Item(string xtPath, object indexer)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                return(rais.Item(indexer));
            }
            return(null);
        }
コード例 #14
0
        public int ItemCount(string xtPath)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                return(rais.itemCount);
            }
            return(0);
        }
コード例 #15
0
        public virtual bool WorkOnAllInstances(string xtPath, delegateOnGetInstance handler, object data)
        {
            RAIS rais = this.GetItemByXTPath(xtPath);

            if (rais != null)
            {
                rais.WorkOnAllInstances(handler, data);
                return(true);
            }
            return(false);
        }
コード例 #16
0
        /// <summary>
        /// find the RAIS object by the specified path.
        /// </summary>
        /// <param name="xtPath">path format: ?name/?name/...
        /// ? is one of R, A, I, S
        /// </param>
        /// <returns></returns>
        public RAIS GetItemByXTPath(string xtPath)
        {
            RAIS   rais = this.Root;
            string s    = xtPath;

            while (!string.IsNullOrEmpty(s))
            {
                string name = VPLUtil.PopPath(ref s);
                //get one name in the format ?<name>
                rais = rais.GetSubClass(name);
            }
            return(rais);
        }
コード例 #17
0
        protected virtual RAIS GetSubClass(string name)
        {
            RAIS   rais  = null;
            string sType = name.Substring(0, 1);
            string s     = name.Substring(1);

            if (sType == XML_A)
            {
                rais = AItem(s);
            }
            else if (sType == XML_R)
            {
                rais = RItem(s);
            }
            return(rais);
        }
コード例 #18
0
        protected override RAIS GetSubClass(string name)
        {
            RAIS rais = base.GetSubClass(name);

            if (rais == null)
            {
                string sType = name.Substring(0, 1);
                string s     = name.Substring(1);
                if (sType == RAIS.XML_I)
                {
                    rais = IItem(s);
                }
                else if (sType == RAIS.XML_S)
                {
                    rais = SItem(s);
                }
            }
            return(rais);
        }
コード例 #19
0
        public RAIS_R CreateI(string name)
        {
            object     instance = Activator.CreateInstance(this.Type);
            IComponent ic       = instance as IComponent;

            if (ic != null)
            {
                if (ic.Site == null)
                {
                    ic.Site = new XTypeSite(ic);
                }
                if (string.IsNullOrEmpty(name))
                {
                    int n = 2;
                    name = this.Type.Name + n.ToString();
                    RAIS container = this.ContainerType;
                    if (container != null)
                    {
                        name = container.CreateNewName(this.Type.Name);
                    }
                    else
                    {
                        name = this.CreateNewName(this.Type.Name);
                    }
                }
                ic.Site.Name = name;
            }
            RAIS_R r = new RAIS_R(name, instance, this);

            if (_i == null)
            {
                _i = new List <RAIS_R>();
            }
            _i.Add(r);
            return(r);
        }
コード例 #20
0
 public RAIS_A(RAIS parentType)
     : base(parentType)
 {
 }
コード例 #21
0
 public RAIS_A(string name, Type type, RAIS parentType)
     : base(name, type, parentType)
 {
 }
コード例 #22
0
 /// <summary>
 /// to create a member of R/T
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="parentType"></param>
 protected RAIS(string name, Type type, RAIS parentType)
 {
     _name       = name;
     _type       = type;
     _parentType = parentType;
 }
コード例 #23
0
 /// <summary>
 /// create a member of R/A
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="parentType"></param>
 public RAIS_R(string name, object instance, RAIS parentType)
     : base(name, instance.GetType(), parentType)
 {
     _object = instance;
 }
コード例 #24
0
 /// <summary>
 /// for loading map. name and type will be read from XML
 /// </summary>
 /// <param name="parentType"></param>
 protected RAIS(RAIS parentType)
 {
     _name       = null;
     _type       = null;
     _parentType = parentType;
 }