本文整理汇总了C#中LayoutMode类的典型用法代码示例。如果您正苦于以下问题:C# LayoutMode类的具体用法?C# LayoutMode怎么用?C# LayoutMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutMode类属于命名空间,在下文中一共展示了LayoutMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareDraw
private void PrepareDraw(LiveSplitState state, LayoutMode mode)
{
InternalComponent.DisplayTwoRows = Settings.Display2Rows;
InternalComponent.NameLabel.HasShadow
= InternalComponent.ValueLabel.HasShadow
= state.LayoutSettings.DropShadows;
if (String.IsNullOrEmpty(Settings.Text1) || String.IsNullOrEmpty(Settings.Text2))
{
InternalComponent.NameLabel.HorizontalAlignment = StringAlignment.Center;
InternalComponent.ValueLabel.HorizontalAlignment = StringAlignment.Center;
InternalComponent.NameLabel.VerticalAlignment = StringAlignment.Center;
InternalComponent.ValueLabel.VerticalAlignment = StringAlignment.Center;
}
else
{
InternalComponent.NameLabel.HorizontalAlignment = StringAlignment.Near;
InternalComponent.ValueLabel.HorizontalAlignment = StringAlignment.Far;
InternalComponent.NameLabel.VerticalAlignment =
mode == LayoutMode.Horizontal || Settings.Display2Rows ? StringAlignment.Near : StringAlignment.Center;
InternalComponent.ValueLabel.VerticalAlignment =
mode == LayoutMode.Horizontal || Settings.Display2Rows ? StringAlignment.Far : StringAlignment.Center;
}
InternalComponent.NameLabel.ForeColor = Settings.OverrideTextColor ? Settings.TextColor : state.LayoutSettings.TextColor;
InternalComponent.ValueLabel.ForeColor = Settings.OverrideTimeColor ? Settings.TimeColor : state.LayoutSettings.TextColor;
}
示例2: Update
public override void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode)
{
if (state.CurrentPhase == TimerPhase.NotRunning)
{
if (AutoSplitter.ShouldStart(state))
{
Model.Start();
}
}
else if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
{
if (AutoSplitter.ShouldReset(state))
{
Model.Reset();
return;
}
else if (AutoSplitter.ShouldSplit(state))
{
Model.Split();
}
state.IsGameTimePaused = AutoSplitter.IsGameTimePaused(state);
var gameTime = AutoSplitter.GetGameTime(state);
if (gameTime != null)
state.SetGameTime(gameTime);
}
}
示例3: PrepareDraw
private void PrepareDraw(LiveSplitState state, LayoutMode mode) {
textInfo.DisplayTwoRows = true;
textInfo.NameLabel.HasShadow = textInfo.ValueLabel.HasShadow = state.LayoutSettings.DropShadows;
textInfo.NameLabel.HorizontalAlignment = StringAlignment.Far;
textInfo.ValueLabel.HorizontalAlignment = StringAlignment.Far;
textInfo.NameLabel.VerticalAlignment = StringAlignment.Near;
textInfo.ValueLabel.VerticalAlignment = StringAlignment.Near;
textInfo.NameLabel.ForeColor = state.LayoutSettings.TextColor;
textInfo.ValueLabel.ForeColor = state.LayoutSettings.TextColor;
}
示例4: PrepareDraw
private void PrepareDraw(LiveSplitState state, LayoutMode mode)
{
InternalComponent.DisplayTwoRows = Settings.Display2Rows;
InternalComponent.NameLabel.HasShadow
= InternalComponent.ValueLabel.HasShadow
= state.LayoutSettings.DropShadows;
InternalComponent.ValueLabel.Font = state.LayoutSettings.TextFont;
InternalComponent.NameLabel.ForeColor = Settings.OverrideTextColor ? Settings.TextColor : state.LayoutSettings.TextColor;
InternalComponent.ValueLabel.ForeColor = Settings.OverrideTimeColor ? Settings.TimeColor : state.LayoutSettings.TextColor;
}
示例5: AudioMixerWindow
public AudioMixerWindow()
{
SectionType[] typeArray1 = new SectionType[4];
typeArray1[1] = SectionType.SnapshotList;
typeArray1[2] = SectionType.GroupTree;
typeArray1[3] = SectionType.ViewList;
this.m_SectionOrder = typeArray1;
this.m_LayoutMode = LayoutMode.Vertical;
this.m_ShowReferencedBuses = true;
this.m_SectionsScrollPosition = Vector2.zero;
this.m_RepaintCounter = 2;
this.m_GroupsRenderedAboveSections = true;
this.m_Ticker = new TickTimerHelper(0.05);
}
示例6: Update
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
if ((Settings.ScriptPath != OldScriptPath && !String.IsNullOrEmpty(Settings.ScriptPath)) || DoReload)
{
Script = ASLParser.Parse(File.ReadAllText(Settings.ScriptPath));
OldScriptPath = Settings.ScriptPath;
FSWatcher.Path = Path.GetDirectoryName(Settings.ScriptPath);
FSWatcher.Filter = Path.GetFileName(Settings.ScriptPath);
FSWatcher.EnableRaisingEvents = true;
DoReload = false;
}
if (Script != null)
Script.Update(state);
}
示例7: PrepareDraw
public virtual void PrepareDraw(LiveSplitState state, LayoutMode mode)
{
NameMeasureLabel.Font = state.LayoutSettings.TextFont;
ValueLabel.Font = state.LayoutSettings.TextFont;
NameLabel.Font = state.LayoutSettings.TextFont;
if (mode == LayoutMode.Vertical)
{
NameLabel.VerticalAlignment = StringAlignment.Center;
ValueLabel.VerticalAlignment = StringAlignment.Center;
}
else
{
NameLabel.VerticalAlignment = StringAlignment.Near;
ValueLabel.VerticalAlignment = StringAlignment.Far;
}
}
示例8: PrepareDraw
public override void PrepareDraw(Model.LiveSplitState state, LayoutMode mode)
{
ValueLabel.IsMonospaced = true;
ValueLabel.Font = state.LayoutSettings.TimesFont;
NameMeasureLabel.Font = state.LayoutSettings.TextFont;
NameLabel.Font = state.LayoutSettings.TextFont;
if (mode == LayoutMode.Vertical)
{
NameLabel.VerticalAlignment = StringAlignment.Center;
ValueLabel.VerticalAlignment = StringAlignment.Center;
}
else
{
NameLabel.VerticalAlignment = StringAlignment.Near;
ValueLabel.VerticalAlignment = StringAlignment.Far;
}
}
示例9: Update
public override void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
}
示例10: Update
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
if (invalidator != null)
InternalComponent.Update(invalidator, state, width, height, mode);
}
示例11: fromLayoutMode
private ST_LayoutMode fromLayoutMode(LayoutMode mode)
{
switch (mode)
{
case LayoutMode.Edge: return ST_LayoutMode.edge;
case LayoutMode.Factor: return ST_LayoutMode.factor;
default:
throw new ArgumentException();
}
}
示例12: SetWidthMode
public void SetWidthMode(LayoutMode mode)
{
if (!layout.IsSetWMode())
{
layout.AddNewWMode();
}
layout.wMode.val = fromLayoutMode(mode);
}
示例13: Update
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
invalidator.Invalidate(0, 0, width, height);
}
示例14: Update
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
var oldTransform = invalidator.Transform.Clone();
var scaleFactor = mode == LayoutMode.Vertical
? height / OverallHeight
: width / OverallWidth;
for (var ind = 0; ind < VisibleComponents.Count(); ind++)
{
var component = VisibleComponents.ElementAt(ind);
if (mode == LayoutMode.Vertical)
InvalidateVerticalComponent(ind, state, invalidator, width, height, scaleFactor);
else
InvalidateHorizontalComponent(ind, state, invalidator, width, height, scaleFactor);
}
invalidator.Transform = oldTransform;
}
示例15: Render
public void Render(Graphics g, LiveSplitState state, float width, float height, LayoutMode mode, Region clipRegion)
{
if (!errorInComponent)
{
try
{
var clip = g.Clip;
var transform = g.Transform;
var crashedComponents = new List<IComponent>();
var index = 0;
var totalSize = 0f;
foreach (var component in VisibleComponents)
{
try
{
g.Clip = clip;
if (mode == LayoutMode.Vertical)
DrawVerticalComponent(index, g, state, width, height, clipRegion);
else
DrawHorizontalComponent(index, g, state, width, height, clipRegion);
}
catch (Exception e)
{
Log.Error(e);
crashedComponents.Add(component);
errorInComponent = true;
}
index++;
}
if (crashedComponents.Count > 0)
{
var remainingComponents = VisibleComponents.ToList();
crashedComponents.ForEach(x => remainingComponents.Remove(x));
//crashedComponents.ForEach(x => MessageBox.Show(String.Format("The component {0} crashed.", x.ComponentName), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error));
VisibleComponents = remainingComponents;
}
g.Transform = transform;
g.Clip = clip;
}
finally
{
errorInComponent = false;
}
}
CalculateOverallHeight(mode);
}