예제 #1
0
        /// <summary>
        /// 指定フィーチャーにトークンをセットする
        /// </summary>
        /// <param name="feature">フィーチャー</param>
        /// <param name="tokenID">トークンID</param>
        protected void requestStartup(FeatureGroupBase group, Type feature, NamedId tokenID)
        {
            //lock(_children.SyncRoot)	// 途中でAddChildしないので、スレッドセーフ。途中でAddChildしてしまうと下のループでAssertされる
            {
                foreach (var cg in _children)
                {
                    if (cg is FeatureGroupBase)
                    {
                        requestStartup((FeatureGroupBase)cg, feature, tokenID);
                    }
                    if (cg is FeatureBase)
                    {
                        if (((FeatureBase)cg).Enabled == false)
                        {
                            continue;
                        }

                        if (cg.GetType().Equals(feature))
                        {
                            ((FeatureBase)cg).RequestStartup(tokenID);
                        }
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 緊急トークン処理再帰ループ
        /// </summary>
        private void invokeUrgentTokenLoop(NamedId id, NamedId who, object param, FeatureGroupBase tar)
        {
            //lock(_children.SyncRoot)	// 途中でAddChildしないので、スレッドセーフ。途中でAddChildしてしまうと下のループでAssertされる
            {
                foreach (var c in _children)
                {
                    if (c is FeatureGroupBase)
                    {
                        ((FeatureGroupBase)c).invokeUrgentTokenLoop(id, who, param, tar);
                    }
                    else if (c is FeatureBase)
                    {
                        if (((FeatureBase)c).Enabled == false)
                        {
                            continue;
                        }

                        if (TokenTray.ContainsTokenID((FeatureBase)c, id))
                        {
                            if (((FeatureBase)c).CanStart)
                            {
                                ((FeatureBase)c).Start(who);
                                ((FeatureBase)c).Start(who, param);
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
 /// <summary>
 /// GetChildFeatureInstanceで使用する再帰関数
 /// </summary>
 /// <param name="buf">結果を収める配列</param>
 /// <param name="fg">検索開始するフィーチャーグループ</param>
 private void _getChildFeatureInstances(IList buf, FeatureGroupBase fg)
 {
     //lock(fg._children.SyncRoot)	// 途中でAddChildしないので、スレッドセーフ。途中でAddChildしてしまうと下のループでAssertされる
     {
         foreach (var cg in fg._children)
         {
             if (cg is FeatureGroupBase)
             {
                 _getChildFeatureInstances(buf, (FeatureGroupBase)cg);
             }
             if (cg is FeatureBase)
             {
                 buf.Add(cg);
             }
         }
     }
 }
예제 #4
0
 private void paramloop(FeatureGroupBase tar, List <FeatureBase> fcs)
 {
     //lock(_children.SyncRoot)	// 途中でAddChildしないので、スレッドセーフ。途中でAddChildしてしまうと下のループでAssertされる
     {
         foreach (var c in _children)
         {
             if (c is FeatureGroupBase)
             {
                 ((FeatureGroupBase)c).paramloop(tar, fcs);
             }
             else if (c is FeatureBase fc)
             {
                 if (string.IsNullOrEmpty(fc.CommandParameter) == false)
                 {
                     fcs.Add(fc);
                 }
             }
         }
     }
 }
예제 #5
0
 /// <summary>
 /// ルートグループを指定する
 /// </summary>
 public void SetFeatureRootGroup(FeatureGroupBase root)
 {
     _root = root;
 }