void OnPurchaseBundlesRecieved(List <PaidCurrencyBundleItem> data)
 {
     Debug.Log("Got credit bundles");
     gridLoader            = (IGridLoader)Grid.GetComponent(typeof(IGridLoader));
     gridLoader.ItemAdded += OnItemInGrid;
     gridLoader.LoadGrid(data);
 }
Exemplo n.º 2
0
        public TModel ShowDialog <TModel>(IWin32Window owner, IGridLoader <TModel> loader)
            where TModel : class
        {
            GridLoader = loader as IGridLoader <TModel>;

            var loadTask = new List <Task>();

            if (ApplicationControl == null)
            {
                loadTask.Add(LoadApplicationControlAsync());
            }
            if (Company == null)
            {
                loadTask.Add(LoadCompanyAsync());
            }
            loadTask.Add(LoadControlColorAsync());

            IEnumerable <TModel> items = null;
            var task = Task.Run(async() =>
            {
                await Task.WhenAll(loadTask);
                if (!DoPreset)
                {
                    return;
                }
                items = await loader.SearchInfo();
            });

            ProgressDialog.Start(owner, task, false, SessionKey);

            ParentForm.Shown += (sender, e) =>
            {
                grdSearch.Template = loader.CreateGridTemplate();
                if (DoPreset)
                {
                    grdSearch.DataSource = new BindingSource(items, null);
                }
            };

            if (ApplicationContext.ShowDialog(owner, ParentForm, true) == DialogResult.OK)
            {
                var model = grdSearch.CurrentRow.DataBoundItem as TModel;
                if (model != null)
                {
                    return(model);
                }
            }
            return(default(TModel));
        }
Exemplo n.º 3
0
        /// <summary>
        /// ダイアログ画面を表示する。
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="formName"></param>
        /// <param name="gridLoader"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        /// <remarks>
        /// VOneScreenBaseから流用。
        /// </remarks>
        private TModel ShowSearchDialog <TModel>(string formName, IGridLoader <TModel> gridLoader, int width = 700, int height = 600)
            where TModel : class
        {
            using (var form = ApplicationContext.Create(nameof(PH9900)))
            {
                var screen = form.GetAll <PH9900>().FirstOrDefault();

                Debug.Assert(screen != null);
                screen.InitializeParentForm(formName, width, height);
                var result = screen.ShowDialog(ParentForm, gridLoader);
                if (result != null)
                {
                    return(result);
                }
            }
            return(default(TModel));
        }
Exemplo n.º 4
0
 public void InitializeGridWithBundles(List<CreditBundleItem> data)
 {
     gridLoader = (IGridLoader)Grid.GetComponent(typeof(IGridLoader));
     gridLoader.ItemAdded += OnItemInGrid;
     gridLoader.LoadGrid(data);
 }
Exemplo n.º 5
0
 public GridLoader(bool isShowDetailed)
 {
     printer = isShowDetailed ? printer = new GridLoaderDetailed() : new GridLoaderShort();
 }
        void OnPurchaseBundlesRecieved(List<PremiumCurrencyBundle> data)
        {
            Debug.Log("purchase bundles: " + data);

            Debug.Log("Got credit bundles");
            gridLoader = (IGridLoader)Grid.GetComponent(typeof(IGridLoader));
            gridLoader.ItemAdded += OnItemInGrid;
            gridLoader.LoadGrid(data);
        }
Exemplo n.º 7
0
 public void InitializeGridWithBundles(List <CreditBundleItem> data)
 {
     gridLoader            = (IGridLoader)Grid.GetComponent(typeof(IGridLoader));
     gridLoader.ItemAdded += OnItemInGrid;
     gridLoader.LoadGrid(data);
 }