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


C# IView.Get方法代码示例

本文整理汇总了C#中IView.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IView.Get方法的具体用法?C# IView.Get怎么用?C# IView.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IView的用法示例。


在下文中一共展示了IView.Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GridController

        public GridController(IView<string> view, GridFieldModel model)
        {
            _view = view;
            _model = model;
            _zoomCheckbox = false;

            _view.SetController(this);
            _panel = (Panel) _view.Get("Panel");
            _trackBar = (TrackBar) _view.Get("Trackbar");
            _trackBar.Enabled = false;
            _comboBox = (ComboBox) _view.Get("ComboBox");

            float tWidth = _panel.Width/_model.Rows.GetLength(1);
            float tHeight = _panel.Height/_model.Rows.GetLength(0);
            // Doing these checks to make sure that we don't have pixels left

            _tileWidth = (_panel.Width%_model.Rows.GetLength(1) != 0 // if width%length != 0
                ? (int) tWidth++ // then set to width++
                : (int) tWidth) // else set to width
                         *_model.Rows[0, 0].Width; // finally multiply by the tile width
            _tileHeight = (_panel.Width%_model.Rows.GetLength(0) != 0
                ? (int) tHeight++
                : (int) tHeight)
                          *_model.Rows[0, 0].Height;

            // only need to draw the grid once, so we can set it as the panel's background
            _panel.BackgroundImage = PaintBackground();
            _rectangle = new Rectangle(0, 0, 50, 50);
            _buffer = new Bitmap(_panel.Width, _panel.Height);

            PopulateCombobox();
            Resize(this, null);
        }
开发者ID:SanderBouwman,项目名称:KantoorInrichting,代码行数:33,代码来源:GridController.cs

示例2: ProductGridController

        public ProductGridController(IView<ProductGrid.PropertyEnum> view,
            float meterWidth, float meterHeight, float tileSize)
        {
            utility = new ProductGridUtility();
            collisionHandler = new ProductGridCollisionHandler();
            // Set parameters to fields
            this.meterWidth = meterWidth;
            this.meterHeight = meterHeight;
            this.tileSize = tileSize;
            this.view = view;

            // set controller
            this.view.SetController(this);
            legendDictionary = ((Legend) view.Get(ProductGrid.PropertyEnum.Legend)).CategoryColors;

            // Init fields with default values
            zoomSize = 50;
            zoomArea = new Rectangle(0, 0, zoomSize, zoomSize);
            comboBoxAlgorithms = new List<AlgorithmModel>();
            draggingProduct = false;
            zoomContent = new Bitmap(zoomSize, zoomSize);
            // Init algorithm combobox
            PopulateAlgorithms();
        }
开发者ID:ICTSE1b5,项目名称:KantoorInrichting,代码行数:24,代码来源:ProductGridController.cs


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