public ForeachDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     ForeachTypes        = Dev2EnumConverter.ConvertEnumsTypeToStringList <enForEachType>();
     SelectedForeachType = Dev2EnumConverter.ConvertEnumValueToString(ForEachType);
     AddTitleBarLargeToggle();
     HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_LoopConstruct_For_Each;
 }
        public void RandomDesignerViewModel_Constructor_ModelItemIsValid_RandomTypesHasThreeItems()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestRandomDesignerViewModel(modelItem);
            var expected  = Dev2EnumConverter.ConvertEnumsTypeToStringList <enRandomType>();

            CollectionAssert.AreEqual(expected.ToList(), viewModel.RandomTypes.ToList());
        }
 public FormatNumberDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     RoundingTypes        = new List <string>(Dev2EnumConverter.ConvertEnumsTypeToStringList <enRoundingType>());
     SelectedRoundingType = string.IsNullOrEmpty(RoundingType) ? RoundingTypes[0] : RoundingType;
     AddTitleBarLargeToggle();
     HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Utility_Format_Number;
 }
        public void ScriptDesignerViewModel_Constructor_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);
            var expected  = Dev2EnumConverter.ConvertEnumsTypeToStringList <enScriptType>();

            CollectionAssert.AreEqual(expected.ToList(), viewModel.ScriptTypes.ToList());
        }
 public RandomDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     RandomTypes        = Dev2EnumConverter.ConvertEnumsTypeToStringList <enRandomType>();
     SelectedRandomType = RandomType.GetDescription();
     AddTitleBarLargeToggle();
     HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Utility_Random;
 }
        void CbxLoad(object sender, RoutedEventArgs e)
        {
            ComboBox cbx = sender as ComboBox;

            if (cbx != null)
            {
                if (cbx.Items.Count == 0)
                {
                    cbx.ItemsSource = Dev2EnumConverter.ConvertEnumsTypeToStringList <enDev2BaseConvertType>();
                }
            }
        }
Esempio n. 7
0
        public BaseConvertDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            AddTitleBarQuickVariableInputToggle();
            AddTitleBarLargeToggle();
            dynamic mi = ModelItem;

            InitializeItems(mi.ConvertCollection);

            ConvertTypes = Dev2EnumConverter.ConvertEnumsTypeToStringList <enDev2BaseConvertType>();
            HelpText     = Warewolf.Studio.Resources.Languages.HelpText.Tool_Data_Base_Convert;
        }
Esempio n. 8
0
        public BaseConvertDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            AddTitleBarQuickVariableInputToggle();
            AddTitleBarHelpToggle();

            dynamic mi = ModelItem;

            InitializeItems(mi.ConvertCollection);

            ConvertTypes = Dev2EnumConverter.ConvertEnumsTypeToStringList <enDev2BaseConvertType>();
        }
Esempio n. 9
0
        public ScriptDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            _eventPublisher = EventPublishers.Aggregator;
            _eventPublisher.Subscribe(this);

            EscapeScript              = true;
            ScriptTypes               = Dev2EnumConverter.ConvertEnumsTypeToStringList <enScriptType>();
            SelectedScriptType        = Dev2EnumConverter.ConvertEnumValueToString(ScriptType);
            ChooseScriptSourceCommand = new DelegateCommand(o => ChooseScriptSources());
            AddTitleBarLargeToggle();
            HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Scripting_Script;
        }
Esempio n. 10
0
        public ZipDesignerViewModel(ModelItem modelItem)
            : base(modelItem, "File or Folder", "Destination")
        {
            AddTitleBarLargeToggle();

            CompressionRatioList = Dev2EnumConverter.ConvertEnumsTypeToStringList <CompressionRatios>();

            var selectionRatio = string.IsNullOrEmpty(CompressionRatio)
                ? CompressionRatios.Default
                : (CompressionRatios)Enum.Parse(typeof(CompressionRatios), CompressionRatio);

            SelectedCompressionRatioDescription = selectionRatio.GetDescription();
            HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_File_Zip;
        }
Esempio n. 11
0
        public void Dev2EnumConverter_ConvertEnumsTypeToStringList_GetType_AreEqual_ExpectTrue()
        {
            //----------------------Arrange-------------------------
            var testList = new List <string>();

            testList.Add("None");
            testList.Add("Normal");
            testList.Add("Up");
            testList.Add("Down");
            //----------------------Act-----------------------------
            var convertEnumsTypeToStringList = Dev2EnumConverter.ConvertEnumsTypeToStringList <enRoundingType>();

            //----------------------Assert--------------------------
            Assert.AreEqual(testList.GetType(), convertEnumsTypeToStringList.GetType());
        }
Esempio n. 12
0
        public ForeachDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            ForeachTypes        = Dev2EnumConverter.ConvertEnumsTypeToStringList <enForEachType>();
            SelectedForeachType = Dev2EnumConverter.ConvertEnumValueToString(ForEachType);
            AddTitleBarLargeToggle();
            HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_LoopConstruct_For_Each;
            var dataFunc = modelItem.Properties["DataFunc"]?.ComputedValue as ActivityFunc <string, bool>;

            DataFuncDisplayName = dataFunc?.Handler == null ? "" : dataFunc?.Handler?.DisplayName;
            var type = dataFunc?.Handler?.GetType();

            if (type != null)
            {
                DataFuncIcon = ModelItemUtils.GetImageSourceForToolFromType(type);
            }
        }
        public GatherSystemInformationDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            AddTitleBarQuickVariableInputToggle();
            AddTitleBarHelpToggle();
            dynamic mi = ModelItem;

            InitializeItems(mi.SystemInformationCollection);

            if (mi.SystemInformationCollection == null || mi.SystemInformationCollection.Count <= 0)
            {
                mi.SystemInformationCollection.Add(new GatherSystemInformationTO(enTypeOfSystemInformationToGather.FullDateTime, string.Empty, 1));
                mi.SystemInformationCollection.Add(new GatherSystemInformationTO(enTypeOfSystemInformationToGather.FullDateTime, string.Empty, 2));
            }

            ItemsList = Dev2EnumConverter.ConvertEnumsTypeToStringList <enTypeOfSystemInformationToGather>();
        }
Esempio n. 14
0
        public SuspendExecutionDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            SuspendOptions        = Dev2EnumConverter.ConvertEnumsTypeToStringList <enSuspendOption>();
            SelectedSuspendOption = SuspendOption.GetDescription();
            AddTitleBarLargeToggle();
            HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Flow_SuspendExecution;
            var saveDataFunc = modelItem.Properties["SaveDataFunc"]?.ComputedValue as ActivityFunc <string, bool>;

            DataFuncDisplayName = saveDataFunc?.Handler == null ? "" : saveDataFunc?.Handler?.DisplayName;
            var type = saveDataFunc?.Handler?.GetType();

            if (type != null)
            {
                DataFuncIcon = ModelItemUtils.GetImageSourceForToolFromType(type);
            }
        }
Esempio n. 15
0
        public GatherSystemInformationDesignerViewModel(ModelItem modelItem)
            : base(modelItem)
        {
            AddTitleBarQuickVariableInputToggle();
            AddTitleBarLargeToggle();
            dynamic mi = ModelItem;

            InitializeItems(mi.SystemInformationCollection);

            if (mi.SystemInformationCollection == null || mi.SystemInformationCollection.Count <= 0)
            {
                mi.SystemInformationCollection.Add(new GatherSystemInformationTO(enTypeOfSystemInformationToGather.FullDateTime, string.Empty, 1));
                mi.SystemInformationCollection.Add(new GatherSystemInformationTO(enTypeOfSystemInformationToGather.FullDateTime, string.Empty, 2));
            }

            ItemsList = Dev2EnumConverter.ConvertEnumsTypeToStringList <enTypeOfSystemInformationToGather>();
            HelpText  = Warewolf.Studio.Resources.Languages.HelpText.Tool_Utility_Sys_Info;
        }
        public void BaseConvertViewModel_Constructor_PropertiesInitialized()
        {
            //------------Setup for test--------------------------
            var items = new List <BaseConvertTO>
            {
                new BaseConvertTO("xxxx", "Text", "Binary", "", 1),
                new BaseConvertTO("yyyy", "Text", "Text", "", 2)
            };

            //------------Execute Test---------------------------
            var viewModel = new BaseConvertDesignerViewModel(CreateModelItem(items));

            //------------Assert Results-------------------------
            Assert.IsNotNull(viewModel.ModelItem);
            Assert.IsNotNull(viewModel.ModelItemCollection);
            Assert.AreEqual("ConvertCollection", viewModel.CollectionName);

            var expectedOptions = Dev2EnumConverter.ConvertEnumsTypeToStringList <enDev2BaseConvertType>().ToList();

            CollectionAssert.AreEqual(expectedOptions, viewModel.ConvertTypes.ToList());

            Assert.AreEqual(2, viewModel.TitleBarToggles.Count);
        }