public CompositionSongs(List <Composition> compositions) : this() { foreach (var composition in compositions) { Compositions.Add(new CompositionSong(composition)); } }
/// <summary> /// Adds a composition to this mixin. /// </summary> /// <param name="name">The name.</param> /// <param name="shaderSourceElement">The shader source element.</param> /// <returns>Returns the index of the composition in the array.</returns> public int AddCompositionToArray(string name, ShaderSource shaderSourceElement) { ShaderSource shaderSource; if (!Compositions.TryGetValue(name, out shaderSource)) Compositions.Add(name, shaderSource = new ShaderArraySource()); var shaderArraySource = (ShaderArraySource)shaderSource; shaderArraySource.Add(shaderSourceElement); return shaderArraySource.Values.Count - 1; }
/// <summary> /// Writes the properties. /// </summary> /// <param name="properties">The properties.</param> /// <returns></returns> private static List <string> WriteProperties(List <Models.Property> properties) { List <string> _props = new List <string>(); properties.ForEach((n) => { if ((!Core.DataTypes.Contains(n.Type)) && (!Core.BaseTypes.Contains(Regex.Replace(n.Type.Name, Reflector.TypingSetter, "")))) { Compositions.Add(Regex.Replace(n.Type.Name, Reflector.TypingSetter, "")); } _props.Add('\t' + string.Format(Property_Notation, (n.ReadOnly ? "#" : "+"), n.Name, Regex.Replace(n.Type.Name, Reflector.TypingSetter, "[]"))); }); return(_props); }
public override void Initialize() { if (!_dataLoaded) { IsBusyLoading = true; var compositionsTask = Task.Factory.StartNew(() => _providerFactory.CompositionsProvider.GetCompositionsAsync().Result) .ContinueWith(t => t.Result.Select(x => x.ToCheckable()).CopyTo(Compositions), TaskScheduler.FromCurrentSynchronizationContext()); var templatesTask = Task.Factory.StartNew(() => _providerFactory.TemplateProvider.GetTemplatesAsync().Result) .ContinueWith(t => { t.Result.CopyTo(Templates); }, TaskScheduler.FromCurrentSynchronizationContext()); Task.WhenAll(compositionsTask, templatesTask) .ContinueWith(result => { IsBusyLoading = false; _dataLoaded = true; }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); } if (_updatedComposition == null || _updatedComposition.State == ItemState.Unchanged) { return; } if (!Compositions.Contains(_updatedComposition)) { Compositions.Add(_updatedComposition); } CheckItem(); _updatedComposition = null; }
internal void Read(EndianBinaryReader reader) { Name = reader.ReadStringOffset(StringBinaryFormat.NullTerminated); StartFrame = reader.ReadSingle(); EndFrame = reader.ReadSingle(); FrameRate = reader.ReadSingle(); BackgroundColor = reader.ReadColor(VectorBinaryFormat.UInt8); Width = reader.ReadInt32(); Height = reader.ReadInt32(); long cameraOffset = reader.ReadOffset(); int compositionCount = reader.ReadInt32(); long compositionsOffset = reader.ReadOffset(); int videoCount = reader.ReadInt32(); long videosOffset = reader.ReadOffset(); int audioCount = reader.ReadInt32(); long audiosOffset = reader.ReadOffset(); reader.ReadAtOffset(cameraOffset, () => { Camera = new Camera(); Camera.Read(reader); }); reader.ReadAtOffset(compositionsOffset, () => { Compositions.Capacity = compositionCount; for (int i = 0; i < compositionCount; i++) { var composition = new Composition(); composition.Read(reader); Compositions.Add(composition); } }); reader.ReadAtOffset(videosOffset, () => { Videos.Capacity = videoCount; for (int i = 0; i < videoCount; i++) { var video = new Video(); video.Read(reader); Videos.Add(video); } }); reader.ReadAtOffset(audiosOffset, () => { Audios.Capacity = audioCount; for (int i = 0; i < audioCount; i++) { var audio = new Audio(); audio.Read(reader); Audios.Add(audio); } }); foreach (var composition in Compositions) { foreach (var layer in composition.Layers) { layer.ResolveReferences(composition, this); } } }