Beispiel #1
0
 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
     });
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
        public async Task <int> AddSource(UcSource source)
        {
            int id = await HubProxy.Invoke <int>("AddSource", SourceMapper.GetDtoSourceFromUcSource(source));

            return(id);
        }