本文整理汇总了C#中ILayout类的典型用法代码示例。如果您正苦于以下问题:C# ILayout类的具体用法?C# ILayout怎么用?C# ILayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILayout类属于命名空间,在下文中一共展示了ILayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LayoutSettingsControl
public LayoutSettingsControl(LiveSplit.UI.LayoutSettings settings, ILayout layout)
{
InitializeComponent();
Settings = settings;
Layout = layout;
chkBestSegments.DataBindings.Add("Checked", Settings, "ShowBestSegments", false, DataSourceUpdateMode.OnPropertyChanged);
chkAlwaysOnTop.DataBindings.Add("Checked", Settings, "AlwaysOnTop", false, DataSourceUpdateMode.OnPropertyChanged);
chkAntiAliasing.DataBindings.Add("Checked", Settings, "AntiAliasing", false, DataSourceUpdateMode.OnPropertyChanged);
chkDropShadows.DataBindings.Add("Checked", Settings, "DropShadows", false, DataSourceUpdateMode.OnPropertyChanged);
chkRainbow.DataBindings.Add("Checked", Settings, "UseRainbowColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnTextColor.DataBindings.Add("BackColor", Settings, "TextColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBackground.DataBindings.Add("BackColor", Settings, "BackgroundColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBackground2.DataBindings.Add("BackColor", Settings, "BackgroundColor2", false, DataSourceUpdateMode.OnPropertyChanged);
btnThinSep.DataBindings.Add("BackColor", Settings, "ThinSeparatorsColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnSeparators.DataBindings.Add("BackColor", Settings, "SeparatorsColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnPB.DataBindings.Add("BackColor", Settings, "PersonalBestColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnGlod.DataBindings.Add("BackColor", Settings, "BestSegmentColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnAheadGaining.DataBindings.Add("BackColor", Settings, "AheadGainingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnAheadLosing.DataBindings.Add("BackColor", Settings, "AheadLosingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBehindGaining.DataBindings.Add("BackColor", Settings, "BehindGainingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBehindLosing.DataBindings.Add("BackColor", Settings, "BehindLosingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnNotRunning.DataBindings.Add("BackColor", Settings, "NotRunningColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnPausedColor.DataBindings.Add("BackColor", Settings, "PausedColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnShadowsColor.DataBindings.Add("BackColor", Settings, "ShadowsColor", false, DataSourceUpdateMode.OnPropertyChanged);
lblTimer.DataBindings.Add("Text", this, "TimerFont", false, DataSourceUpdateMode.OnPropertyChanged);
lblText.DataBindings.Add("Text", this, "SplitNamesFont", false, DataSourceUpdateMode.OnPropertyChanged);
lblTimes.DataBindings.Add("Text", this, "MainFont", false, DataSourceUpdateMode.OnPropertyChanged);
trkOpacity.DataBindings.Add("Value", this, "Opacity", false, DataSourceUpdateMode.OnPropertyChanged);
trkImageOpacity.DataBindings.Add("Value", this, "ImageOpacity", false, DataSourceUpdateMode.OnPropertyChanged);
trkBlur.DataBindings.Add("Value", this, "ImageBlur", false, DataSourceUpdateMode.OnPropertyChanged);
cmbBackgroundType.SelectedItem = GetBackgroundTypeString(Settings.BackgroundType);
originalBackgroundImage = Settings.BackgroundImage;
}
示例2: ApplyLayout
/// Apply a layout to a set of game objects
public static void ApplyLayout(ILayout layout, IEnumerable<GameObject> objects)
{
foreach (var lp in layout.Layout(objects))
{
ApplyLayout(lp);
}
}
示例3: AddRange
/// <summary>
/// Adds the elements of an array to the end of this LayoutCollection.
/// </summary>
/// <param name="items">
/// The array whose elements are to be added to the end of this LayoutCollection.
/// </param>
public virtual void AddRange(ILayout[]items)
{
foreach (ILayout item in items)
{
this.List.Add(item);
}
}
示例4: LayoutSettingsControl
public LayoutSettingsControl(Options.LayoutSettings settings, ILayout layout)
{
InitializeComponent();
Settings = settings;
Layout = layout;
chkBestSegments.DataBindings.Add("Checked", this, "ShowBestSegments", false, DataSourceUpdateMode.OnPropertyChanged);
chkAlwaysOnTop.DataBindings.Add("Checked", this, "AlwaysOnTop", false, DataSourceUpdateMode.OnPropertyChanged);
chkAntiAliasing.DataBindings.Add("Checked", this, "AntiAliasing", false, DataSourceUpdateMode.OnPropertyChanged);
chkDropShadows.DataBindings.Add("Checked", this, "DropShadows", false, DataSourceUpdateMode.OnPropertyChanged);
btnTextColor.DataBindings.Add("BackColor", this, "TextColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBackground.DataBindings.Add("BackColor", this, "BackgroundColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBackground2.DataBindings.Add("BackColor", this, "BackgroundColor2", false, DataSourceUpdateMode.OnPropertyChanged);
btnThinSep.DataBindings.Add("BackColor", this, "ThinSeparatorsColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnSeparators.DataBindings.Add("BackColor", this, "SeparatorsColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnPB.DataBindings.Add("BackColor", this, "PersonalBestColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnAheadGaining.DataBindings.Add("BackColor", this, "AheadGainingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnAheadLosing.DataBindings.Add("BackColor", this, "AheadLosingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBehindGaining.DataBindings.Add("BackColor", this, "BehindGainingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnBehindLosing.DataBindings.Add("BackColor", this, "BehindLosingTimeColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnGlod.DataBindings.Add("BackColor", this, "BestSegmentColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnNotRunning.DataBindings.Add("BackColor", this, "NotRunningColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnPausedColor.DataBindings.Add("BackColor", this, "PausedColor", false, DataSourceUpdateMode.OnPropertyChanged);
btnShadowsColor.DataBindings.Add("BackColor", this, "ShadowsColor", false, DataSourceUpdateMode.OnPropertyChanged);
lblTimer.DataBindings.Add("Text", this, "TimerFont", false, DataSourceUpdateMode.OnPropertyChanged);
lblText.DataBindings.Add("Text", this, "SplitNamesFont", false, DataSourceUpdateMode.OnPropertyChanged);
lblTimes.DataBindings.Add("Text", this, "MainFont", false, DataSourceUpdateMode.OnPropertyChanged);
trkOpacity.DataBindings.Add("Value", this, "Opacity", false, DataSourceUpdateMode.OnPropertyChanged);
cmbGradientType.DataBindings.Add("SelectedItem", this, "GradientString", false, DataSourceUpdateMode.OnPropertyChanged);
cmbGradientType.SelectedIndexChanged += cmbGradientType_SelectedIndexChanged;
}
示例5: CanAccept
public bool CanAccept(ILayout layout, IView view)
{
IEnumerable<string> acceptableViewNames = (IEnumerable<string>)acceptableViewNamesPerLayout[layout.Name];
if (acceptableViewNames == null)
return layout.Name == view.Name;
return acceptableViewNames.Contains(view.Name);
}
示例6: CreateLayoutNode
public int CreateLayoutNode(XmlDocument document, XmlElement parent, ILayout layout)
{
XmlElement element = null, components = null;
if (document != null)
{
element = document.CreateElement("Settings");
components = document.CreateElement("Components");
}
var hashCode = SettingsHelper.CreateSetting(document, parent, "Mode", layout.Mode)
^ SettingsHelper.CreateSetting(document, parent, "X", layout.X)
^ SettingsHelper.CreateSetting(document, parent, "Y", layout.Y)
^ SettingsHelper.CreateSetting(document, parent, "VerticalWidth", layout.VerticalWidth)
^ SettingsHelper.CreateSetting(document, parent, "VerticalHeight", layout.VerticalHeight) * 1000
^ SettingsHelper.CreateSetting(document, parent, "HorizontalWidth", layout.HorizontalWidth)
^ SettingsHelper.CreateSetting(document, parent, "HorizontalHeight", layout.HorizontalHeight) * 1000
^ ToElement(document, element, layout.Settings);
if (document != null)
{
parent.AppendChild(element);
parent.AppendChild(components);
}
var layoutComponents = new List<ILayoutComponent>(layout.LayoutComponents);
var count = 1;
foreach (var component in layoutComponents)
{
try
{
if (document != null)
{
var componentElement = document.CreateElement("Component");
components.AppendChild(componentElement);
SettingsHelper.CreateSetting(document, componentElement, "Path", component.Path);
var settings = document.CreateElement("Settings");
settings.InnerXml = component.Component.GetSettings(document).InnerXml;
componentElement.AppendChild(settings);
}
else
{
var type = component.Component.GetType();
if (type.GetMethod("GetSettingsHashCode") != null)
hashCode ^= ((dynamic)component.Component).GetSettingsHashCode() ^ component.GetHashCode() * count;
else
hashCode ^= component.Component.GetSettings(new XmlDocument()).InnerXml.GetHashCode() ^ component.GetHashCode() * count;
}
}
catch (Exception e)
{
Log.Error(e);
}
count++;
}
return hashCode;
}
示例7: TextBoxBaseAppender
public TextBoxBaseAppender(ThreadSafeTextBoxWrapper textboxWrapper, ILayout layout)
{
if (textboxWrapper == null) throw new ArgumentNullException("textboxWrapper");
controlWrapper = textboxWrapper;
isRichTextBox = (controlWrapper is ThreadSafeRichTextBoxWrapper);
base.Layout = layout ?? new PatternLayout(defaultLayout);
}
示例8: RepeatedObject
/// <summary>
/// Constructs a group of objects to a layout
/// </summary>
/// <param name="layout">Layout used to print objects</param>
/// <param name="obj">Object to print</param>
/// <param name="times">Times to print</param>
public RepeatedObject(ILayout layout, object obj, int times) : base(layout)
{
if (times < 0)
throw new ArgumentException("Times cannot be negative!", "times");
this.obj = obj;
this.times = times;
}
示例9: LayoutViewModel
public LayoutViewModel(ILayout entity)
{
HeadHtml = entity.HeadHtml;
HeadStyles = entity.HeadStyles;
HeadScripts = entity.HeadScripts;
BodyHtmlPreContent = entity.BodyHtmlPreContent;
BodyHtmlPostContent = entity.BodyHtmlPostContent;
BodyScripts = entity.BodyScripts;
}
示例10: SetLayout
public void SetLayout(ILayout newLayout)
{
_layout = newLayout;
foreach (IWindow window in Windows)
{
_layout.AddWindowsWithoutTile(window);
}
_layout.Domain = Domain;
_layout.Tile();
}
示例11: Save
public void Save(ILayout layout, Stream stream)
{
var document = new XmlDocument();
XmlNode docNode = document.CreateXmlDeclaration("1.0", "UTF-8", null);
document.AppendChild(docNode);
document.AppendChild(GetLayoutNode(document, layout));
document.Save(stream);
}
示例12: Layout
protected Layout (Generator g, Container container, Type type, bool initialize = true)
: base(g, type, false)
{
handler = (ILayout)Handler;
this.container = container;
if (initialize) {
Initialize ();
if (this.Container != null)
this.Container.Layout = this;
}
}
示例13: ArrangeLimit
private static void ArrangeLimit(ILayout limit, Action<Rect<double>> setPosition, Point<double> boxCompositionOrigin, Unit fs, List<Point<double>> positions, NonoverlappingRectangleCollectiοn resultLayout_fs)
{
Contract.Requires(limit != null);
NonoverlappingRectangleCollectiοn limitLayout = limit.Layout;
Rect<double> limitRect = limitLayout.Bounds.ToReferenceFramesRect(fs, positions.Count == 1 ? "lower limit" : "upper limit");
setPosition(limitRect);
Contract.Assert(limitRect.IsAssociatedWith(boxCompositionOrigin));
positions.Add(limitRect.TopLeft);
resultLayout_fs.Add(limitLayout, limitRect.HorizontalOrigin[boxCompositionOrigin.X][fs], limitRect.VerticalOrigin[boxCompositionOrigin.Y][fs]);
}
示例14: GetXmlString
internal static string GetXmlString(this LoggingEvent loggingEvent, ILayout layout = null)
{
string message = loggingEvent.RenderedMessage + Environment.NewLine + loggingEvent.GetExceptionString();
if (layout != null)
{
using (var w = new StringWriter())
{
layout.Format(w, loggingEvent);
message = w.ToString();
}
}
var logXml = new XElement(
"LogEntry",
new XElement("UserName", loggingEvent.UserName),
new XElement("TimeStamp",
loggingEvent.TimeStamp.ToString(CultureInfo.InvariantCulture)),
new XElement("ThreadName", loggingEvent.ThreadName),
new XElement("LoggerName", loggingEvent.LoggerName),
new XElement("Level", loggingEvent.Level),
new XElement("Identity", loggingEvent.Identity),
new XElement("Domain", loggingEvent.Domain),
new XElement("CreatedOn", DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)),
new XElement("RenderedMessage", message),
new XElement("Location", loggingEvent.LocationInformation.FullInfo)
);
if (loggingEvent.Properties != null && loggingEvent.Properties.Count > 0)
{
var props = loggingEvent.Properties;
if (props.Contains("AddPropertiesToXml"))
{
foreach (var k in props.GetKeys())
{
var key = k.Replace(":", "_")
.Replace("@", "_")
.Replace(".", "_");
logXml.Add(new XElement(key, props[k].ToString()));
}
}
}
if (loggingEvent.ExceptionObject != null)
{
logXml.Add(new XElement("Exception", loggingEvent.ExceptionObject.ToString()));
}
return logXml.ToString();
}
示例15: WindowManager
public WindowManager(PositionMarkerWindow positionMarkerWindow, ILayout layout)
{
this.layout = layout;
this.positionMarkerWindow = positionMarkerWindow;
WinEventWatcher.WindowMoving += OnWindowMoving;
WinEventWatcher.WindowMoveEnd += OnWindowMoveEnd;
WinEventWatcher.WindowClosed += OnWindowClosed;
WinEventWatcher.WindowMinimized += OnWindowMinimized;
WinEventWatcher.WindowRestored += OnWindowRestored;
WinEventWatcher.WindowSizing += OnWindowSizing;
MouseHelper.MouseMoved += OnMouseMoved;
}