private LayoutType JsonTagToLayoutType(string tag)
        {
            LayoutType type = LayoutType.Blank;

            switch (tag)
            {
            case FocusJsonTag:
                type = LayoutType.Focus;
                break;

            case ColumnsJsonTag:
                type = LayoutType.Columns;
                break;

            case RowsJsonTag:
                type = LayoutType.Rows;
                break;

            case GridJsonTag:
                type = LayoutType.Grid;
                break;

            case PriorityGridJsonTag:
                type = LayoutType.PriorityGrid;
                break;

            case CustomJsonTag:
                type = LayoutType.Custom;
                break;
            }

            return(type);
        }
        private bool SetTemplateLayouts(List <TemplateLayoutWrapper> templateLayouts)
        {
            if (templateLayouts == null)
            {
                return(false);
            }

            foreach (var wrapper in templateLayouts)
            {
                LayoutType  type   = JsonTagToLayoutType(wrapper.Type);
                LayoutModel layout = MainWindowSettingsModel.DefaultModels[(int)type];

                layout.SensitivityRadius = wrapper.SensitivityRadius;
                layout.TemplateZoneCount = wrapper.ZoneCount;

                if (layout is GridLayoutModel grid)
                {
                    grid.ShowSpacing = wrapper.ShowSpacing;
                    grid.Spacing     = wrapper.Spacing;
                }

                layout.InitTemplateZones();
            }

            return(true);
        }
Exemple #3
0
        private void IncrSpace(LayoutType type)
        {
            IDrawObj last  = _controlPoint.SelectObjs.LastSelectedObj;
            int      count = _selectedObjs.Count;

            List <IDrawObj> sorts = new List <IDrawObj>(_selectedObjs);

            SortList(sorts, type);

            int lastIndex = sorts.IndexOf(last);

            for (int i = 0; i < count; i++)
            {
                IDrawObj   obj   = sorts[i];
                int        index = i - lastIndex;
                RectangleF rf    = obj.Rect;
                if (type == LayoutType.Left)
                {
                    rf.X += index * MoveSize;
                }
                else if (type == LayoutType.Top)
                {
                    rf.Y += index * MoveSize;
                }
                obj.Rect = rf;
            }
            _controlPoint.CalculateAndInvalidate();
        }
 public CanvasLayoutModel(string uuid, string name, LayoutType type, IList <Int32Rect> zones, int width, int height)
     : base(uuid, name, type)
 {
     Zones             = zones;
     TemplateZoneCount = Zones.Count;
     CanvasRect        = new Rect(new Size(width, height));
 }
Exemple #5
0
 public static void SetSize(LayoutType layoutType, RectTransform rt)
 {
     if (layoutType == LayoutType.Full)
     {
         rt.sizeDelta = new Vector3(ScreenWidth, ScreenHeight);
     }
 }
Exemple #6
0
        private void ChangeDataTemplate(LayoutType layoutType)
        {
            switch (layoutType)
            {
            case LayoutType.Thumbnail:
            {
                this.FileListboxDataTemplate = General.FindResource <DataTemplate>(Properties.Resources.FileDataTemplate_Thumbnail);
                break;
            }

            case LayoutType.Tile:
            {
                this.FileListboxDataTemplate = General.FindResource <DataTemplate>(Properties.Resources.FileDataTemplate_Tile);
                break;
            }

            case LayoutType.List:
            {
                this.FileListboxDataTemplate = General.FindResource <DataTemplate>(Properties.Resources.FileDataTemplate_List);
                break;
            }

            default:
            {
                break;
            }
            }
            this.RaisePropertyChanged(nameof(this.FileListboxDataTemplate));
        }
Exemple #7
0
        private void chooseLayoutToolStripComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            int    selectedIndex = this.chooseLayoutToolStripComboBox.SelectedIndex;
            string value         = this.chooseLayoutToolStripComboBox.Items[selectedIndex] as string;

            switch (value)
            {
            case "One Picture ":
                this.currentLayout = LayoutType.OnePicture;
                break;

            case "Two Horizontal Splited Pictures":
                this.currentLayout = LayoutType.TwoHorizontalPictures;
                break;

            case "Two Vertical Splited  Pictures":
                this.currentLayout = LayoutType.TwoVerticalPictures;
                break;

            case "Four Pictures":
                this.currentLayout = LayoutType.FourPictures;
                break;
            }

            this.PositionViews();
        }
Exemple #8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal LayoutElement(string name, LayoutType type, bool isAbstract, string superClassName)
 {
     this.name = name;
     this.type = type;
     this.isAbstract = isAbstract;
     this.superClassName = superClassName;
 }
 public ParserSettings(char fieldDelimiter, char textQualifier, bool firstRowIsHeaders = false)
 {
     _firstRowIsHeaders = firstRowIsHeaders;
     _layout            = LayoutType.Delimited;
     _fieldDelimiter    = fieldDelimiter;
     _textQualifier     = textQualifier;
 }
 /// <summary>
 /// Creates a LayoutMember with the specified values.
 /// </summary>
 public LayoutMember(LayoutType type, LayoutSemantic semantic, int index = 0, int unk00 = 0)
 {
     Unk00    = unk00;
     Type     = type;
     Semantic = semantic;
     Index    = index;
 }
Exemple #11
0
        private void PostInitialize()
        {
            this.topLeft.MainForm                       = this;
            this.topRight.MainForm                      = this;
            this.bottomLeft.MainForm                    = this;
            this.bottomRight.MainForm                   = this;
            this.toolStripPenWidth.SelectedIndex        = 0;
            this.toolStripComboBoxSeconds.SelectedIndex = 0;
            this.currentLayout           = LayoutType.TwoVerticalPictures;
            this.currentView             = this.topLeft;
            this.currentView.BorderStyle = BorderStyle.None;
            this.currentView.Padding     = new Padding(2);
            this.chooseLayoutToolStripComboBox.Items.AddRange(new string[] {
                "One Picture ",
                "Two Horizontal Splited Pictures",
                "Two Vertical Splited  Pictures",
                "Four Pictures"
            });
            this.toolStripPenWidth.SelectedIndex = 2;
            this.BrushSize = 3;
            this.chooseLayoutToolStripComboBox.SelectedIndex = 2;
            this.PositionViews();

            string path = DriveInfo.GetDrives().First(x => x.DriveType == DriveType.Fixed).Name;

            if (string.IsNullOrEmpty(Settings.Default.ExportPath))
            {
                Settings.Default.ExportPath = Path.Combine(path, "export");
            }
            if (string.IsNullOrEmpty(Settings.Default.PublishPath))
            {
                Settings.Default.PublishPath = Path.Combine(path, "publish");
            }
        }
Exemple #12
0
        public IActionResult CreateLayoutType([FromBody] LayoutType layoutType)
        {
            try
            {
                if (layoutType == null || string.IsNullOrEmpty(layoutType.Name))
                {
                    return(BadRequest("Invalid parameter"));
                }

                if (_layoutTypeRepository.GetLayoutType(layoutType.Name) != null)
                {
                    return(BadRequest("Layout type already exist"));
                }

                var result = _layoutTypeRepository.CreateLayoutType(layoutType);
                if (result != null)
                {
                    return(Ok(result));
                }
                return(NotFound());
            }
            catch (Exception ex)
            {
                _logger.LogError(string.Format("Error occured while creating layout type"), ex);
                return(new StatusCodeResult(StatusCodes.Status500InternalServerError));
            }
        }
        private void HandleChangeLayout(LayoutType type)
        {
            var id    = -1;
            var model = new ResultModel();

            switch (type)
            {
            case LayoutType.LinearLayout:
                id         = _linearResourceId;
                model.Type = ViewType.LinearLayout;
                RunOnUiThread(() => _label.Text = Constants.LinearLayout);
                break;

            case LayoutType.RelativeLayout:
                id         = _relativeResourceId;
                model.Type = ViewType.RelativeLayout;
                RunOnUiThread(() => _label.Text = Constants.RelativeLayout);
                break;
            }

            var fragment = new ContentFragment(id);

            void handler(ContentFragment sender)
            {
                fragment.ViewCreated -= handler;
                model.ElapsedTime     = sender.ElapsedTime;
                model.ElapsedMemory   = sender.ElapsedMemory;
                UpdateResults(model);
            }

            fragment.ViewCreated += handler;

            ShowFragment(fragment);
        }
        AddMenuItem
        (
            ToolStripDropDownItem oParentDropDownItem,
            LayoutType eLayoutType,
            String sMenuText,
            String sToolTipText
        )
        {
            Debug.Assert(oParentDropDownItem != null);
            Debug.Assert(!String.IsNullOrEmpty(sMenuText));
            Debug.Assert(!String.IsNullOrEmpty(sToolTipText));
            AssertValid();

            ToolStripMenuItem oMenuItem = new ToolStripMenuItem();

            oMenuItem.Name        = sMenuText;
            oMenuItem.Tag         = eLayoutType;
            oMenuItem.Text        = sMenuText;
            oMenuItem.ToolTipText = sToolTipText;
            oMenuItem.Click      += new System.EventHandler(this.MenuItem_Click);

            oParentDropDownItem.DropDownItems.Add(oMenuItem);

            return(oMenuItem);
        }
Exemple #15
0
        public CloudControl()
        {
            this.InitializeComponent();

            m_MinWordWeight = 0;
            m_MaxWordWeight = 0;

            MaxFontSize = 68;
            MinFontSize = 10;

            m_Palette    = m_DefaultPalette;
            m_BackColor  = Colors.White;
            m_LayoutType = LayoutType.Spiral;

            try {
                CanvasDevice device = CanvasDevice.GetSharedDevice();

                //Size restrictions descriped in : http://microsoft.github.io/Win2D/html/P_Microsoft_Graphics_Canvas_CanvasDevice_MaximumBitmapSizeInPixels.htm

                float useHeight = (float)Win2DCanvas.ActualHeight > device.MaximumBitmapSizeInPixels ? device.MaximumBitmapSizeInPixels : (float)Win2DCanvas.ActualHeight;
                float useWidth  = (float)Win2DCanvas.ActualWidth > device.MaximumBitmapSizeInPixels ? device.MaximumBitmapSizeInPixels : (float)Win2DCanvas.ActualWidth;

                _DrawingCanvas = new CanvasRenderTarget(device, useWidth, useHeight, 96);
            }catch (Exception ex)
            {
                Debug.WriteLine("CloudControl constructor exception : " + ex.Message);
            }
        }
Exemple #16
0
    public void Init(BaseInputData inputData, float inputDelay)
    {
        _inputData     = inputData;
        _currentLayout = _inputData.DefaultLayout;

        _moveInputDelay = inputDelay;

        _directionEntries = new Dictionary <MoveDirection, InputEntry>();
        foreach (var mapping in _inputData.Layouts[(int)_currentLayout].Mappings)
        {
            _directionEntries.Add(mapping.MoveDir, new InputEntry(mapping.KeyCode, _moveInputDelay));
        }

        idle          = new InputEntry(KeyCode.Space, _moveInputDelay);
        actionCancel  = new InputEntry(KeyCode.Escape, _moveInputDelay);
        actionConfirm = new InputEntry(KeyCode.Return, _moveInputDelay);

        rangeTarget = new InputEntry(KeyCode.J, _moveInputDelay);


        NumbersPressed = new bool[_inputData.NumberKeys];
        NumbersPressed.Fill <bool>(false);
        StartKeyCode = KeyCode.Alpha1;

        DoInit();
    }
Exemple #17
0
        private System.Data.DataTable GetTableList(ExcelHelp xls, LayoutType layoutType)
        {
            string sheetName       = "";
            string tableNameCol    = "";
            string tableDisplayCol = "";
            string commentCol      = "";
            int    startRow        = 0;

            switch (layoutType)
            {
            case LayoutType.Live:
                sheetName       = "テーブル一覧";
                tableNameCol    = "AJ";
                tableDisplayCol = "J";
                commentCol      = "T";
                startRow        = 5;
                break;

            default:
                sheetName       = "テーブル一覧(Live)";
                tableNameCol    = "F";
                tableDisplayCol = "J";
                commentCol      = "S";
                startRow        = 5;
                break;
            }
            return(xls.GetTableData(sheetName,
                                    new string[] { tableNameCol, tableDisplayCol, commentCol },
                                    new string[] { "TableName", "DisplayName", "Comment" },
                                    startRow));
        }
Exemple #18
0
 public void CreateDBScript(LayoutType layout, string tableLayoutFile, ScriptOptions opt)
 {
     base.Report(Resource.StringTable.Messages.OpenDesignFile);
     using (ExcelHelp xls = new ExcelHelp(tableLayoutFile))
     {
         //int sheectCount = xls.WorkBook.Sheets.Count;
         base.Report(Resource.StringTable.Messages.ReadingTableList);
         System.Data.DataTable dttList = GetTableList(layout);
         //System.Data.DataTable dttList = GetTableList(xls,layout );
         base.SetStep(dttList.Rows.Count, Resource.StringTable.Messages.CreatingSqlScript);
         foreach (System.Data.DataRow row in dttList.Rows)
         {
             string sheetName = Utility.DBToString(row["DisplayName"]);
             string tabName   = Utility.DBToString(row["TableName"]);
             try
             {
                 TableLayoutInfo tableInfo = ReadTableLayout(xls, sheetName, layout);
                 //Script出力
                 CreateSqlScript(opt, tableInfo);
                 ReportStep(Resource.StringTable.Messages.CreatedTableSqlScript, tableInfo.DisplayName, tableInfo.TableName);
             }
             catch (Exception ex)
             {
                 Logging.WriteLine("/*");
                 Logging.WriteLine(Resource.StringTable.Messages.ScriptCreateFailed, sheetName, tabName);
                 Logging.Exception("", ex);
                 Logging.WriteLine("*/");
             }
         }
         Report(Resource.StringTable.Messages.ProcessFinished);
         xls.Close();
     }
 }
Exemple #19
0
 public Layout(Handler handler, RECT surface, LayoutType type, Container parent) : base(ContainerTypes.Layout, handler, surface, parent)
 {
     CanContainWindows = true;
     Surface           = surface;
     Type       = type;
     Containers = new List <Container>();
 }
Exemple #20
0
 internal CardConfig(ComponentPalette palette, FontType font, LayoutType layout)
 {
     Palette = palette ?? new ComponentPalette(PaletteType.Default);
     Font    = font;
     Font    = font;
     Layout  = layout;
 }
Exemple #21
0
 /// <summary>
 /// データベース作成用SQL文を生成する
 /// </summary>
 /// <param name="designFileName"></param>
 /// <param name="layoutType"></param>
 private void DoCreateSqlScript(string designFileName, LayoutType layoutType)
 {
     try
     {
         ScriptOptions opts;
         if (layoutType == LayoutType.Live)
         {
             Logging.OutputFileName = "LiveDBCreater.sql";
             opts = ScriptOptions.DropTables | ScriptOptions.CreateTables |
                    ScriptOptions.CreateDropDescriptions | ScriptOptions.DropDropDescriptions;
         }
         else
         {
             Logging.OutputFileName = "SeedDBCreater.sql";
             opts = ScriptOptions.CreateTables | ScriptOptions.DropTables |
                    ScriptOptions.CreateDropDescriptions | ScriptOptions.DropDropDescriptions;
         }
         TableCreator creator = new TableCreator(reportHandler);
         creator.CreateDBScript(layoutType, designFileName, opts);
     }
     finally
     {
         Logging.OutputFileName = "";
     }
 }
        public void Initialize(LayoutType tabType, string name)
        {
            _name   = name;
            TabType = tabType;

            if (TabType == LayoutType.Layout)
            {
                NewTabBtnVisibility    = Visibility.Collapsed;
                RemoveTabBtnVisibility = Visibility.Visible;

                SelectedApps = new List <AppInfo>(GridSize.CellCount);
                for (int i = 0; i < GridSize.CellCount; i++)
                {
                    SelectedApps.Add(AppInfo.GetEmptyAppInfo());
                }
            }
            else if (tabType == LayoutType.CreateNewTab) //new tab button - should not be serialized
            {
                NewTabBtnVisibility    = Visibility.Visible;
                RemoveTabBtnVisibility = Visibility.Collapsed;
            }
            else if (TabType == LayoutType.Serializable)
            {
                //tabs config from serialization
                NewTabBtnVisibility    = Visibility.Collapsed;
                RemoveTabBtnVisibility = Visibility.Visible;

                TabType = LayoutType.Layout; //loaded from serialization
            }
        }
        public bool Create(string fileName, string layoutName, LayoutType layoutType)
        {
            m_FileName = fileName;
            m_Layout   = new Layout();

            FrontSideLayout = new LayoutProperties()
            {
                Name            = layoutName,
                LayoutType      = layoutType,
                Size            = new System.Windows.Point(21, 14.8),
                BackgroundImage = LayoutFileReader.ImageToByte(Properties.Resources.DefaultBackground)
            };

            RearSideLayout = new LayoutProperties()
            {
                Name            = layoutName,
                LayoutType      = layoutType,
                Size            = new System.Windows.Point(21, 14.8),
                BackgroundImage = LayoutFileReader.ImageToByte(Properties.Resources.DefaultBackground)
            };

            try
            {
                Save();

                return(true);
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.TraceError(e.ToString());
                LastException = e;
            }

            return(false);
        }
Exemple #24
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal LayoutElement(string name, LayoutType type, bool isAbstract, string superClassName)
 {
     this.name           = name;
     this.type           = type;
     this.isAbstract     = isAbstract;
     this.superClassName = superClassName;
 }
        private string LayoutTypeToJsonTag(LayoutType type)
        {
            switch (type)
            {
            case LayoutType.Blank:
                return(BlankJsonTag);

            case LayoutType.Focus:
                return(FocusJsonTag);

            case LayoutType.Columns:
                return(ColumnsJsonTag);

            case LayoutType.Rows:
                return(RowsJsonTag);

            case LayoutType.Grid:
                return(GridJsonTag);

            case LayoutType.PriorityGrid:
                return(PriorityGridJsonTag);

            case LayoutType.Custom:
                return(CustomJsonTag);

            default:
                return(string.Empty);
            }
        }
Exemple #26
0
 public CanvasLayoutModel(string name, LayoutType type, int referenceWidth, int referenceHeight)
     : base(name, type)
 {
     // Initialize Reference Size
     _referenceWidth  = referenceWidth;
     _referenceHeight = referenceHeight;
 }
Exemple #27
0
 protected LayoutModel(string uuid, string name, LayoutType type)
     : this()
 {
     _guid = Guid.Parse(uuid);
     Name  = name;
     Type  = type;
 }
Exemple #28
0
 public CanvasLayoutModel(string uuid, string name, LayoutType type, int referenceWidth, int referenceHeight, IList <Int32Rect> zones)
     : base(uuid, name, type)
 {
     _referenceWidth  = referenceWidth;
     _referenceHeight = referenceHeight;
     Zones            = zones;
 }
Exemple #29
0
        public override bool SetProperty(string name, object value)
        {
            if (base.SetProperty(name, value))
            {
                return(true);
            }

            switch (name)
            {
            case "layout-type":
            case "layouttype":
                if (value.GetType() == typeof(LayoutType))
                {
                    _layoutType = (LayoutType)value;
                }
                else
                {
                    _layoutType = (LayoutType)System.Enum.Parse(typeof(LayoutType), value.ToString(), true);
                }

                return(true);

            default:
                return(false);
            }
        }
Exemple #30
0
        protected override async Task Main()
        {
            Deck = await JSRuntime.InvokeAsync <Deck>("GetDeck", UID);

            if (Deck == null)
            {
                NavigationManager.NavigateTo("/decks");
                return;
            }
            DeckName                    = Deck.Name;
            SearchDebouceTimer          = new Timer(600);
            SearchDebouceTimer.Elapsed += DebounceCallback;
            string savedLayout = await JSRuntime.InvokeAsync <string>("GetSetting", "cardLayout");

            if (!String.IsNullOrEmpty(savedLayout))
            {
                switch (savedLayout)
                {
                case "List":
                    Layout = LayoutType.List;
                    break;

                case "Card":
                    Layout = LayoutType.Card;
                    break;
                }
            }
            Types = await JSRuntime.InvokeAsync <string[]>("GetCardTypes");

            Subtypes = await JSRuntime.InvokeAsync <string[]>("GetCardSubtypes");

            Keywords = await JSRuntime.InvokeAsync <string[]>("GetCardKeywords");
            await SearchCards();
        }
Exemple #31
0
        public GXLogicCore(LayoutType layoutType, DisplayGraph graph)
        {
            switch (layoutType)
            {
            case LayoutType.TreeLayout:
                this.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.EfficientSugiyama;
                this.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.EfficientSugiyama);
                ((EfficientSugiyamaLayoutParameters)this.DefaultLayoutAlgorithmParams).LayerDistance = 150;
                ((EfficientSugiyamaLayoutParameters)this.DefaultLayoutAlgorithmParams).OptimizeWidth = false;
                //((EfficientSugiyamaLayoutParameters)LogicCore.DefaultLayoutAlgorithmParams).MinimizeEdgeLength = false;
                ((EfficientSugiyamaLayoutParameters)this.DefaultLayoutAlgorithmParams).EdgeRouting  = SugiyamaEdgeRoutings.Traditional;
                ((EfficientSugiyamaLayoutParameters)this.DefaultLayoutAlgorithmParams).PositionMode = 2;
                break;

            case LayoutType.GraphLayout:
                this.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog;
                this.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.LinLog);
                ((LinLogLayoutParameters)this.DefaultLayoutAlgorithmParams).Seed = 0;
                break;
            }

            this.DefaultOverlapRemovalAlgorithm       = OverlapRemovalAlgorithmTypeEnum.FSA;
            this.DefaultOverlapRemovalAlgorithmParams =
                this.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA);
            ((OverlapRemovalParameters)this.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50;
            ((OverlapRemovalParameters)this.DefaultOverlapRemovalAlgorithmParams).VerticalGap   = 50;

            this.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None;
            this.Graph = graph;
        }
Exemple #32
0
 public Layout(String origin, LayoutType type)
 {
     var stringHandler = new StringHandler(origin);
     this.type = type;
     if (type == LayoutType.Simple || type == LayoutType.Code || type == LayoutType.Image)
         this.origin = origin;
     else
         insideLayouts = stringHandler.Convert();
 }
Exemple #33
0
 public Layout(ViewContext view, LayoutType layoutType, GridSize layoutSize)
 {
     this.ViewContext = view;
     this.Component = new LayoutComponent();
     this.Component.HtmlProperties = new HtmlProperties(view, this.Component.GetType());
     this.Component.InnerHtml = String.Empty;
     this.ContainerElements = new Collection<ISushiComponentBuilder>();
     this.Component.Layout = layoutType;
     this.Component.LayoutSize = layoutSize;
 }
Exemple #34
0
 public static String ResolveLayout(LayoutType layoutType)
 {
     switch (layoutType)
     {
         case LayoutType.Fixed:
             return "fixed";
         case LayoutType.Fluid:
             return "row";
     }
     return "row";
 }
 public static void ShouldMoveIteratorInWord(String testedWord, int movesCount,
     LayoutType expectedType, String expectedWord, int expectedLastIndex)
 {
     var temp = new StringHandler(testedWord);
     for (int i = 0; i < movesCount; ++i)
         temp.MoveIterator();
     var result = temp.oneLevel.GetLastPair();
     Assert.AreEqual(expectedType, result.Item1);
     Assert.AreEqual(expectedWord, result.Item2);
     Assert.AreEqual(expectedLastIndex, temp._iterator);
 }
 public MyDocumentsView()
 {
     NavigationPage.SetBackButtonTitle (this, Translation.Localize ("BackButton"));
     BindingContext = new MyDocumentsViewModel ();
     ViewModel.IsRunning = true;
     CurrentLayout = LayoutType.ListLayout;
     SwitchLayouts (CurrentLayout);
     AddToolBarItems ();
     Instance = Instance;
     this.BackgroundImage = ImageConstants.backgroundImage;
 }
Exemple #37
0
 public void UpdateLayout(double height, double width)
 {
     if (ApplicationView.GetForCurrentView().Orientation == ApplicationViewOrientation.Landscape)
     {
         LayoutType = width > 800 ? LayoutType.Parallel : LayoutType.Overlay;
     }
     else
     {
         LayoutType = LayoutType.Overlay;
     }
 }
Exemple #38
0
	public void Setlayout (LayoutType layout)
	{
		if (prevLayout == LayoutType.GameOver)
			CameraMovement.instance.MoveToInitial();

		prevLayout = layout;
		rootLayout.SetActive(layout != LayoutType.Game);
		gameOverLayout.SetActive(layout == LayoutType.GameOver);
		mainMenuLayout.SetActive(layout == LayoutType.MainMenu);
		howToPlayLayout.SetActive(layout == LayoutType.HowToPlay);
		toMainMenuLayout.SetActive(layout != LayoutType.MainMenu);
		GameUI.instance.root.SetActive(layout == LayoutType.Game);
	}
        public static ILayout CrateLayout(LayoutType layoutType, SizeF size)
        {
            switch (layoutType)
            {
                case LayoutType.Typewriter:
                    return new TypewriterLayout(size);

                case LayoutType.Spiral:
                    return new SpiralLayout(size);
            
                default:
                    throw new ArgumentException(string.Format("No constructor specified to create a layout instance for {0}.", layoutType), "layoutType");
            }
        }
        public CloudControl()
        {
            m_MinWordWeight = 0;
            m_MaxWordWeight = 0;

            MaxFontSize = 68;
            MinFontSize = 6;
           
            this.BorderStyle = BorderStyle.FixedSingle;
            this.ResizeRedraw = true;
            
            m_Palette = m_DefaultPalette;
            m_BackColor = Color.White;
            m_LayoutType = LayoutType.Spiral;
        }
Exemple #41
0
 /// <summary>
 /// Parse an attr element into an <see cref="AttributeDescriptor"/>.
 /// </summary>
 private static LayoutElement Parse(XElement element, LayoutType type)
 {
     var name = GetName(element);
     var isAbstract = GetAbstract(element);
     var superClassName = GetSuperClassName(element);
     return new LayoutElement(name, type, isAbstract, superClassName);
 }
 public static void ShouldRightDetermineTypeOfWord(String testedWord, int index, 
     LayoutType expectedType, String expectedWord, int expectedLastIndex)
 {
     var temp = new StringHandler(testedWord);
     var result = temp.GetNextUnderbar(index);
     Assert.AreEqual(expectedType ,result.Type);
     Assert.AreEqual(expectedWord ,result.CleanedWord);
     Assert.AreEqual(expectedLastIndex, result.LastIndex);
 }
 private void LayoutChanged(LayoutType state)
 {
     _canCloseConversation = state == LayoutType.Overlay;
     ((DelegateCommand)CloseConversationCommand).RaiseCanExecuteChanged();
 }
Exemple #44
0
		public Control ()
		{
			if (WindowsFormsSynchronizationContext.AutoInstall)
				if (!(SynchronizationContext.Current is WindowsFormsSynchronizationContext))
					SynchronizationContext.SetSynchronizationContext (new WindowsFormsSynchronizationContext ());

			layout_type = LayoutType.Anchor;
			anchor_style = AnchorStyles.Top | AnchorStyles.Left;

			is_created = false;
			is_visible = true;
			is_captured = false;
			is_disposed = false;
			is_enabled = true;
			is_entered = false;
			layout_pending = false;
			is_toplevel = false;
			causes_validation = true;
			has_focus = false;
			layout_suspended = 0;
			mouse_clicks = 1;
			tab_index = -1;
			cursor = null;
			right_to_left = RightToLeft.Inherit;
			border_style = BorderStyle.None;
			background_color = Color.Empty;
			dist_right = 0;
			dist_bottom = 0;
			tab_stop = true;
			ime_mode = ImeMode.Inherit;
			use_compatible_text_rendering = true;
			show_keyboard_cues = false;
			show_focus_cues = SystemInformation.MenuAccessKeysUnderlined;
			use_wait_cursor = false;

			backgroundimage_layout = ImageLayout.Tile;
			use_compatible_text_rendering = Application.use_compatible_text_rendering;
			padding = this.DefaultPadding;
			maximum_size = new Size();
			minimum_size = new Size();
			margin = this.DefaultMargin;
			auto_size_mode = AutoSizeMode.GrowOnly;

			control_style = ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | 
					ControlStyles.Selectable | ControlStyles.StandardClick | 
					ControlStyles.StandardDoubleClick;
			control_style |= ControlStyles.UseTextForAccessibility;

			parent = null;
			background_image = null;
			text = string.Empty;
			name = string.Empty;

			window_target = new ControlWindowTarget(this);
			window = new ControlNativeWindow(this);
			child_controls = CreateControlsInstance();
			
			bounds.Size = DefaultSize;
			client_size = ClientSizeFromSize (bounds.Size);
			client_rect = new Rectangle (Point.Empty, client_size);
			explicit_bounds = bounds;
		}
Exemple #45
0
        private Layout GetModel(LayoutType type)
        {
            string directory = HostingEnvironment.MapPath(Configuration.GetCurrentThemePath());
            string path = directory;
            string name = "";

            switch (type)
            {
                case LayoutType.DefaultLayout:
                    name = "Master Layout";
                    path += "Layout.cshtml";
                    break;
                case LayoutType.HomepageLayout:
                    name = "Homepage Layout";
                    path += "Layout-Home.cshtml";
                    break;
                case LayoutType.Header:
                    name = "Header";
                    path += "Header.cshtml";
                    break;
                case LayoutType.Footer:
                    name = "Footer";
                    path += "Footer.cshtml";
                    break;
                case LayoutType.Http404Document:
                    name = "Http 404 Not Found Document";
                    path += "404.cshtml";
                    break;
            }

            if (path == null)
            {
                return new Layout
                {
                    Contents = ""
                };
            }

            string contents = System.IO.File.ReadAllText(path, Encoding.UTF8);

            return new Layout
            {
                Name =  name,
                Type= (int)type,
                Contents = contents
            };
        }
Exemple #46
0
 private LayoutInfo GetLayoutInfo(LayoutType layoutType, string imageRegionName, string textRegionName)
 {
     var layout = new LayoutInfo();
     layout.Rootlayout = new RootlayoutInfo("128", "128", string.Empty);
     if (layoutType == LayoutType.PicBottom)
     {
         var text = new RegionInfo { Id = textRegionName, Left = "0", Top = "70%", Height = "30%", Width = "128", Fit = FitType.Scroll };
         var image = new RegionInfo { Id = imageRegionName, Left = "0", Top = "0", Height = "70%", Width = "128", Fit = FitType.Meet };
         layout.RegionList.Add(text);
         layout.RegionList.Add(image);
     }
     else
     {
         var image = new RegionInfo { Id = imageRegionName, Left = "0", Top = "30%", Height = "70%", Width = "128", Fit = FitType.Meet };
         var text = new RegionInfo { Id = textRegionName, Left = "0", Top = "0", Height = "30%", Width = "128", Fit = FitType.Scroll };
         layout.RegionList.Add(image);
         layout.RegionList.Add(text);
     }
     return layout;
 }
        //*************************************************************************
        //  Method: OnLayoutMenuItemClick()
        //
        /// <summary>
        /// Handles the Click event on every drop-down ToolStripMenuItem that
        /// represents a layout type.
        /// </summary>
        ///
        /// <param name="sender">
        /// Standard event argument.
        /// </param>
        ///
        /// <param name="e">
        /// Standard event argument.
        /// </param>
        //*************************************************************************
        protected void OnLayoutMenuItemClick(
            object sender,
            EventArgs e
            )
        {
            AssertValid();

            Debug.Assert(sender is ToolStripMenuItem);
            ToolStripMenuItem oToolStripMenuItem = (ToolStripMenuItem)sender;

            Debug.Assert(oToolStripMenuItem.Tag is LayoutInfo);
            LayoutInfo oLayoutInfo = (LayoutInfo)oToolStripMenuItem.Tag;

            this.Layout = oLayoutInfo.Layout;
        }
        /// <summary>
        /// 消息处理函数
        /// </summary>
        /// <param name="m"></param>
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
                //更新状态自定义消息
                case (int)UserMessage.SHOW_DETAIL:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        this.detail.IPAddr = System.Text.Encoding.Default.GetString(tmp);
                        UdpIP = this.detail.IPAddr;
                        int i = findCount(UdpIP);
                        if (Machine_Status[i] == 6)
                        {
                            //当前C3门在禁用状态不可点击进入
                        }
                        else//非禁用状态可进入
                        {
                            detail.Dock = DockStyle.Fill;
                            this.Controls.Add(detail);
                            this.detail.BringToFront();
                            Times_flag = 1;
                        }
                        break;
                    }
                case (int)UserMessage.SHOW_LAYOUT:
                    {
                        if (layout4Btn.Checked)
                        {
                            this.layout4.BringToFront();
                            curLayout = LayoutType.LAYOUT_4;
                            UdpIP = "0.0.0.0";
                            Times_flag = 0;
                        }
                        else if (layout8Btn.Checked)
                        {
                            this.layout8.BringToFront();
                            curLayout = LayoutType.LAYOUT_8;
                            UdpIP = "0.0.0.0";
                            Times_flag = 0;
                        }
                        else if (layout16Btn.Checked)
                        {
                            this.layout16.BringToFront();
                            curLayout = LayoutType.LAYOUT_16;
                            UdpIP = "0.0.0.0";
                            Times_flag = 0;
                        }
                        break;
                    }
                case (int)UserMessage.UPDATE_UI:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ipAddr = System.Text.Encoding.Default.GetString(tmp);
                        updateUI(ipAddr);
                        break;
                    }
                case (int)UserMessage.UPDATE_STATISTIC:
                    {
                        int totalPass = 0;
                        int totalAlarm = 0;
                        for (int i = 0; i < MAX_MACHINES; i++)
                        {
                            totalPass += machines[i].PassageTimes;
                            totalAlarm += machines[i].AlarmTimes;
                        }

                        this.passTimes.Text = string.Format("通过次数: {0:G}", totalPass);
                        this.alarmTimes.Text = string.Format("报警次数: {0:G}", totalAlarm);
                        break;
                    }
                case (int)UserMessage.UPDATE_MACHINE_PARAM:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ipAddr = System.Text.Encoding.Default.GetString(tmp);
                        Machine machine = GetMachine(ipAddr);
                        paramForm.machine = machine;
                        paramForm.updateMachineParam();
                        break;
                    }
                case (int)UserMessage.UPDATE_DETECTOR_PARAM:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ipAddr = System.Text.Encoding.Default.GetString(tmp);
                        Machine machine = GetMachine(ipAddr);
                        paramForm.machine = machine;
                        paramForm.updateDetectorsParam();
                        break;
                    }

                case (int)UserMessage.UPDATE_MAIN_LOG:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string log = System.Text.Encoding.Default.GetString(tmp);
                        AddMsg(log);
                        break;
                    }
                case (int)UserMessage.ENTER_TRUST:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpIP = ip;

                        int i = findCount(TcpIP);

                        MainForm.tcpModule[i].ConnectToDevice(TcpIP);

                        tcpModule[i].SetMainHandle(this.Handle);
                        
                        break;
                    }
                case (int)UserMessage.EXIT_TRUST:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        int i = findCount(ip);

                        Update_flag[i] = 0;

                        Beat[i] = 0;

                        MachineControl umachine = findControl(ip);

                        updateUI(ip);

                        string message = "C3门\"" + Sixteen_Name[i] + "\"已下线";

                        if (umachine != null)
                        {
                            AddMsg(message);
                            TcpModule_index = i;
                            MainForm.protocol.DataEncoder("main", "get", "");
                            tcpModule[i].close();
                            umachine.ExitTrustUpdateMenu();
                            mainform.ControlBox = true;
                        }

                        break;
                    }
                case (int)UserMessage.PARAM_SET:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpModule_index = findCount(ip);

                        paramForm = new ParamForm();

                        paramForm.ShowDialog();
                        break;
                    }
                case (int)UserMessage.MEASURE_INFO:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpModule_index = findCount(ip);

                        measureInfoForm = new MeasureInfoForm();
                        measureInfoForm.ShowDialog();

                        break;
                    }
                case (int)UserMessage.DEVICE_TEST:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpModule_index = findCount(ip);

                        deviceTestForm = new DeviceTestForm();
                        deviceTestForm.ShowDialog();

                        break;
                    }
                case (int)UserMessage.FILE_MANAGE:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpModule_index = findCount(ip);

                        fileManageForm = new FileMangeForm();
                        fileManageForm.ShowDialog();

                        break;
                    }
                case (int)UserMessage.RADIO_SOURCE:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        TcpModule_index = findCount(ip);

                        radioSourceManage = new RadioSourceManage();
                        radioSourceManage.ShowDialog();

                        break;
                    }
                case (int)UserMessage.NOTIFY_ENTER_TRUST:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ip = System.Text.Encoding.Default.GetString(tmp);

                        MachineControl umachine = findControl(ip);

                        TcpModule_index = findCount(ip);
                        
                        if (umachine != null)
                        {
                            tcpModule[TcpModule_index].StartTcpThread();
                            protocol.DataEncoder("", "tuoguan", "");
                        }
                        break;
                    }
                case (int)UserMessage.NOTIFY_EXIT_TRUST:
                    {
                        byte[] tmp = new byte[(int)m.LParam];
                        Marshal.Copy(m.WParam, tmp, 0, (int)m.LParam);
                        string ipAddr = System.Text.Encoding.Default.GetString(tmp);
                        updateUI(ipAddr);
                        MachineControl umachine = findControl(ipAddr);
                        if (umachine != null)
                        {
                            umachine.ExitTrustUpdateMenu();
                        }
                        break;
                    }
                case (int)UserMessage.PASSALARM:
                    {
                        int Pass = (int)m.WParam;
                        int Alarm = (int)m.LParam;
                        passCount.Text = Pass.ToString();
                        alarmCount.Text = Alarm.ToString();
                        break;
                    }
                default:
                    {
                        base.DefWndProc(ref m);
                        break;
                    }
            }
        }
        void SwitchLayouts(LayoutType layoutType)
        {
            if (layoutType == LayoutType.ListLayout) {
                if (listView == null) {
                    listView = new ListView {
                        BackgroundColor = Color.White,
                        HasUnevenRows = true,
                        ItemTemplate = new DataTemplate (typeof(DocumentsCellTemplate)),
                        ItemsSource = ViewModel.ImageFiles,
                        SeparatorColor = Color.Transparent,
                    };
                    //listView.ItemsSource = ViewModel.Files;
                    listView.BackgroundColor = Color.Transparent;

                    listView.ItemTapped += (sender, e) => {
                        var fileItem = (Downloads)e.Item;
                        var page = new DocumentDetails (fileItem);
                        this.Navigation.PushAsync (page, true);
                    };
                }
                contentLayout = new StackLayout {
                    Children = {
                        listView,
                    }
                };

            } else {
                if (imageGrid == null) {
                    Device.OnPlatform (iOS: () => {
                        imageGrid = new GridView {
                            RowSpacing = 5,
                            Padding = 5,
                            ColumnSpacing = 5,
                            WidthRequest = App.ScreenWidth,
                            HeightRequest = App.ScreenHeight,
                            ItemWidth = UIConstants.GetGridViewItemWidths (),
                            ItemHeight = UIConstants.GetGridViewItemHeights (),
                            ItemsSource = ViewModel.ImageFiles,
                            ItemTemplate = new DataTemplate (typeof(GridViewCellTemplate)),
                        };
                    },
                        Android: () => {
                            imageGrid = new GridView {
                                Padding = 20,
                                RowSpacing = 20,
                                ColumnSpacing = 20,
                                ItemWidth = 500,
                                ItemHeight = 732,
                                ItemsSource = ViewModel.ImageFiles,
                                ItemTemplate = new DataTemplate (typeof(DynamicDocsTemplateLayout)),
                                IsClippedToBounds = true,
                            };
                        });

                    imageGrid.ItemSelected += (sender, e) => {
                        var fileItem = (Downloads)e.Value;
                        var page = new DocumentDetails (fileItem);
                        this.Navigation.PushAsync (page, true);
                    };
                } else {
                    imageGrid.WidthRequest = screenwidth;
                    imageGrid.HeightRequest = screenheight;
                }
                contentLayout = new StackLayout {
                    Children = {
                        imageGrid,
                    }
                };

            }
            this.Content = contentLayout;
        }
        void AddToolBarItems()
        {
            ToolbarItems.Add (new ToolbarItem ("DisplayView", ImageConstants.tiledIcon, () => {

                ViewModel.IsRunning = true;

                if (CurrentLayout == LayoutType.ListLayout) {
                    CurrentLayout = LayoutType.TiledLayout;
                    ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.listIcon;
                    SwitchLayouts (CurrentLayout);
                } else {
                    CurrentLayout = LayoutType.ListLayout;
                    ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.tiledIcon;
                    SwitchLayouts (CurrentLayout);
                }

                ViewModel.IsRunning = false;

            }));

            ToolbarItems.Add (
                new ToolbarItem ("LanguageFilter", ImageConstants.languageIcon, async () => {
                    var content = new NavigationPage (new DocumentsFilters (FilterTypes.Languages));
                    content.BarBackgroundColor = Color.Transparent;
                    content.BarTextColor = Color.White;
                    await Navigation.PushModalAsync (content, true);
                }));

            ToolbarItems.Add (new ToolbarItem ("CategoryFilter", ImageConstants.filterIcon, async () => {
                var content = new NavigationPage (new DocumentsFilters (FilterTypes.Categories));
                content.BarBackgroundColor = Color.Transparent;
                content.BarTextColor = Color.White;
                await Navigation.PushModalAsync (content, true);

            })
            );

            ToolbarItems.Add (new ToolbarItem ("SearchFilter", ImageConstants.searchIcon, async () => {
                var content = new SearchView (LibraryType.MyDocuments);
                await Navigation.PushAsync (content, true);
            })
            );
        }
Exemple #51
0
        //*************************************************************************
        //  Constructor: LayoutInfo()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="LayoutInfo" /> class.
        /// </summary>
        ///
        /// <param name="layout">
        /// Layout type.
        /// </param>
        ///
        /// <param name="menuText">
        /// Text to display in a menu item that represents the layout.  Must
        /// contain an ampersand that specifies the menu shortcut key.
        /// </param>
        ///
        /// <param name="description">
        /// Friendly description of the layout.
        /// </param>
        //*************************************************************************
        public LayoutInfo(
            LayoutType layout,
            String menuText,
            String description
            )
        {
            m_eLayout = layout;
            m_sMenuText = menuText;
            m_sDescription = description;

            AssertValid();
        }
Exemple #52
0
        //*************************************************************************
        //  Method: CreateLayout()
        //
        /// <summary>
        /// Creates a layout of a specified type.
        /// </summary>
        ///
        /// <param name="layoutType">
        /// The type of layout to create.
        /// </param>
        ///
        /// <returns>
        /// A layout of type <paramref name="layoutType" />.
        /// </returns>
        //*************************************************************************
        public static IAsyncLayout CreateLayout(
            LayoutType layoutType
            )
        {
            switch (layoutType)
            {
            case LayoutType.Circle:

                return ( new CircleLayout() );

            case LayoutType.Spiral:

                return ( new SpiralLayout() );

            case LayoutType.SinusoidHorizontal:

                return ( new SinusoidHorizontalLayout() );

            case LayoutType.SinusoidVertical:

                return ( new SinusoidVerticalLayout() );

            case LayoutType.Grid:

                return ( new GridLayout() );

            case LayoutType.FruchtermanReingold:

                return ( new FruchtermanReingoldLayout() );

            case LayoutType.Random:

                return ( new RandomLayout() );

            case LayoutType.Sugiyama:

                return ( new SugiyamaLayout() );

            case LayoutType.Null:

                return ( new NullLayout() );

            case LayoutType.Polar:

                return ( new PolarLayout() );

            case LayoutType.PolarAbsolute:

                return ( new PolarAbsoluteLayout() );

            case LayoutType.HarelKorenFastMultiscale:

                return ( new HarelKorenFastMultiscaleLayout() );

            default:

                Debug.Assert(false);
                return (null);
            }
        }
 /// <summary>
 /// 点击视图切换的16通道显示
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void layout16Btn_Click(object sender, EventArgs e)
 {
     curLayout = LayoutType.LAYOUT_16;
     layout16.BringToFront();
     layout4Btn.Checked = false;
     layout8Btn.Checked = false;
     layout16Btn.Checked = true;
     Every_Update();
     mainform.UpdateIpAddress();
 }
Exemple #54
0
 public VirtualKeyboard(LayoutType layout=LayoutType.VIRTUALKEYBOARD_LAYOUT_DEFAULT, 
     EnterType enter=EnterType.VIRTUALKEYBOARD_ENTER_DEFAULT)
 {
     _layout = layout;
     _enter = enter;
 }
Exemple #55
0
 static extern void virtualkeyboard_change_options(LayoutType layout, EnterType enter);
        //*************************************************************************
        //  Method: MenuItem_Click()
        //
        /// <summary>
        /// Handles the Click event on each of the child menu items added by <see
        /// cref="AddMenuItems" />.
        /// </summary>
        ///
        /// <param name="sender">
        /// Standard event argument.
        /// </param>
        ///
        /// <param name="e">
        /// Standard event argument.
        /// </param>
        //*************************************************************************
        protected void MenuItem_Click(
            object sender,
            EventArgs e
            )
        {
            AssertValid();

            Debug.Assert(sender is ToolStripMenuItem);

            ToolStripMenuItem oMenuItem = (ToolStripMenuItem)sender;

            // Each child menu item's Tag is set to a LayoutType value.
            // Retrieve it.

            Debug.Assert(oMenuItem.Tag is LayoutType);

            this.Layout = (LayoutType)oMenuItem.Tag;
        }
 public void SetZIndex(LayoutType type)
 {
     DesginCanvas.SetZIndex(type);
 }
    OnLayoutChanged
    (
        LayoutType eLayout
    )
    {
        AssertValid();

        if (m_bHandlingLayoutChanged)
        {
            // Prevent an endless loop when the layout managers are
            // synchronized.

            return;
        }

        m_bHandlingLayoutChanged = true;

        // Synchronize the layout managers.

        m_oRibbon.Layout =
            m_oLayoutManagerForToolStripSplitButton.Layout =
            m_oLayoutManagerForContextMenu.Layout =
                eLayout;

        // Save and apply the new layout.

        LayoutUserSettings oLayoutUserSettings = new LayoutUserSettings();
        oLayoutUserSettings.Layout = eLayout;
        oLayoutUserSettings.Save();
        ApplyLayoutUserSettings(oLayoutUserSettings);

        // If the layout was just changed from Null to something else and the
        // X and Y columns were autofilled, the X and Y autofill results need
        // to be cleared.

        if (!this.LayoutIsNull)
        {
            PerWorkbookSettings oPerWorkbookSettings =
                this.PerWorkbookSettings;

            AutoFillWorkbookResults oAutoFillWorkbookResults =
                oPerWorkbookSettings.AutoFillWorkbookResults;
                
            if (oAutoFillWorkbookResults.VertexXResults.ColumnAutoFilled)
            {
                oAutoFillWorkbookResults.VertexXResults =
                    new AutoFillNumericRangeColumnResults();

                oAutoFillWorkbookResults.VertexYResults =
                    new AutoFillNumericRangeColumnResults();

                // The PerWorkbookSettings object doesn't persist its settings
                // to the workbook unless one of its own properties is set.

                oPerWorkbookSettings.AutoFillWorkbookResults =
                    oAutoFillWorkbookResults;
                
                UpdateAxes(oPerWorkbookSettings);
            }
        }

        m_bHandlingLayoutChanged = false;
    }
 protected void UpdateLayout(LayoutType layoutType)
 {
     var model = EmulatorsMainModel.Instance();
     model.LayoutType = layoutType;
 }
        //*************************************************************************
        //  Method: AddMenuItem()
        //
        /// <summary>
        /// Adds a child menu item to a parent menu item for one layout supported
        /// by this class.
        /// </summary>
        ///
        /// <param name="oParentDropDownItem">
        /// Parent item to add the child menu item to.
        /// </param>
        ///
        /// <param name="eLayoutType">
        /// Layout represented by the child menu item.
        /// </param>
        ///
        /// <param name="sMenuText">
        /// Text for the menu item.
        /// </param>
        /// 
        /// <param name="sToolTipText">
        /// Tooltip for the menu item.
        /// </param>
        /// 
        /// <returns>
        /// The new child menu item.
        /// </returns>
        //*************************************************************************
        protected ToolStripMenuItem AddMenuItem(
            ToolStripDropDownItem oParentDropDownItem,
            LayoutType eLayoutType,
            String sMenuText,
            String sToolTipText
            )
        {
            Debug.Assert(oParentDropDownItem != null);
            Debug.Assert( !String.IsNullOrEmpty(sMenuText) );
            Debug.Assert( !String.IsNullOrEmpty(sToolTipText) );
            AssertValid();

            ToolStripMenuItem oMenuItem = new ToolStripMenuItem();

            oMenuItem.Name = sMenuText;
            oMenuItem.Tag = eLayoutType;
            oMenuItem.Text = sMenuText;
            oMenuItem.ToolTipText = sToolTipText;
            oMenuItem.Click += new System.EventHandler(this.MenuItem_Click);

            oParentDropDownItem.DropDownItems.Add(oMenuItem);

            return (oMenuItem);
        }