예제 #1
0
 public SelfTypeNode(Node parentNode, SelfTypeMode mode, int inputCount) : base(parentNode)
 {
     Mode = mode;
     foreach (int i in Enumerable.Range(0, inputCount))
     {
         CreateTerminal(Direction.Input, NITypes.Void, $"type{i}");
     }
 }
예제 #2
0
파일: SelfType.cs 프로젝트: rebarlang/rebar
 private SelfType()
 {
     Width = StockDiagramGeometries.GridSize * 8;
     _mode = SelfTypeMode.Struct;
 }
예제 #3
0
        private static bool UpdateParameterFromModeValue(ICommandParameter parameter, IEnumerable <IViewModel> selection, SelfTypeMode mode)
        {
            var selfType = FindSelfType(selection);

            if (selfType == null)
            {
                return(false);
            }

            ((ICheckableCommandParameter)parameter).IsChecked = selfType.Mode == mode;
            return(mode != SelfTypeMode.Variant || RebarFeatureToggles.IsVariantTypesEnabled);
        }
예제 #4
0
        private static void SetTypeDiagramSelfMode(IEnumerable <IViewModel> selection, SelfTypeMode mode)
        {
            SelfType selfType = FindSelfType(selection);

            using (IActiveTransaction transaction = selfType.TransactionManager.BeginTransaction("Set SelfType mode", TransactionPurpose.User))
            {
                selfType.Mode = mode;
                transaction.Commit();
            }
        }