本文整理汇总了C#中ColorGradient.UnlinkFromLibrary方法的典型用法代码示例。如果您正苦于以下问题:C# ColorGradient.UnlinkFromLibrary方法的具体用法?C# ColorGradient.UnlinkFromLibrary怎么用?C# ColorGradient.UnlinkFromLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColorGradient
的用法示例。
在下文中一共展示了ColorGradient.UnlinkFromLibrary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: timelineControl_GradientDropped
private void timelineControl_GradientDropped(object sender, ToolDropEventArgs e)
{
List<Element> elementList = new List<Element>();
if (e.Element.Selected)
elementList = TimelineControl.SelectedElements.ToList();
else
elementList.Add(e.Element);
ColorGradient droppedGradient = _colorGradientLibrary.GetColorGradient(e.Data.GetData(DataFormats.StringFormat).ToString());
foreach (Element elem in elementList)
{
ColorGradient gradient = new ColorGradient(droppedGradient);
if (ToolsForm.LinkGradients)
{
gradient.LibraryReferenceName = e.Data.GetData(DataFormats.StringFormat).ToString();
}
else
{
gradient.LibraryReferenceName = string.Empty;
gradient.UnlinkFromLibrary();
}
gradient.IsCurrentLibraryGradient = false;
object[] parms = elem.EffectNode.Effect.ParameterValues;
switch (elem.EffectNode.Effect.EffectName)
{
case "Alternating":
if (e.MouseButton == MouseButtons.Right || Control.ModifierKeys.HasFlag(Keys.Control))
{
parms[9] = false;
parms[11] = gradient;
}
else
{
parms[8] = false;
parms[10] = gradient;
}
break;
case "Pulse":
parms[1] = gradient;
break;
case "Chase":
parms[0] = ToolsForm.GradientHandling;
parms[4] = gradient;
break;
case "Spin":
parms[2] = ToolsForm.GradientHandling;
parms[10] = gradient;
break;
case "Twinkle":
parms[7] = ToolsForm.GradientHandling;
parms[9] = gradient;
break;
case "Wipe":
parms[0] = gradient;
break;
}
elem.EffectNode.Effect.ParameterValues = parms;
TimelineControl.grid.RenderElement(elem);
}
sequenceModified();
}