当前位置: 首页>>代码示例>>C#>>正文


C# LayoutMode类代码示例

本文整理汇总了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;
        }
开发者ID:0xwas,项目名称:LiveSplit.Text,代码行数:28,代码来源:TextComponent.cs

示例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);
            }
        }
开发者ID:xarrez,项目名称:LiveSplit,代码行数:28,代码来源:AutoSplitComponent.cs

示例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;
        }
开发者ID:cybnetsurfe3011,项目名称:LiveSplit.OriAndTheBlindForest,代码行数:11,代码来源:Component.cs

示例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;
        }
开发者ID:0xwas,项目名称:LiveSplit.CurrentComparison,代码行数:12,代码来源:CurrentComparison.cs

示例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);
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:14,代码来源:AudioMixerWindow.cs

示例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);
        }
开发者ID:sirgebet,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:15,代码来源:Component.cs

示例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;
     }
 }
开发者ID:Glurmo,项目名称:LiveSplit,代码行数:16,代码来源:InfoTextComponent.cs

示例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;
     }
 }
开发者ID:PrototypeAlpha,项目名称:LiveSplit,代码行数:17,代码来源:InfoTimeComponent.cs

示例9: Update

        public override void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
        {

        }
开发者ID:glasnonck,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:4,代码来源:Component.cs

示例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);
 }
开发者ID:0xwas,项目名称:LiveSplit.Graph,代码行数:5,代码来源:GraphCompositeComponent.cs

示例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();
     }
 }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:10,代码来源:XSSFManualLayout.cs

示例12: SetWidthMode

 public void SetWidthMode(LayoutMode mode)
 {
     if (!layout.IsSetWMode())
     {
         layout.AddNewWMode();
     }
     layout.wMode.val = fromLayoutMode(mode);
 }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:8,代码来源:XSSFManualLayout.cs

示例13: Update

 public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
 {
     invalidator.Invalidate(0, 0, width, height);
 }
开发者ID:xarrez,项目名称:LiveSplit,代码行数:4,代码来源:LineComponent.cs

示例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;
        }
开发者ID:xarrez,项目名称:LiveSplit,代码行数:17,代码来源:ComponentRenderer.cs

示例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);
        }
开发者ID:xarrez,项目名称:LiveSplit,代码行数:47,代码来源:ComponentRenderer.cs


注:本文中的LayoutMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。