本文整理汇总了C#中System.Property.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# Property.Reset方法的具体用法?C# Property.Reset怎么用?C# Property.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Property
的用法示例。
在下文中一共展示了Property.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bind
//.........这里部分代码省略.........
analyticsActiveSessions.ItemAdded += delegate(int index, SessionEntry s)
{
Session.PositionProperty positionProperty = s.Session.PositionProperties[0];
foreach (Session.EventList el in s.Session.Events)
{
if (analyticsActiveEvents.FirstOrDefault(x => x.Name == el.Name) != null)
{
List<ModelInstance> models = new List<ModelInstance>();
Vector4 color = this.colorHash(el.Name);
int hash = (int)(new Color(color).PackedValue);
foreach (Session.Event e in el.Events)
{
ModelInstance i = new ModelInstance();
i.Setup("Models\\position-model", hash);
if (i.IsFirstInstance)
i.Model.Color.Value = new Vector3(color.X, color.Y, color.Z);
i.Scale.Value = new Vector3(0.25f);
i.Transform.Value = Matrix.CreateTranslation(positionProperty[e.Time]);
result.Add(i);
models.Add(i);
}
eventPositionModels[el] = models;
}
}
ModelInstance instance = new ModelInstance();
instance.Setup("Models\\position-model", 0);
instance.Scale.Value = new Vector3(0.25f);
result.Add(instance);
sessionPositionModels.Add(s.Session, instance);
s.Active.Value = true;
timeline.Children.Add(s.Session.Events.Where(x => analyticsActiveEvents.FirstOrDefault(y => y.Name == x.Name) != null).Select(createEventLines));
playbackLocation.Reset();
refreshPropertyGraphs();
};
analyticsActiveSessions.ItemRemoved += delegate(int index, SessionEntry s)
{
ModelInstance instance = sessionPositionModels[s.Session];
instance.Delete.Execute();
foreach (KeyValuePair<Session.EventList, List<ModelInstance>> pair in eventPositionModels.ToList())
{
if (pair.Key.Session == s.Session)
{
foreach (ModelInstance i in pair.Value)
i.Delete.Execute();
eventPositionModels.Remove(pair.Key);
}
}
sessionPositionModels.Remove(s.Session);
s.Active.Value = false;
timeline.Children.Remove(timeline.Children.Where(x => x.UserData.Value != null && ((Session.EventList)x.UserData.Value).Session == s.Session).ToList());
refreshPropertyGraphs();
};
playbackLocation.Set = delegate(float value)
{
if (analyticsActiveSessions.Count == 0)
return;
value = Math.Max(0.0f, value);
示例2: Bind
//.........这里部分代码省略.........
analyticsActiveSessions.ItemAdded += delegate(int index, SessionEntry s)
{
Session.PositionProperty positionProperty = s.Session.PositionProperties[0];
foreach (Session.EventList el in s.Session.Events)
{
if (analyticsActiveEvents.FirstOrDefault(x => x.Name == el.Name) != null)
{
List<ModelInstance> models = new List<ModelInstance>();
Vector4 color = colorHash(el.Name);
int hash = (int)(new Color(color).PackedValue);
foreach (Session.Event e in el.Events)
{
ModelInstance i = new ModelInstance();
i.Serialize = false;
i.Setup("InstancedModels\\position-model", hash);
if (i.IsFirstInstance)
i.Model.Color.Value = new Vector3(color.X, color.Y, color.Z);
i.Transform.Value = Matrix.CreateTranslation(positionProperty.GetLastRecordedPosition(e.Time));
entity.Add(i);
models.Add(i);
}
eventPositionModels[el] = models;
}
}
ModelInstance instance = new ModelInstance();
instance.Setup("InstancedModels\\position-model", 0);
instance.Serialize = false;
entity.Add(instance);
sessionPositionModels.Add(s.Session, instance);
s.Active.Value = true;
timeline.Children.AddAll(s.Session.Events.Where(x => analyticsActiveEvents.FirstOrDefault(y => y.Name == x.Name) != null).Select(createEventLines));
playbackLocation.Reset();
refreshPropertyGraphs();
};
analyticsActiveSessions.ItemRemoved += delegate(int index, SessionEntry s)
{
ModelInstance instance = sessionPositionModels[s.Session];
instance.Delete.Execute();
foreach (KeyValuePair<Session.EventList, List<ModelInstance>> pair in eventPositionModels.ToList())
{
if (pair.Key.Session == s.Session)
{
foreach (ModelInstance i in pair.Value)
i.Delete.Execute();
eventPositionModels.Remove(pair.Key);
}
}
sessionPositionModels.Remove(s.Session);
s.Active.Value = false;
timeline.Children.RemoveAll(timeline.Children.Where(x => x.UserData.Value != null && ((Session.EventList)x.UserData.Value).Session == s.Session).ToList());
refreshPropertyGraphs();
};
entity.Add(new SetBinding<float>(playbackLocation, delegate(float value)
{
if (analyticsActiveSessions.Length == 0)
return;
if (value < 0.0f)