public static SourceDto GetDtoSourceFromUcSource(UcSource UcSource) { return(new SourceDto { Id = UcSource.SourceId, Name = UcSource.Name, HexColor = UcSource.Color.ToString(), DefaultWidth = UcSource.DefaultWidth, DefaultHeight = UcSource.DefaultHeight }); }
public static ObservableCollection <UcSourceInstance> GetUcSourceInstanceListFromUcSourceListAndDtoSourceInstanceList(IEnumerable <UcSource> UcSourceList, IEnumerable <SourceInstanceDto> dtoSourceInstanceList, float pixelToUnityUnitScale, IUnityMainThreadDispatcher dispatcher) { ObservableCollection <UcSourceInstance> UcSourceInstanceList = new ObservableCollection <UcSourceInstance>(); foreach (var dtoSourceInstance in dtoSourceInstanceList) { UcSource appropriateSource = UcSourceList.FirstOrDefault(s => s.SourceId == dtoSourceInstance.SourceId); if (appropriateSource == null) { continue; } UcSourceInstanceList.Add(GetUcSourceInstanceFromUcSourceAndDtoSourceInstance(appropriateSource, dtoSourceInstance, pixelToUnityUnitScale, dispatcher)); } return(UcSourceInstanceList); }
public static UcSourceInstance GetUcSourceInstanceFromUcSourceAndDtoSourceInstance(UcSource appropriateSource, SourceInstanceDto dtoSourceInstance, float pixelToUnityUnitScale, IUnityMainThreadDispatcher dispatcher) { return(new UcSourceInstance(appropriateSource, dtoSourceInstance.WallId, dtoSourceInstance.X, dtoSourceInstance.Y, dtoSourceInstance.Width, dtoSourceInstance.Height, pixelToUnityUnitScale, dispatcher, dtoSourceInstance.Id)); }
public async Task <int> AddSource(UcSource source) { int id = await HubProxy.Invoke <int>("AddSource", SourceMapper.GetDtoSourceFromUcSource(source)); return(id); }