public DataPropertiesElement Create(Guid id, IElementDefinition defType) { DataPropertiesElement el = new DataPropertiesElement(id, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IDataPropertiesElementParamMgr paramMgr = CreateParamMgr(); el.ParamMgr = paramMgr; Guid fxId = Guid.NewGuid(); IDataPropertiesElementFx fx = CreateMyFx(fxId, id); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ICompoundSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ICompoundOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
protected ISecondaryView Create(DataPropertiesElement element) { var vForm = new ViewOnlyForm(); var ctrl = new DataPropertiesCtrl(); vForm.SetSecondaryFxCtrl(ctrl); return vForm; }
public void Create_JoinerForDataPropertiesElement() { var _fac = new SecondaryViewJoinerFactory(); Guid id = new Guid(); Type expectedType = typeof(DataPropertiesElementJoiner); IElementDefinition defType = new ElementDefinition(Guid.NewGuid()); DataPropertiesElement el = new DataPropertiesElement(id, defType); ISecondaryViewJoiner joiner = _fac.Create(el); Assert.NotNull(joiner); Assert.IsType(expectedType, joiner); }
public void SetIsSelected_Does_Not_Fire_The_SelectionChangedEvent_If_The_SelectionValue_Does_Not_Change() { var element = new DataPropertiesElement(); var source = SelectionSource.Code; var origin = SelectionOrigin.Business; var helper = new HelperForElements(); element.SelectionChanged += new SelectionEventHandler<IElement, SelectionEventArgs>(helper.SelectionChanged_DummyHandler); element.SetIsSelected(false, source, origin); Assert.Equal(0, helper.SelectionChanged_TimesCalled); Assert.False(element.IsSelected); }
public void RequestVariableValuesForParamValidation_FiresRequestVariableValuesEvent() { var element = new DataPropertiesElement(); var mockParamMgr = new Moq.Mock<IDataPropertiesElementParamMgr>(); var helper = new HelperForElements(); string[] varNames = { "Var A", "Var B" }; element.RequestVariableValues += new RequestVariableValuesEventHandler<IElement>(helper.RequestVariableValues_DummyHandler); mockParamMgr.Setup(m => m.VarNamesDependedUpon).Returns(varNames); element.ParamMgr = mockParamMgr.Object; element.UpdateVariableValuesForParamValidation(); Assert.Equal(1, helper.RequestVariableValues_TimesCalled); }
public DataPropertiesElement Create(IElementTicket ticket, IElementDefinition defType) { if (ticket.TypeId != defType.ElementTypeId) { // TODO throw new InvalidOperationException(Properties.Resources.MssgTicketTypeIdDoesNotMatchDefTypeIdFormat(ticket.TypeId, defType.ElementTypeId)); } DataPropertiesElement el = new DataPropertiesElement(ticket.ElementId, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el, ticket.InputPortMgrId, ticket.InputPortIds[0]); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IDataPropertiesElementParamMgr paramMgr = CreateParamMgr(ticket.ParamMgrId); el.ParamMgr = paramMgr; IDataPropertiesElementFx fx = CreateMyFx(ticket.FxId, ticket.ElementId); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ICompoundSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ICompoundOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
protected ISecondaryViewJoiner Create(DataPropertiesElement element) { return new Standard.UI.Info.DataProperties.DataPropertiesElementJoiner(); }
public void SetIsSelected_Updates_The_IsSelected_Flag_If_The_Value_Changes() { var element = new DataPropertiesElement(); // origin will not effect of the flag is updated. ,just may not allow the event to be fired. var origin = SelectionOrigin.None; var helper = new HelperForElements(); element.SelectionChanged += new SelectionEventHandler<IElement, SelectionEventArgs>(helper.SelectionChanged_DummyHandler); Assert.False(element.IsSelected); element.SetIsSelected(true, SelectionSource.Mouse, origin); Assert.Equal(0, helper.SelectionChanged_TimesCalled); Assert.True(element.IsSelected); }