// ReSharper disable once UnusedParameter.Local
 private void AfterSelectImplementation(JTokenTreeNode node, TreeViewEventArgs e)
 {
     AfterSelect?.Invoke(this, new AfterSelectEventArgs(
                             $"{node.JTokenTag.Type}",
                             $"{node.JTokenTag.Type}",
                             () => $"{node.JTokenTag}"));
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     ユニットツリービューのユニット/師団以外のノード選択時の処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnOtherAfterSelect(object sender, TreeViewEventArgs e)
        {
            UnitTreeViewEventArgs args = new UnitTreeViewEventArgs(e);

            switch ((NodeType)e.Node.Tag)
            {
            case NodeType.Land:
            case NodeType.Naval:
            case NodeType.Air:
                args.CanAddUnit = true;
                break;

            case NodeType.Boarding:
                args.Unit       = e.Node.Parent.Tag as Unit;
                args.CanAddUnit = true;
                break;

            case NodeType.UndeployedLand:
            case NodeType.UndeployedNaval:
            case NodeType.UndeployedAir:
                args.CanAddDivision = true;
                break;
            }

            AfterSelect?.Invoke(sender, args);
        }
 /// <summary>
 /// Default catcher in case of a node of unattended type.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="e"></param>
 // ReSharper disable once UnusedParameter.Local
 private void AfterSelectImplementation(TreeNode node, TreeViewEventArgs e)
 {
     AfterSelect?.Invoke(this, new AfterSelectEventArgs(
                             $"{JTokenType.Undefined}: {node.GetType().FullName}",
                             $"{JTokenType.Undefined}: {node.GetType().FullName}",
                             () => ""));
 }
 void tV_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (AfterSelect != null)
     {
         AfterSelect.Invoke(e.Node.Tag);
     }
 }
Ejemplo n.º 5
0
 public StandardSelectStrategy(Option option, OnSelect onSelect, AfterSelect afterSelect = null)
 {
     _option = option;
     _onSelect = onSelect;
     if (afterSelect == null)
         afterSelect = () => { };
     _afterSelect = afterSelect;
 }
 private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (AfterSelect != null)
     {
         //raise the event , as it is subscribed may be in winform
         AfterSelect.Invoke(sender, e);
     }
 }
        private void OnAfterSelect(object sender, TreeViewEventArgs e)
        {
            // If arrow key was used to navigate to this node, don't send OnSelected
            int delta = (int)_getCurrentTime().Subtract(_lastKeyNavigateTime).TotalMilliseconds;

            if (delta is (>= 0 and < 500))
            {
                return;
            }

            AfterSelect?.Invoke(sender, e);
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     ユニットツリービューのユニットノード選択時の処理
        /// </summary>
        /// <param name="unit">ユニット</param>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnUnitAfterSelect(Unit unit, object sender, TreeViewEventArgs e)
        {
            int index  = e.Node.Parent.Nodes.IndexOf(e.Node);
            int bottom = e.Node.Parent.Nodes.Count - 1;

            UnitTreeViewEventArgs args = new UnitTreeViewEventArgs(e)
            {
                Unit           = unit,
                CanAddUnit     = true,
                CanAddDivision = true,
                IsTop          = index == 0,
                IsBottom       = index == bottom
            };

            AfterSelect?.Invoke(sender, args);
        }
        // ReSharper disable once UnusedParameter.Local
        private void AfterSelectImplementation(JValueTreeNode node, TreeViewEventArgs e)
        {
            AfterSelect?.Invoke(this, new AfterSelectEventArgs(
                                    node.Tag.GetType().Name,
                                    $"{node.JValueTag.Type}",
                                    () =>
            {
                switch (node.JValueTag.Type)
                {
                case JTokenType.String:
                    return($@"""{node.JValueTag}""");

                case JTokenType.Boolean:
                    return($"{node.JValueTag}".ToLower());

                default:
                    return($"{node.JValueTag}");
                }
            }));
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     ユニットツリービューの師団ノード選択時の処理
        /// </summary>
        /// <param name="division">師団</param>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnDivisionAfterSelect(Division division, object sender, TreeViewEventArgs e)
        {
            int index  = e.Node.Parent.Nodes.IndexOf(e.Node);
            int bottom = e.Node.Parent.Nodes.Count - 1;

            // 搭載ユニットの分-1する
            if (division.Branch == Branch.Navy || division.Branch == Branch.Airforce)
            {
                bottom--;
            }

            UnitTreeViewEventArgs args = new UnitTreeViewEventArgs(e)
            {
                Division       = division,
                Unit           = e.Node.Parent.Tag as Unit,
                CanAddDivision = true,
                IsTop          = index <= 0,
                IsBottom       = index >= bottom
            };

            AfterSelect?.Invoke(sender, args);
        }
Ejemplo n.º 11
0
        public void FindSetNCM(string codNcm)
        {
            using (var ctx = new BalcaoContext(false))
            {
                try
                {
                    codNcm = codNcm.Replace(".", string.Empty);

                    var ncm = ctx.NcmsDao.Where(c => c.CodigoNcm == codNcm)
                              .First();
                    this.NCM = ncm;

                    this.buttonEditNcm.Text = ncm.DescricaoNcm;
                    this.textEditNcm.Text   = ncm.CodigoNcm;

                    AfterSelect.DynamicInvoke();
                }
                catch (Exception ex)
                {
                    //da nada nao
                    LoggerUtilIts.ShowExceptionLogs(ex);
                }
            }
        }
Ejemplo n.º 12
0
 internal virtual void OnAfterSelect(AfterSelectEventArgs e)
 {
     AfterSelect?.Invoke(this, e);
 }
Ejemplo n.º 13
0
 private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     AfterSelect.Fire(this);
 }
Ejemplo n.º 14
0
 private void treeView_AfterSelect(object sender, EventArgs e)
 {
     AfterSelect?.Invoke(this, e);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 触发选择后事件
 /// </summary>
 /// <param name="p_selectedItem"></param>
 internal void OnSelected(object p_selectedItem)
 {
     AfterSelect?.Invoke(this, p_selectedItem);
 }
Ejemplo n.º 16
0
 protected virtual void raiseAfterSelect(Node node)
 {
     AfterSelect?.Invoke(this, new TreeViewEventArgs(null));
 }