internal override void PerformAction()
        {
            TreeListColumn columnToCopy = _mainForm.GetMultiCellSelector().GetColumnIfExactlyOneSelected();

            if (columnToCopy == null)
            {
                _actionIsCanceled = true;
                return;
            }

            foreach (TreeListNode selectedNode in _mainForm.GetMultiCellSelector().GetSelectedNodes(true, true))
            {
                foreach (TreeListColumn column in _mainForm.treeList.Columns)
                {
                    if (column.Tag != null &&
                        !_mainForm.GetTreeListManager().GetIDsOfHiddenSystems().Contains((column.Tag as SystemTreeListTag).GetSystemRow().ID))
                    {
                        string value = selectedNode.GetValue((columnToCopy.Tag as SystemTreeListTag).GetSystemRow().Name).ToString();
                        (selectedNode.Tag as BaseTreeListTag).StoreChangedValue(value, (column.Tag as SystemTreeListTag).GetSystemRow());
                        selectedNode.SetValue(column, value);

                        //enforce updating of the info provided by combo-boxes and Intelli-sense if Def-functions are changed
                        TreeListManager.UpdateIntelliAndTUBoxInfo((selectedNode.Tag as BaseTreeListTag).GetFunctionName(), column);
                    }
                }
            }
        }
Beispiel #2
0
 void PasteIntoCell(TreeListNode node, TreeListColumn column, string value)
 {
     //account for the destination of the value to paste, i.e. to which column it should be pasted ...
     //... system column: i.e. either a parameter value or a switch of a policy or function
     if (TreeListBuilder.IsSystemColumn(column))
     {
         BaseTreeListTag treeListTag = (node.Tag as BaseTreeListTag);
         DataSets.CountryConfig.SystemRow systemRow = (column.Tag as SystemTreeListTag).GetSystemRow();
         if (!treeListTag.IsPermittedPasteValue(value, systemRow.ID))
         {
             return;                                                          // e.g. trying to paste 'grumml' into a policy-switch
         }
         treeListTag.StoreChangedValue(value, systemRow);
         TreeListManager.UpdateIntelliAndTUBoxInfo((node.Tag as BaseTreeListTag).GetFunctionName(), column);
     }
     //... comment column: i.e. a comment (to a parameter, function or policy)
     else if (TreeListBuilder.IsCommentColumn(column))
     {
         (node.Tag as BaseTreeListTag).SetComment(value);
     }
     //... policy column: ...
     else if (TreeListBuilder.IsPolicyColumn(column))
     {   //... an editable policy column belongs to a parameter and contains e.g. a component of an incomelist, the name of a constant/variable, etc.
         if ((node.Tag as BaseTreeListTag).IsPolicyColumnEditable())
         {
             foreach (CountryConfig.ParameterRow parameterRow in (node.Tag as ParameterTreeListTag).GetParameterRows())
             {
                 parameterRow.Name = value;
             }
         }
         else
         {
             return;  //no action if a policy-, function- or parameter-name
         }
     }
     //... group column:
     else if (TreeListBuilder.IsGroupColumn(column))
     {
         //... an editable group column belongs to a parameter
         if ((node.Tag as BaseTreeListTag).IsGroupColumnEditable())
         {
             foreach (CountryConfig.ParameterRow parameterRow in (node.Tag as ParameterTreeListTag).GetParameterRows())
             {
                 parameterRow.Group = value;
             }
         }
         else
         {
             return;  //group column of policies and functions is not editable
         }
     }
     else
     {
         return;                   //does not happen
     }
     node.SetValue(column, value); //update nodes here to avoid having to redraw the tree (to enhance performance)
 }
Beispiel #3
0
        internal override void PerformAction()
        {
            if (_newValue == string.Empty || _changeInTree)
            {
                if (_newValue == string.Empty)
                {
                    _newValue = DefPar.Value.NA;  //developer's wish: do not leave cell empty, but set to n/a instead
                }
                _senderNode.SetValue(_senderColumn, _newValue);
            }
            (_senderNode.Tag as BaseTreeListTag).StoreChangedValue(_newValue, (_senderColumn.Tag as SystemTreeListTag).GetSystemRow());

            //enforce updating of the info provided by combo-boxes and Intelli-sense if Def-functions are changed
            TreeListManager.UpdateIntelliAndTUBoxInfo((_senderNode.Tag as BaseTreeListTag).GetFunctionName(), _senderColumn);
        }