示例#1
0
文件: Grid.cs 项目: SealTV/Crafting
    // Use this for initialization
    void Start()
    {
        SpriteRenderer spriteRender = GetComponent<SpriteRenderer>();
        Sprite sprite = spriteRender.sprite;
        cellWidth = sprite.rect.width * transform.localScale.x/ (sprite.pixelsPerUnit * ColumnsCount);
        cellHeight = sprite.rect.height* transform.localScale.y / (sprite.pixelsPerUnit * RowsCount);

        leftUpCellX = transform.position.x - 5f * cellWidth;
        leftUpCellY = transform.position.y + 2f * cellHeight;

        gridSorter = new GridSorter(RowsCount, ColumnsCount);
    }
示例#2
0
        /// <summary>
        /// Controller View Model for the company.
        /// </summary>
        /// <param name="configurationService">Configuration Service for the view model.</param>
        /// <param name="eventManager">EvenManager for the view model.</param>
        /// <param name="dialogService">DialogService for spotting errors.</param>
        /// <param name="services">Data Services to fetch/store data.</param>
        /// <param name="regionManager">Region manager for navigating to the child</param>
        public CompanyControlViewModel(IConfigurationService configurationService, IEventManager eventManager, IDialogService dialogService, IDataServices services, IRegionManager regionManager) : base(configurationService, eventManager, services, null, dialogService, regionManager)
        {
            OpenItemCommand = new DelegateCommand <object>(OnOpenItemCommand);

            _mailBoxName            = EventSubsystem.CompanySummaryVm;
            _companyDataServices    = DataServices.GetCompanyDataServices();
            ViewModelUri            = new Uri("karve://company/viewmodel?id=" + Guid.ToString());
            _newCommand             = new DelegateCommand(OnNewCommand);
            SortCommand             = new DelegateCommand <object>(OnSortCommand);
            _gridSorter             = new GridSorter <CompanySummaryDto>(DialogService, _companyDataServices, DefaultPageSize);
            _gridSorter.OnInitPage += _gridSorter_OnInitPage;
            _gridSorter.OnNewPage  += _gridSorter_OnNewPage;
            // ItenName is for the title.
            ItemName = "Empresas";
            InitViewModel();
            ActiveSubSystem();
        }
 public ProvidersControlViewModel(IConfigurationService configurationService,
                                  IUnityContainer container,
                                  IDataServices services,
                                  IRegionManager regionManager,
                                  IDialogService service,
                                  IEventManager eventManager) : base(configurationService, eventManager, services, null, service, regionManager)
 {
     _container                 = container;
     _regionManager             = regionManager;
     _extendedSupplierDataTable = new DataTable();
     _uniqueIdentifier          = _uniqueIdentifier % Int64.MaxValue;
     _mailBoxName               = PROVIDER_SUMMARY_VM;
     _supplierTaskEvent        += OnNotifyIncrementalList <SupplierSummaryDto>;
     _supplierDataServices      = DataServices.GetSupplierDataServices();
     _gridSorter                = new GridSorter <SupplierSummaryDto>(service, _supplierDataServices, DefaultPageSize);
     _gridSorter.OnInitPage    += _gridSorter_OnInitPage;
     _gridSorter.OnNewPage     += _gridSorter_OnNewPage;
     DefaultPageSize            = 100;
     ViewModelUri               = new Uri("karve://booking/viewmodel?id=" + Guid.ToString());
     SortCommand                = new DelegateCommand <object>(OnSortCommand);
     OpenItemCommand            = new DelegateCommand <object>(OpenCurrentItem);
     InitViewModel();
     ActiveSubSystem();
 }