示例#1
0
文件: MonaGrid.cs 项目: rokuan/mona
        private void tryAddingComponent(object o)
        {
            if (o is IAliasAnswerer)
            {
                IAliasAnswerer        asAns = (IAliasAnswerer)o;
                List <IAliasAnswerer> answerers;

                if (asAns.getAlias() == null)
                {
                    return;
                }

                if (components.ContainsKey(asAns.getAlias()))
                {
                    answerers = components[asAns.getAlias()];
                    answerers.Add(asAns);
                }
                else
                {
                    answerers = new List <IAliasAnswerer>();
                    answerers.Add(asAns);
                    components.Add(asAns.getAlias(), answerers);
                }

                notifyAliasAdd(asAns.getAlias(), asAns);
            }
        }
示例#2
0
 //public void unregisterComponent(IAliased comp)
 public void unregisterComponent(IAliasAnswerer comp)
 {
     try
     {
         unregisterComponent(comp.getAlias());
     }
     catch (Exception e)
     {
     }
 }
示例#3
0
        //public void registerComponent(string alias, IAliased comp)
        public void registerComponent(string alias, IAliasAnswerer comp)
        {
            if (alias != null && alias.Length > 0)
            {
                if (components.ContainsKey(comp.getAlias()))
                {
                    components[comp.getAlias()] = comp;
                }
                else
                {
                    components.Add(alias, comp);
                }

                if (socket != null && active)
                {
                    notifyAliasAdd(alias);
                }
            }
        }
示例#4
0
        //public void registerComponent(string alias, IAliased comp)
        public void registerComponent(string alias, IAliasAnswerer comp)
        {
            if (alias != null && alias.Length > 0)
            {
                if (components.ContainsKey(comp.getAlias()))
                {
                    components[comp.getAlias()] = comp;
                }
                else
                {
                    components.Add(alias, comp);
                }

                if (socket != null && active)
                {
                    notifyAliasAdd(alias);
                }
            }
        }
示例#5
0
文件: MonaMenu.cs 项目: rokuan/mona
        private void tryRemovingComponent(object o)
        {
            if (o is IAliasAnswerer)
            {
                IAliasAnswerer asAns = (IAliasAnswerer)o;

                if (asAns.getAlias() == null)
                {
                    return;
                }

                List <IAliasAnswerer> answerers = components[asAns.getAlias()];

                if (answerers != null)
                {
                    answerers.Remove(asAns);
                }
            }
        }
示例#6
0
        //public void unregisterComponent(IAliased comp)
        public void unregisterComponent(IAliasAnswerer comp)
        {
            try
            {
                unregisterComponent(comp.getAlias());
            }
            catch (Exception e)
            {

            }
        }
示例#7
0
 //public void registerComponent(IAliased comp)
 public void registerComponent(IAliasAnswerer comp)
 {
     registerComponent(comp.getAlias(), comp);
 }
示例#8
0
 //public void registerComponent(IAliased comp)
 public void registerComponent(IAliasAnswerer comp)
 {
     registerComponent(comp.getAlias(), comp);
 }