/// <summary>
        /// 创建IBindingControlCollection
        /// </summary>
        /// <param name="dm"></param>
        /// <returns></returns>
        public virtual IBindingControlCollection CreateBindingControlCollection(IDisplayManager dm)
        {
            IBindingControlCollection ret = new BindingControlCollection();

            ret.ParentManager = dm;
            return(ret);
        }
Пример #2
0
        public static void ReadOnlyControls(IDisplayManager dm, string[] controlsName, bool readOnly, Control parentControl, Dictionary <string, Label> labels)
        {
            if (labels == null)
            {
                labels = new Dictionary <string, Label>();
                SearchLabels(parentControl, labels);
            }
            foreach (string i in controlsName)
            {
                IDataControl dc = dm.DataControls[i];
                if (dc != null)
                {
                    dc.ReadOnly = readOnly;
                    if (readOnly)
                    {
                        dc.SelectedDataValue = null;
                    }
                }

                if (labels.ContainsKey(i))
                {
                    labels[i].ForeColor = readOnly ? System.Drawing.SystemColors.GrayText : System.Drawing.SystemColors.ControlText;
                }
                else
                {
                    throw new ArgumentException("There is no Label " + i);
                }
            }
        }
Пример #3
0
        public static void NotNullControls(IDisplayManager dm, Control parentControl, Dictionary <string, Label> labels)
        {
            if (labels == null)
            {
                labels = new Dictionary <string, Label>();
                SearchLabels(parentControl, labels);
            }

            if (!string.IsNullOrEmpty(Const.LabelNotNullPreFix))
            {
                foreach (var dc in dm.DataControls)
                {
                    if (dc != null && dc.NotNull)
                    {
                        if (labels.ContainsKey(dc.Name))
                        {
                            if (!labels[dc.Name].Text.StartsWith(Const.LabelNotNullPreFix))
                            {
                                labels[dc.Name].Text = Const.LabelNotNullPreFix + labels[dc.Name].Text;
                            }
                        }
                    }
                }
            }
        }
Пример #4
0
        public void AssociateButton(MyButton btn, IDisplayManager dm, string windowMenuName)
        {
            var windowMenuInfo = ADInfoBll.Instance.GetInfos <WindowMenuInfo>("Name = '" + windowMenuName + "'")[0];

            if (windowMenuInfo == null)
            {
                throw new ArgumentException("There is no WindowMenu of " + windowMenuName);
            }
            TryAddButtons(btn, this);

            btn.Text   = windowMenuInfo.Text;
            btn.Tag    = windowMenuInfo;
            btn.Click += new EventHandler((sender, e) =>
            {
                Button tsb          = sender as Button;
                WindowMenuInfo info = tsb.Tag as WindowMenuInfo;

                MenuWindowExtention.OnButtonClick(info, tsb.FindForm());
            });

            dm.PositionChanged += new EventHandler((sender, e) =>
            {
                IDisplayManager dm2 = sender as IDisplayManager;

                if (dm2 == dm)
                {
                    MenuWindowExtention.SetMenuState(this);
                }
            });
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dmParent"></param>
        /// <param name="tableName"></param>
        /// <param name="defaultOrder"></param>
        /// <param name="groupByClause"></param>
        /// <param name="selectClause"></param>
        public SearchManagerGroupByDetail(IDisplayManager dmParent, string tableName, string defaultOrder, string selectClause, string groupByClause)
            : base(dmParent)
        {
            m_parentSm = dmParent.SearchManager as SearchManager;
            if (m_parentSm == null)
            {
                SearchManagerGroupByDetail se = dmParent.SearchManager as SearchManagerGroupByDetail;
                if (se == null)
                {
                    throw new ArgumentException("SearchManagerGroupByDetail's Parent SearchManager must be Feng.Data.SearchManager or SearchManagerGroupByDetail!", "se");
                }
                m_parentSm = se.m_innerSearchManager;
            }
            if (string.IsNullOrEmpty(m_parentSm.GroupBySql))
            {
                throw new ArgumentException("SearchManagerGroupByDetail's Parent SearchManager must has groupby sub clause!", "GroupBySql");
            }
            string s = m_parentSm.GroupBySql.ToUpper().Replace("GROUP BY", "");
            m_groupByColumns = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < m_groupByColumns.Length; ++i)
            {
                m_groupByColumns[i] = m_groupByColumns[i].Trim();
            }
            m_innerSearchManager = new SearchManager(tableName, defaultOrder, selectClause, groupByClause);
            m_innerSearchManager.Name = this.Name + ".Inner";

            m_tableName = tableName;
            m_defaultOrder = defaultOrder;
            m_selectClause = selectClause;
            m_groupByClause = groupByClause;

            m_innerSearchManager.EnablePage = false;
        }
Пример #6
0
        public override ISearchManager GenerateSearchManager(WindowTabInfo tabInfo, IDisplayManager dmParent)
        {
            ISearchManager sm = base.GenerateSearchManager(tabInfo, dmParent);

            AddEvent(tabInfo, sm, WindowTabEventManagerType.SearchManager);
            return(sm);
        }
Пример #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dmParent"></param>
        /// <param name="tableName"></param>
        /// <param name="defaultOrder"></param>
        /// <param name="groupByClause"></param>
        /// <param name="selectClause"></param>
        public SearchManagerGroupByDetail(IDisplayManager dmParent, string tableName, string defaultOrder, string selectClause, string groupByClause)
            : base(dmParent)
        {
            m_parentSm = dmParent.SearchManager as SearchManager;
            if (m_parentSm == null)
            {
                SearchManagerGroupByDetail se = dmParent.SearchManager as SearchManagerGroupByDetail;
                if (se == null)
                {
                    throw new ArgumentException("SearchManagerGroupByDetail's Parent SearchManager must be Feng.Data.SearchManager or SearchManagerGroupByDetail!", "se");
                }
                m_parentSm = se.m_innerSearchManager;
            }
            if (string.IsNullOrEmpty(m_parentSm.GroupBySql))
            {
                throw new ArgumentException("SearchManagerGroupByDetail's Parent SearchManager must has groupby sub clause!", "GroupBySql");
            }
            string s = m_parentSm.GroupBySql.ToUpper().Replace("GROUP BY", "");

            m_groupByColumns = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < m_groupByColumns.Length; ++i)
            {
                m_groupByColumns[i] = m_groupByColumns[i].Trim();
            }
            m_innerSearchManager      = new SearchManager(tableName, defaultOrder, selectClause, groupByClause);
            m_innerSearchManager.Name = this.Name + ".Inner";

            m_tableName     = tableName;
            m_defaultOrder  = defaultOrder;
            m_selectClause  = selectClause;
            m_groupByClause = groupByClause;

            m_innerSearchManager.EnablePage = false;
        }
        public AdminController(
            IDisplayManager <User> userDisplayManager,
            SignInManager <IUser> signInManager,
            IAuthorizationService authorizationService,
            ISession session,
            UserManager <IUser> userManager,
            IUserService userService,
            INotifier notifier,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IHtmlLocalizer <AdminController> htmlLocalizer,
            IStringLocalizer <AdminController> stringLocalizer,
            IUpdateModelAccessor updateModelAccessor)
        {
            _userDisplayManager   = userDisplayManager;
            _signInManager        = signInManager;
            _authorizationService = authorizationService;
            _session             = session;
            _userManager         = userManager;
            _notifier            = notifier;
            _siteService         = siteService;
            _userService         = userService;
            _updateModelAccessor = updateModelAccessor;

            New = shapeFactory;
            H   = htmlLocalizer;
            S   = stringLocalizer;
        }
Пример #9
0
        internal static Tuple <string, object> GetDataControlValue(string s2, IDisplayManager dm)
        {
            string s1 = s2;
            // maybe there is '.'
            // '.', ':' is invalid in sql
            int    idx = s1.IndexOf('_');
            string dataControlName, propertyName;

            if (idx == -1)
            {
                dataControlName = s1;
                propertyName    = null;
            }
            else
            {
                dataControlName = s1.Substring(0, idx);
                propertyName    = s1.Substring(idx + 1);
            }

            if (dm.DataControls[dataControlName] == null)
            {
                throw new ArgumentException("there is no IDataControl with name " + dataControlName + "!");
            }
            object o = dm.DataControls[dataControlName].SelectedDataValue;

            if (!string.IsNullOrEmpty(propertyName))
            {
                propertyName = propertyName.Replace('_', '.');
                o            = EntityScript.GetPropertyValue(o, propertyName);
            }
            return(new Tuple <string, object>(dataControlName, o));
        }
Пример #10
0
        public CombatUI(ICombatController combatController,
                        IUICharacterManager uiCharacterManager,
                        GameUIConstants gameUIConstants,
                        IUIContainer uiContainer,
                        UserInput userInput,
                        IUIStateTracker defaultsHandler,
                        IDisplayManager displayManager,
                        IDisplayCombatState combatStateHandler)
        {
            _combatController   = combatController;
            _displayManager     = displayManager;
            _combatStateHandler = combatStateHandler;
            _defaultsHandler    = defaultsHandler;

            _uiCharacterManager                      = uiCharacterManager;
            _uiCharacterManager.Characters           = _displayManager.GetDisplayCharacters();
            _uiCharacterManager.CurrentRoundOrderIds = _combatStateHandler.GetRoundOrderIds()[0];
            _uiCharacterManager.NextRoundOrderIds    = _combatStateHandler.GetRoundOrderIds()[1];

            _uiContainer = uiContainer;

            _userInput = userInput;

            BindEvents();
            RefreshActionPanelList();
        }
        internal static void ResetSearchControlInfos(MyGrid grdSetup, IDisplayManager dmMaster)
        {
            if (dmMaster == null)
            {
                return;
            }

            if (dmMaster.SearchManager != null)
            {
                int n = 0;
                foreach (ISearchControl sc in dmMaster.SearchManager.SearchControls)
                {
                    GridColumnInfo info = sc.Tag as GridColumnInfo;

                    if (info == null || (!string.IsNullOrEmpty(info.SearchControlType) &&
                                         Authority.AuthorizeByRule(info.SearchControlVisible)))
                    {
                        sc.Available = true;
                    }
                    else
                    {
                        sc.Available = false;
                    }

                    sc.Index = n;
                    n++;
                }

                //LoadSearchControlInfos(grdSetup, dmMaster);
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="gridName"></param>
        /// <param name="dm"></param>
        /// <param name="parentForm"></param>
        /// <param name="addressTextBox"></param>
        public GridRelatedAddressTaskPane(string gridName, IDisplayManager dm, IArchiveMasterForm parentForm, LinkLabel addressTextBox)
        {
            XceedUtility.SetUIStyle(this);

            m_parentForm = parentForm;
            m_dm = dm;
            m_addressTextBox = addressTextBox;

            LoadMenus(gridName);
            if (m_items1.Count != 0)
            {
                var archiveSeeForm = parentForm;
                if (archiveSeeForm != null)
                {
                    archiveSeeForm.MasterGrid.GridControl.CurrentRowChanged += new EventHandler(MasterGrid_CurrentRowChanged);

                    MasterGrid_CurrentRowChanged(archiveSeeForm.DisplayManager, System.EventArgs.Empty);
                }

                if (m_addressTextBox != null)
                {
                    m_addressTextBox.Text = null;
                }
            }
            else
            {
                if (m_addressTextBox != null)
                {
                    m_addressTextBox.Visible = false;
                }
            }
        }
        internal static Tuple<string, object> GetDataControlValue(string s2, IDisplayManager dm)
        {
            string s1 = s2;
            // maybe there is '.'
            // '.', ':' is invalid in sql
            int idx = s1.IndexOf('_');
            string dataControlName, propertyName;
            if (idx == -1)
            {
                dataControlName = s1;
                propertyName = null;
            }
            else
            {
                dataControlName = s1.Substring(0, idx);
                propertyName = s1.Substring(idx + 1);
            }

            if (dm.DataControls[dataControlName] == null)
            {
                throw new ArgumentException("there is no IDataControl with name " + dataControlName + "!");
            }
            object o = dm.DataControls[dataControlName].SelectedDataValue;
            if (!string.IsNullOrEmpty(propertyName))
            {
                propertyName = propertyName.Replace('_', '.');
                o = EntityScript.GetPropertyValue(o, propertyName);
            }
            return new Tuple<string,object>(dataControlName, o);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="displayManager"></param>
        protected AbstractControlManager(IDisplayManager displayManager)
        {
            m_displayManager = displayManager;

            var ccf = ServiceProvider.GetService<IControlCollectionFactory>();
            if (ccf != null)
            {
                m_controlCheckExceptionProcess = ccf.CreateControlCheckExceptionProcess(this);
                m_stateControls = ccf.CreateStateControlCollection(this);
                m_checkControls = ccf.CreateCheckControlCollection(this);
            }
            else
            {
                m_controlCheckExceptionProcess = null;
                m_stateControls = new StateControlCollection();
                m_checkControls = new CheckControlCollection();
            }

            //this.StateControls.Add(m_displayManager.BindingControls);

            if (m_displayManager != null && m_displayManager.SearchManager != null)
            {
                m_displayManager.SearchManager.DataLoading += new EventHandler<DataLoadingEventArgs>(SearchManager_DataLoading);
                m_displayManager.SearchManager.DataLoaded += new EventHandler<DataLoadedEventArgs>(SearchManager_DataLoaded);
            }
        }
Пример #15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dmParent"></param>
        public SearchManagerWithParent(IDisplayManager dmParent)
            : base()
        {
            m_dmParent = dmParent;

            this.EnablePage = false;
        }
Пример #16
0
 public AdminController(
     ISitemapHelperService sitemapService,
     IAuthorizationService authorizationService,
     IDisplayManager <SitemapSource> displayManager,
     IEnumerable <ISitemapSourceFactory> sourceFactories,
     ISitemapManager sitemapManager,
     ISitemapIdGenerator sitemapIdGenerator,
     ISiteService siteService,
     IUpdateModelAccessor updateModelAccessor,
     INotifier notifier,
     IShapeFactory shapeFactory,
     IStringLocalizer <AdminController> stringLocalizer,
     IHtmlLocalizer <AdminController> htmlLocalizer)
 {
     _sitemapService       = sitemapService;
     _displayManager       = displayManager;
     _sourceFactories      = sourceFactories;
     _authorizationService = authorizationService;
     _sitemapManager       = sitemapManager;
     _sitemapIdGenerator   = sitemapIdGenerator;
     _siteService          = siteService;
     _updateModelAccessor  = updateModelAccessor;
     _notifier             = notifier;
     S   = stringLocalizer;
     H   = htmlLocalizer;
     New = shapeFactory;
 }
Пример #17
0
    private IDisplayManager GetCurrentDisplayManager()
    {
        int tries = 0;

        do
        {
            IDisplayManager displayManager = GetDisplayManager(Preloader.instance.GetRunningDisplayType());

            Preloader.instance.UpdateDisplayList();

            if (Preloader.instance.IsLastDisplay())
            {
                Preloader.instance.UpdateRunningDisplayListData();
            }

            if (displayManager != null)
            {
                return(displayManager);
            }
            else
            {
                Preloader.instance.SetNextDisplayIndex();
                tries++;
            }
        }while(tries < Preloader.instance.GetDisplayListLength());

        return(null);
    }
        static void SearchManager_DataLoaded(object sender, DataLoadedEventArgs e)
        {
            ISearchManager sm = sender as ISearchManager;

            if (m_detailGridsState.Count > 0)
            {
                Xceed.Grid.DetailGrid detailGrid = m_detailGridsState[0] as Xceed.Grid.DetailGrid;

                int level = 0;
                Xceed.Grid.DetailGrid nowGrid = detailGrid;
                while (nowGrid != null)
                {
                    nowGrid = nowGrid.ParentGrid;
                    level++;
                }
                (detailGrid.GridControl as MyGrid).LoadLayout(level - 1);

                detailGrid.GridControl.Enabled = (bool)m_detailGridsState[1];

                ISearchManagerWithParent smp      = sm as ISearchManagerWithParent;
                IDisplayManager          dmParent = smp.ParentDisplayManager;
                dmParent.Position = (int)m_detailGridsState[2];

                m_detailGridsState.Clear();
            }
        }
Пример #19
0
        private void 实时监控异常处理_Load(object sender, EventArgs e)
        {
            m_dm = AssociateDataControlsInDisplayManager(new Control[] {
                pnl作业号, pnl车牌号, pnl任务性质, pnl货物特征, pnl时间要求, pnl起始地途经地终止地,
                pnl备注, pnl理由
            }, "实时监控_车辆作业_作业退回申请");

            StringBuilder sb = new StringBuilder();

            using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <专家任务>())
            {
                var clzy = rep.Get <车辆作业>(m_clzy.ID);

                m_dm.SetDataBinding(new List <车辆作业> {
                    clzy
                }, string.Empty);

                foreach (var rw in clzy.专家任务.任务)
                {
                    if (sb.Length > 0)
                    {
                        sb.Append(",");
                    }
                    sb.Append(rw.货物特征);
                }
            }
            m_dm.DataControls["货物特征"].SelectedDataValue = sb.ToString();

            m_dm.DataControls["理由"].ReadOnly = false;
        }
Пример #20
0
 public SourceController(
     IAuthorizationService authorizationService,
     IDisplayManager <SitemapSource> displayManager,
     IEnumerable <ISitemapSourceFactory> factories,
     ISitemapManager sitemapManager,
     ISiteService siteService,
     ISitemapCacheProvider sitemapCacheProvider,
     IUpdateModelAccessor updateModelAccessor,
     INotifier notifier,
     IShapeFactory shapeFactory,
     IStringLocalizer <SourceController> stringLocalizer,
     IHtmlLocalizer <SourceController> htmlLocalizer)
 {
     _displayManager       = displayManager;
     _factories            = factories;
     _authorizationService = authorizationService;
     _sitemapManager       = sitemapManager;
     _siteService          = siteService;
     _sitemapCacheProvider = sitemapCacheProvider;
     _updateModelAccessor  = updateModelAccessor;
     _notifier             = notifier;
     New = shapeFactory;
     S   = stringLocalizer;
     H   = htmlLocalizer;
 }
Пример #21
0
        public override IControlManager GenerateControlManager(WindowTabInfo tabInfo, ISearchManager sm)
        {
            IControlManager cm = base.GenerateControlManager(tabInfo, sm);
            IDisplayManager dm = cm.DisplayManager;

            if (tabInfo.SelectedDataValueChanged != null)
            {
                dm.SelectedDataValueChanged += new EventHandler <SelectedDataValueChangedEventArgs>(delegate(object sender, SelectedDataValueChangedEventArgs e)
                {
                    EventProcessUtils.ExecuteEventProcess(ADInfoBll.Instance.GetEventProcessInfos(tabInfo.SelectedDataValueChanged), sender, e);
                });
            }
            if (tabInfo.PositionChanged != null)
            {
                dm.PositionChanged += new EventHandler(delegate(object sender, EventArgs e)
                {
                    EventProcessUtils.ExecuteEventProcess(ADInfoBll.Instance.GetEventProcessInfos(tabInfo.PositionChanged), sender, e);
                });
            }

            AddEvent(tabInfo, cm, WindowTabEventManagerType.ControlManager);
            AddEvent(tabInfo, cm.DisplayManager, WindowTabEventManagerType.DisplayManager);

            return(cm);
        }
        public override IDataControlCollection CreateDataControlCollection(IDisplayManager dm)
        {
            IDataControlCollection ret = new DataControlCollection();

            ret.ParentManager = dm;
            return(ret);
        }
Пример #23
0
        internal static Tuple <string, object> GetEntityValue(string s2, IDisplayManager dm)
        {
            string s1 = s2;
            // maybe there is '.'
            // '.', ':' is invalid in sql
            int    idx = s1.IndexOf('_');
            string dataControlName, propertyName;

            if (idx == -1)
            {
                dataControlName = s1;
                propertyName    = null;
            }
            else
            {
                dataControlName = s1.Substring(0, idx);
                propertyName    = s1.Substring(idx + 1);
            }


            object o = EntityScript.GetPropertyValue(dm.CurrentItem, dataControlName);

            if (!string.IsNullOrEmpty(propertyName))
            {
                propertyName = propertyName.Replace('_', '.');
                o            = EntityScript.GetPropertyValue(o, propertyName);
            }
            return(new Tuple <string, object>(dataControlName, o));
        }
Пример #24
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dmParent"></param>
        /// <param name="tableName"></param>
        /// <param name="defaultOrder"></param>
        /// <param name="selectClause"></param>
        /// <param name="groupByClause"></param>
        /// <param name="searchExpression"></param>
        /// <param name="searchOrder"></param>
        /// <param name="innerSearchManagerType"></param>
        public SearchManagerProxyDetailInMaster(IDisplayManager dmParent, string tableName, string defaultOrder, string selectClause, string groupByClause, string searchExpression, string searchOrder, string innerSearchManagerType)
            : base(dmParent)
        {
            switch (innerSearchManagerType.ToUpper())
            {
            case "":
            case "NORMAL":
                m_innerSearchManager = new SearchManager(tableName, defaultOrder, selectClause, groupByClause);
                break;

            case "FUNCTION":
                m_innerSearchManager = new SearchManagerFunction(tableName, defaultOrder);
                break;

            case "PROCEDURE":
                m_innerSearchManager = new SearchManagerProcedure(tableName);
                break;

            default:
                throw new NotSupportedException("innerSearchManagerType is invalid!");
            }

            m_searchExpression = searchExpression;
            m_searchOrder      = searchOrder;

            m_innerSearchManager.EnablePage = false;
        }
Пример #25
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="displayManager"></param>
        protected AbstractControlManager(IDisplayManager displayManager)
        {
            m_displayManager = displayManager;

            var ccf = ServiceProvider.GetService <IControlCollectionFactory>();

            if (ccf != null)
            {
                m_controlCheckExceptionProcess = ccf.CreateControlCheckExceptionProcess(this);
                m_stateControls = ccf.CreateStateControlCollection(this);
                m_checkControls = ccf.CreateCheckControlCollection(this);
            }
            else
            {
                m_controlCheckExceptionProcess = null;
                m_stateControls = new StateControlCollection();
                m_checkControls = new CheckControlCollection();
            }

            //this.StateControls.Add(m_displayManager.BindingControls);

            if (m_displayManager != null && m_displayManager.SearchManager != null)
            {
                m_displayManager.SearchManager.DataLoading += new EventHandler <DataLoadingEventArgs>(SearchManager_DataLoading);
                m_displayManager.SearchManager.DataLoaded  += new EventHandler <DataLoadedEventArgs>(SearchManager_DataLoaded);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="actionName"></param>
        public static string GetNavigatorAddress(string actionName, IDisplayManager dm = null)
        {
            SearchHistoryInfo his = null;
            if (dm != null)
            {
                his = dm.SearchManager.GetHistory(0);
            }

            StringBuilder sb = new StringBuilder();
            sb.Append(string.Format("{0}/action/{1}/?", SystemConfiguration.ApplicationName, actionName));
            if (his != null && his.IsCurrentSession)
            {
                if (!string.IsNullOrEmpty(his.Expression))
                {
                    sb.Append(string.Format("exp={0}&", his.Expression));
                }
                if (!string.IsNullOrEmpty(his.Order))
                {
                    sb.Append(string.Format("order={0}&", his.Order));
                }
                if (dm.SearchManager.FirstResult != 0)
                {
                    sb.Append(string.Format("first={0}&", dm.SearchManager.FirstResult));
                }
                sb.Append(string.Format("count={0}&", dm.SearchManager.MaxResult));
            }

            return s_addressHeader + Encrypt(sb.ToString());
        }
Пример #27
0
        public AdminController(
            IAuthorizationService authorizationService,
            IContentManager contentManager,
            IContentItemDisplayManager contentItemDisplayManager,
            IContentDefinitionManager contentDefinitionManager,
            ISiteService siteService,
            INotifier notifier,
            YesSql.ISession session,
            IShapeFactory shapeFactory,
            IDisplayManager <ContentOptionsViewModel> contentOptionsDisplayManager,
            IContentsAdminListQueryService contentsAdminListQueryService,
            ILogger <AdminController> logger,
            IHtmlLocalizer <AdminController> htmlLocalizer,
            IStringLocalizer <AdminController> stringLocalizer,
            IUpdateModelAccessor updateModelAccessor,
            IHttpContextAccessor httpContextAccessor)
        {
            _authorizationService      = authorizationService;
            _notifier                  = notifier;
            _contentItemDisplayManager = contentItemDisplayManager;
            _session                       = session;
            _siteService                   = siteService;
            _contentManager                = contentManager;
            _contentDefinitionManager      = contentDefinitionManager;
            _updateModelAccessor           = updateModelAccessor;
            _httpContextAccessor           = httpContextAccessor;
            _contentOptionsDisplayManager  = contentOptionsDisplayManager;
            _contentsAdminListQueryService = contentsAdminListQueryService;

            H             = htmlLocalizer;
            S             = stringLocalizer;
            _shapeFactory = shapeFactory;
            New           = shapeFactory;
            _logger       = logger;
        }
Пример #28
0
 public AdminController(
     IContentManager contentManager,
     IContentItemDisplayManager contentItemDisplayManager,
     ISiteService siteService,
     ILayerService layerService,
     IAuthorizationService authorizationService,
     ISession session,
     IUpdateModelAccessor updateModelAccessor,
     IVolatileDocumentManager <LayerState> layerStateManager,
     IDisplayManager <Condition> conditionDisplayManager,
     IDisplayManager <Rule> ruleDisplayManager,
     IConditionIdGenerator conditionIdGenerator,
     IEnumerable <IConditionFactory> conditionFactories,
     IStringLocalizer <AdminController> stringLocalizer,
     IHtmlLocalizer <AdminController> htmlLocalizer,
     INotifier notifier)
 {
     _contentManager            = contentManager;
     _contentItemDisplayManager = contentItemDisplayManager;
     _siteService          = siteService;
     _layerService         = layerService;
     _authorizationService = authorizationService;
     _session                 = session;
     _updateModelAccessor     = updateModelAccessor;
     _layerStateManager       = layerStateManager;
     _conditionDisplayManager = conditionDisplayManager;
     _ruleDisplayManager      = ruleDisplayManager;
     _conditionIdGenerator    = conditionIdGenerator;
     _conditionFactories      = conditionFactories;
     _notifier                = notifier;
     S = stringLocalizer;
     H = htmlLocalizer;
 }
Пример #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="actionName"></param>
        public static string GetNavigatorAddress(string actionName, IDisplayManager dm = null)
        {
            SearchHistoryInfo his = null;

            if (dm != null)
            {
                his = dm.SearchManager.GetHistory(0);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(string.Format("{0}/action/{1}/?", SystemConfiguration.ApplicationName, actionName));
            if (his != null && his.IsCurrentSession)
            {
                if (!string.IsNullOrEmpty(his.Expression))
                {
                    sb.Append(string.Format("exp={0}&", his.Expression));
                }
                if (!string.IsNullOrEmpty(his.Order))
                {
                    sb.Append(string.Format("order={0}&", his.Order));
                }
                if (dm.SearchManager.FirstResult != 0)
                {
                    sb.Append(string.Format("first={0}&", dm.SearchManager.FirstResult));
                }
                sb.Append(string.Format("count={0}&", dm.SearchManager.MaxResult));
            }

            return(s_addressHeader + Encrypt(sb.ToString()));
        }
Пример #30
0
        public PresentationsAdminController(
            IContentManager contentManager,
            IDisplayManager <PresentationProfile> displayManager,

            IContentItemDisplayManager contentItemDisplayManager,
            IAuthorizationService authorizationService,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IStringLocalizer <PresentationsAdminController> stringLocalizer,
            IHtmlLocalizer <PresentationsAdminController> htmlLocalizer,
            INotifier notifier,
            ISlideshowPlayerEngineManager slideshowPlayerEngineManager,
            IEnumerable <ISlideshowPlayerEngine> slideShowEngines,
            ILogger <PresentationsAdminController> logger
            )
        {
            _contentManager = contentManager;


            _displayManager = displayManager;

            _contentItemDisplayManager = contentItemDisplayManager;
            _authorizationService      = authorizationService;
            _siteService = siteService;
            _presentatinProfileManager = slideshowPlayerEngineManager;
            _slideShowEngines          = slideShowEngines;
            New       = shapeFactory;
            _notifier = notifier;

            T      = stringLocalizer;
            H      = htmlLocalizer;
            Logger = logger;
        }
Пример #31
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dmParent"></param>
        /// <param name="searchExpression"></param>
        /// <param name="searchOrder"></param>
        /// <param name="innerSearchManager"></param>
        public SearchManagerProxyDetailInMaster(IDisplayManager dmParent, string searchExpression, string searchOrder, ISearchManager innerSearchManager)
            : base(dmParent)
        {
            m_searchExpression = searchExpression;
            m_searchOrder      = searchOrder;

            m_innerSearchManager = innerSearchManager;
        }
 public MinefieldGame(IGameBuilder gameBuilder, IGameStateProcessor gameStateProcessor,
                      IInputManager inputManager, IDisplayManager displayManager)
 {
     _gameBuilder        = gameBuilder;
     _gameStateProcessor = gameStateProcessor;
     _inputManager       = inputManager;
     _displayManager     = displayManager;
 }
        internal static void LoadSearchControlInfos(MyGrid grdSetup, IDisplayManager dmMaster)
        {
            if (dmMaster == null)
            {
                return;
            }

            if (grdSetup.Columns.Count == 0)
            {
                grdSetup.Columns.Add(new Xceed.Grid.Column("名称", typeof(string)));
                grdSetup.Columns.Add(new Xceed.Grid.Column("是否显示", typeof(bool)));
                grdSetup.ReadOnly = false;
                grdSetup.Columns["是否显示"].ReadOnly = false;
                grdSetup.Columns["名称"].ReadOnly   = true;
            }

            grdSetup.DataRows.Clear();

            ISearchManager sm = dmMaster.SearchManager;

            if (sm != null)
            {
                SortedList <int, ISearchControl> scc1 = new SortedList <int, ISearchControl>();
                SortedList <int, ISearchControl> scc2 = new SortedList <int, ISearchControl>();

                foreach (ISearchControl sc in sm.SearchControls)
                {
                    GridColumnInfo info = sc.Tag as GridColumnInfo;
                    if (info == null || (!string.IsNullOrEmpty(info.SearchControlType) &&
                                         Authority.AuthorizeByRule(info.SearchControlVisible)))
                    {
                        if (sc.Available)
                        {
                            scc1.Add(sc.Index, sc);
                        }
                        else
                        {
                            scc2.Add(sc.Index, sc);
                        }
                    }
                }

                foreach (KeyValuePair <int, ISearchControl> kvp in scc1)
                {
                    Xceed.Grid.DataRow row = grdSetup.DataRows.AddNew();
                    row.Cells["是否显示"].Value = kvp.Value.Available;
                    row.Cells["名称"].Value   = kvp.Value.Caption;
                    row.EndEdit();
                }
                foreach (KeyValuePair <int, ISearchControl> kvp in scc2)
                {
                    Xceed.Grid.DataRow row = grdSetup.DataRows.AddNew();
                    row.Cells["是否显示"].Value = kvp.Value.Available;
                    row.Cells["名称"].Value   = kvp.Value.Caption;
                    row.EndEdit();
                }
            }
        }
Пример #34
0
 public DisplayHelper(
     IDisplayManager displayManager,
     IShapeFactory shapeFactory,
     ViewContext viewContext)
 {
     _displayManager = displayManager;
     _shapeFactory = shapeFactory;
     ViewContext = viewContext;
 }
Пример #35
0
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            this.CheckDisposed();

            //
            // Create the deferral by requesting it from the task instance.
            //
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            this.hcfToken = new CancellationToken();

            this.display = new DisplayManager();
            await this.display.Initialize();

            this.display.WriteLine("Display Initalized.");

            this.tempSensor = new BMP180Device();
            await this.tempSensor.Initialize();

            this.relayAppliance = new RelayAppliance();
            this.relayAppliance.Initialize();

            this.nestApi = new EventSource(new Uri("https://developer-api.nest.com/"), StartupTask.authCode);
            this.nestApi.EventReceived += new EventHandler <ServerSentEvent.Events.ServerSentEventReceivedEventArgs>(async(o, e) => {
                if (e.Message.EventType == "keep-alive")
                {
                    Debug.WriteLine("EventSource: Keep-Alive Event Received");
                }
                else
                {
                    Debug.WriteLine(e.Message.Data);
                    if (!string.IsNullOrEmpty(e.Message.Data))
                    {
                        try
                        {
                            this.nestJson = JsonConvert.DeserializeObject <NestReadResponse>(e.Message.Data).Data;
                            await this.UpdateRetFromEvent();
                        }
                        catch
                        {
                            Debug.WriteLine("EventSource: Failed to parse Server Event Message Data");
                        }
                    }
                }
            });
            this.nestApi.StateChanged += new EventHandler <ServerSentEvent.Events.StateChangedEventArgs>((o, e) => {
                Debug.WriteLine(string.Format("State Changed: {0}", e.State.ToString()));
            });
            this.nestApi.Start(this.hcfToken);

            await this.RunPollingLoop(this.hcfToken);

            //
            // Once the asynchronous method(s) are done, close the deferral.
            //
            deferral.Complete();
        }
Пример #36
0
 public DisplayHelper(
     IDisplayManager displayManager,
     IShapeFactory shapeFactory,
     ViewContext viewContext)
 {
     _displayManager = displayManager;
     _shapeFactory   = shapeFactory;
     ViewContext     = viewContext;
 }
        internal GeneratedDataUnboundGrid(WindowTabInfo windowTabInfo, IDisplayManager dmParent)
            : base()
        {
            this.FixedHeaderRows.Add(new Xceed.Grid.ColumnManagerRow());

            this.Name = windowTabInfo.Name;
            this.Text = windowTabInfo.Text;

            Initialize(windowTabInfo, dmParent);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="controlGroupName"></param>
        /// <param name="detailGridCount"></param>
        public ArchiveDetailFormAutoWithMultiDetailGrid(IDisplayManager dm, string controlGroupName, int detailGridCount, string[] texts)
            : base(dm, controlGroupName)
        {
            InitializeComponent();

            if (this.DesignMode)
                return;

            CreateControls(detailGridCount, texts);
        }
Пример #39
0
 public DisplayHelper(
     IDisplayManager displayManager,
     IShapeFactory shapeFactory,
     ViewContext viewContext,
     IViewDataContainer viewDataContainer) {
     _displayManager = displayManager;
     _shapeFactory = shapeFactory;
     ViewContext = viewContext;
     ViewDataContainer = viewDataContainer;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="controlGroupName"></param>
        public ArchiveDetailFormAutoWithDetailGrid(IDisplayManager dm, string controlGroupName)
            : base(dm, controlGroupName)
        {
            InitializeComponent();

            if (this.DesignMode)
                return;

            CreateControls();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="gridName"></param>
        /// <param name="dm"></param>
        /// <param name="parentForm"></param>
        public GridRelatedControl(string gridName, IDisplayManager dm, IArchiveMasterForm parentForm)
        {
            InitializeComponent();

            m_taskPane1 = new GridGotoFormTaskPane(gridName, dm, parentForm);
            m_taskPane1.Dock = DockStyle.Fill;
            this.panel1.Controls.Add(m_taskPane1);

            m_taskPane2 = new GridRelatedAddressTaskPane(gridName, dm, parentForm, linkLabelAddress);
            m_taskPane2.Dock = DockStyle.Fill;
            this.panel2.Controls.Add(m_taskPane2);
        }
Пример #42
0
        public 车辆详细信息(车辆 cl)
        {
            System.Diagnostics.Debug.Assert(cl != null, "车辆详细信息车辆不能为空");

            InitializeComponent();
            m_cl = cl;

            m_dm = AssociateDataControlsInDisplayManager(new Control[] {
                pnl车辆忠诚度, pnl车牌号, pnl车型, pnl车主联系方式, pnl核定载重,
                pnl驾驶员联系方式, pnl是否监管车, pnl所属车队, pnl车主, pnl驾驶员
                }, "实时监控_车辆作业_车辆详细信息");
        }
Пример #43
0
        public 承运时间要求详情(车辆作业 clzy)
        {
            System.Diagnostics.Debug.Assert(clzy != null, "承运时间要求详情车辆作业不能为空");

            InitializeComponent();
            m_clzy = clzy;

            m_dm = new DisplayManager<车辆作业>(null);
            AssociateDataControls(new Control[] {
                pnl作业号, pnl车主, pnl车牌号, pnl驾驶员, pnl驾驶员联系方式, pnl车主联系方式
                }, m_dm, "实时监控_车辆作业_承运时间要求详情");

            m_任务集合区 = base.AssociateBoundGrid(pnl任务集合, "实时监控_车辆作业_承运时间要求详情_任务") as DataUnboundGrid;
        }
 public override IBindingControlCollection CreateBindingControlCollection(IDisplayManager dm)
 {
     if (dm is IDisplayManagerBindingSource)
     {
         BindingControlCollectionBindingSource ret = new BindingControlCollectionBindingSource();
         ret.ParentManager = dm;
         ret.BindingSource = (dm as IDisplayManagerBindingSource).BindingSource;
         return ret;
     }
     else
     {
         return base.CreateBindingControlCollection(dm);
     }
 }
        private void Initialize(WindowTabInfo windowTabInfo, IDisplayManager dmParent)
        {
            ISearchManager smMaster = ServiceProvider.GetService<IManagerFactory>().GenerateSearchManager(windowTabInfo, dmParent);

            IDisplayManager dmMaster = ServiceProvider.GetService<IManagerFactory>().GenerateDisplayManager(windowTabInfo, smMaster);

            this.SetDisplayManager(dmMaster, windowTabInfo.GridName);

            //ArchiveSearchForm searchForm = new ArchiveSearchForm(this, smMaster, tabInfos[0]);
            //this.SearchPanel = searchForm;

            if (this is IBoundGridWithDetailGridLoadOnDemand)
            {
                ArchiveFormFactory.GenerateDetailGrids((IBoundGridWithDetailGridLoadOnDemand)this, windowTabInfo);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="masterGrid"></param>
        /// <param name="dmMaster"></param>
        public ArchiveSetupForm(IGrid masterGrid, IDisplayManager dmMaster)
        {
            InitializeComponent();

            m_masterGrid = masterGrid;
            m_dmMaster = dmMaster;

            if (m_masterGrid == null)
            {
                this.myTabControl1.TabPages.Remove(this.tabPage1);
            }
            if (m_dmMaster == null)
            {
                this.myTabControl1.TabPages.Remove(this.tabPage2);
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="gridName"></param>
        /// <param name="dm"></param>
        /// <param name="parentForm"></param>
        public GridGotoFormTaskPane(string gridName, IDisplayManager dm, IArchiveMasterForm parentForm)
        {
            XceedUtility.SetUIStyle(this);

            LoadMenus(gridName);
            m_parentForm = parentForm;
            m_dm = dm;

            IArchiveMasterForm archiveSeeForm = parentForm;
            if (archiveSeeForm != null)
            {
                archiveSeeForm.MasterGrid.GridControl.CurrentRowChanged += new EventHandler(MasterGrid_CurrentRowChanged);

                MasterGrid_CurrentRowChanged(archiveSeeForm.DisplayManager, System.EventArgs.Empty);
            }
        }
Пример #48
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="column"></param>
 /// <param name="info"></param>
 public static void CreateCellEditorManager(Xceed.Grid.Column column, GridColumnInfo info, IDisplayManager dm)
 {
     try
     {
         Xceed.Grid.Editors.CellEditorManager editor = ControlFactory.CreateCellEditorManager(dm.Name,
             info.CellEditorManager, info.CellEditorManagerParam, GridColumnInfoHelper.CreateType(info), (string)ParamCreatorHelper.TryGetParam(info.CellEditorManagerParamFilter),
             info.CellViewerManagerParam);
         if (editor != null)
         {
             column.CellEditorManager = editor;
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException("GridColumnInfo of " + info.Name + " is Invalid when CreateCellEditorManager!", ex);
     }
 }
Пример #49
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="checkForm"></param>
        /// <param name="presetValues"></param>
        /// <returns></returns>
        public static ArchiveCheckForm Execute(IDisplayManager dm, ArchiveCheckForm checkForm, Dictionary<string, object> presetValues)
        {
            if (presetValues != null)
            {
                foreach (KeyValuePair<string, object> kvp in presetValues)
                {
                    if (kvp.Value == null)
                    {
                        MessageForm.ShowError("请先填写" + kvp.Key + "!");
                        return null;
                    }
                }

                ISearchManager smc = checkForm.DisplayManager.SearchManager;
                if (smc != null)
                {
                    foreach (KeyValuePair<string, object> kvp in presetValues)
                    {
                        smc.SearchControls[kvp.Key].SelectedDataValues = new System.Collections.ArrayList { kvp.Value };
                    }
                }
            }

            DialogResult ret = checkForm.ShowDialog();
            if (ret == DialogResult.OK)
            {
                if (presetValues != null)
                {
                    foreach (KeyValuePair<string, object> kvp in presetValues)
                    {
                        dm.DataControls[kvp.Key].ReadOnly = true;

                        // save controlValue to entity
                        EntityScript.SetPropertyValue(dm.CurrentItem, kvp.Key,
                            dm.DataControls[kvp.Key].SelectedDataValue);
                    }
                }

                //IControlManager detailCm = ((ArchiveDetailFormAutoWithDetailGrid)detailForm).DetailGrid.ControlManager;
                return checkForm;
            }

            return null;
        }
    public void Initialize(GameObject displayContainer)
    {
        _displayContainer = displayContainer;

        Preloader.instance.ResetDisplayIndex ();

        _currentDisplayManager = GetCurrentDisplayManager ();

        //if none of the tags are supported we have to prevent initialization and show a message or something
        if (_currentDisplayManager == null) {
            //TODO SHOW UNSUPPORTED MESSAGE
        } else {
            _currentDisplayManager.gameObject.SetActive (true);
            _currentDisplayManager.InitializeDisplay (Preloader.instance.GetRunningDisplayId());

            _cyclingDisplay = false;
            _lastCycleTime = Time.time;

            _initialized = true;
        }
    }
Пример #51
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="column"></param>
        /// <param name="info"></param>
        public static void CreateCellViewerManager(Xceed.Grid.Column column, GridColumnInfo info, IDisplayManager dm)
        {
            try
            {
                Xceed.Grid.Viewers.CellViewerManager viewer = ControlFactory.CreateCellViewerManager(dm.Name,
                    info.CellViewerManager, info.CellViewerManagerParam, GridColumnInfoHelper.CreateType(info));
                if (viewer != null)
                {
                    column.CellViewerManager = viewer;

                    System.Collections.IComparer comp = ControlFactory.CreateColumnDataComparer(
                        info.CellViewerManager, info.CellViewerManagerParam, GridColumnInfoHelper.CreateType(info));
                    if (comp != null)
                    {
                        column.DataComparer = comp;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new ArgumentException("GridColumnInfo of " + info.Name + " is Invalid when CreateCellViewerManager!", ex);
            }
        }
        private void 实时监控异常处理_Load(object sender, EventArgs e)
        {
            m_dm = AssociateDataControlsInDisplayManager(new Control[] {
                pnl作业号, pnl车牌号, pnl任务性质, pnl货物特征, pnl时间要求, pnl起始地途经地终止地,
                 pnl备注,  pnl理由 }, "实时监控_车辆作业_作业退回申请");

            StringBuilder sb = new StringBuilder();
            using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<专家任务>())
            {
                var clzy = rep.Get<车辆作业>(m_clzy.ID);

                m_dm.SetDataBinding(new List<车辆作业> { clzy }, string.Empty);

                foreach (var rw in clzy.专家任务.任务)
                {
                    if (sb.Length > 0)
                        sb.Append(",");
                    sb.Append(rw.货物特征);
                }
            }
            m_dm.DataControls["货物特征"].SelectedDataValue = sb.ToString();

            m_dm.DataControls["理由"].ReadOnly = false;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dmParent"></param>
        /// <param name="tableName"></param>
        /// <param name="defaultOrder"></param>
        /// <param name="selectClause"></param>
        /// <param name="groupByClause"></param>
        /// <param name="searchExpression"></param>
        /// <param name="searchOrder"></param>
        /// <param name="innerSearchManagerType"></param>
        public SearchManagerProxyDetailInMaster(IDisplayManager dmParent, string tableName, string defaultOrder, string selectClause, string groupByClause, string searchExpression, string searchOrder, string innerSearchManagerType)
            : base(dmParent)
        {
            switch (innerSearchManagerType.ToUpper())
            {
                case "":
                case "NORMAL":
                    m_innerSearchManager = new SearchManager(tableName, defaultOrder, selectClause, groupByClause);
                    break;
                case "FUNCTION":
                    m_innerSearchManager = new SearchManagerFunction(tableName, defaultOrder);
                    break;
                case "PROCEDURE":
                    m_innerSearchManager = new SearchManagerProcedure(tableName);
                    break;
                default:
                    throw new NotSupportedException("innerSearchManagerType is invalid!");
            }

            m_searchExpression = searchExpression;
            m_searchOrder = searchOrder;

            m_innerSearchManager.EnablePage = false;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="controlGroupName"></param>
 public ArchiveDetailFormWithDetailGrids(IDisplayManager dm, string controlGroupName)
     : base(dm, controlGroupName)
 {
     InitializeComponent();
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown (KeyCode.Backspace)) {
            FinalizeController();
        }

        // TODO Should be somewhere else ? Also useless?
        if (Input.GetKeyDown (KeyCode.Escape)) {
            Application.Quit();
        }

        //If the controller was not initialized we wont do any of what follows
        if (!_initialized)
            return;

        _readyToCycle = (_currentDisplayManager.timeDriven && Time.time - _lastCycleTime > _currentDisplayManager.cycleTime) ||
            (!_currentDisplayManager.timeDriven && _currentDisplayManager.readyToCycle) || _currentDisplayManager.forceCycle;

        if (_readyToCycle)
        {
            //if we are on video Display and the next one is a video display too
            if (_currentDisplayManager is VideoDisplayManager && Preloader.instance.GetNextDisplayType() == DisplayType.VIDEO)
            {
                // Add 1 to the current index and initialize the next display
                Preloader.instance.SetNextDisplayIndex();
                (_currentDisplayManager as VideoDisplayManager).AddNextVideo(Preloader.instance.GetRunningDisplayId());

                _cyclingDisplay = false;
                _lastCycleTime = Time.time;
            }
            else
            {
                if (!_cyclingDisplay && !_currentDisplayManager.forceCycle)
                {
                    if (_currentDisplayManager is PhotographyDisplayManager && Preloader.instance.GetNextDisplayType() == DisplayType.VIDEO)
                    {
                        (_currentDisplayManager as PhotographyDisplayManager).SetAuxPhoto();
                    }
                    else if (_currentDisplayManager is VideoDisplayManager && Preloader.instance.GetNextDisplayType() == DisplayType.PHOTOGRAPHY)
                    {
                        (_currentDisplayManager as VideoDisplayManager).SetAuxPhoto(Preloader.instance.GetNextDisplayFirstPhoto());
                    }

                    //Start the out animation for every avaialable display animator
                    foreach (Animator displayAnimator in _currentDisplayManager.animators)
                    {
                        if (displayAnimator.gameObject.activeSelf)
                        {
                            displayAnimator.SetTrigger("DisplayOut");
                        }
                    }

                    _currentDisplayManager.DisplayOut();
                    _cyclingDisplay = true;
                }
                else
                {
                    bool stillCycling = false;

                    stillCycling = !_currentDisplayManager.DisplayOutFinished;

                    if (!stillCycling && !_currentDisplayManager.forceCycle)
                    {
                        //We check in every display animator if the out animation finished
                        foreach (Animator displayAnimator in _currentDisplayManager.animators)
                        {
                            if (displayAnimator.gameObject.activeSelf)
                            {
                                if (!displayAnimator.GetCurrentAnimatorStateInfo(0).IsName("DisplayOut"))
                                {
                                    stillCycling = true;
                                }
                                else if (displayAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1f)
                                {
                                    stillCycling = true;
                                }
                            }
                        }
                    }

                    //For now we just call the same display in animation
                    if (!stillCycling)
                    {
                        // Finalize and de activate the current display
                        _currentDisplayManager.FinalizeDisplay();
                        _currentDisplayManager.gameObject.SetActive(false);

                        // Add 1 to the current index and initialize the next display
                        Preloader.instance.SetNextDisplayIndex();

                        _currentDisplayManager = GetCurrentDisplayManager();
                        if (_currentDisplayManager == null)
                        {
                            _initialized = false;
                            return;
                        }
                        _currentDisplayManager.gameObject.SetActive(true);

                        //Here we should send the right display id to retreive the right data
                        _currentDisplayManager.InitializeDisplay(Preloader.instance.GetRunningDisplayId());

                        _cyclingDisplay = false;
                        _lastCycleTime = Time.time;
                    }
                }
            }
        }
    }
Пример #56
0
 public DisplayHelperFactory(IDisplayManager displayManager, IShapeFactory shapeFactory)
 {
     _displayManager = displayManager;
     _shapeFactory = shapeFactory;
 }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                foreach (SmartItem item in this.Items)
                {
                    foreach (SmartItem subItem in item.Items)
                    {
                        subItem.Click -= new Xceed.SmartUI.SmartItemClickEventHandler(GridGotoFormTaskPane_Click);
                    }
                }
                this.Items.Clear();

                var archiveSeeForm = m_parentForm;
                if (archiveSeeForm != null)
                {
                    archiveSeeForm.MasterGrid.GridControl.CurrentRowChanged -= new EventHandler(MasterGrid_CurrentRowChanged);
                }
                m_parentForm = null;

                if (m_dm != null)
                {
                    m_dm.Dispose();
                    m_dm = null;
                }
            }
            base.Dispose(disposing);
        }
 /// <summary>
 /// 创建IBindingControlCollection
 /// </summary>
 /// <param name="dm"></param>
 /// <returns></returns>
 public virtual IBindingControlCollection CreateBindingControlCollection(IDisplayManager dm)
 {
     IBindingControlCollection ret = new BindingControlCollection();
     ret.ParentManager = dm;
     return ret;
 }
 /// <summary>
 /// 创建IDataControlCollection
 /// </summary>
 /// <param name="dm"></param>
 /// <returns></returns>
 public virtual IDataControlCollection CreateDataControlCollection(IDisplayManager dm)
 {
     IDataControlCollection ret = new DataControlCollection();
     ret.ParentManager = dm;
     return ret;
 }
        private static void ReloadNvFromGridCell(EventProcessInfo eventProcessInfo, IDisplayManager dm, Xceed.Grid.Cell cell, string changedDataControlName)
        {
            string[] columns = eventProcessInfo.ExecuteParam.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string s in columns)
            {
                Xceed.Grid.Cell iCell = cell.ParentRow.Cells[s];
                if (iCell == null)
                {
                    continue;
                    //throw new ArgumentException("there is no column with name " + s + "!");
                }
                GridColumnInfo iInfo = iCell.ParentColumn.Tag as GridColumnInfo;

                switch (iInfo.CellEditorManager)
                {
                    case "Combo":
                    case "MultiCombo":
                    case "FreeCombo":
                        {
                            NameValueMapping nv = NameValueMappingCollection.Instance[iInfo.CellEditorManagerParam];
                            List<string> ls = new List<string>();
                            foreach (KeyValuePair<string, object> kvp in nv.Params)
                            {
                                ls.Add(kvp.Key.Substring(1));
                            }
                            if (!ls.Contains(changedDataControlName))
                                continue;

                            iCell.Value = null;
                            foreach (string key in ls)
                            {
                                object o = GetDataCellValue(key, iCell).Item2;
                                nv.Params["@" + key] = o == null ? System.DBNull.Value : o;
                            }
                            NameValueMappingCollection.Instance.Reload(dm.Name, iInfo.CellEditorManagerParam);

                            // when in grid, we can't use comboBox's DataTableChanged because combobox only created when in edit
                            System.Data.DataView dv = NameValueMappingCollection.Instance.GetDataSource(dm.Name, iInfo.CellEditorManagerParam, iInfo.CellEditorManagerParamFilter);
                            if (dv.Count == 1)
                            {
                                object toValue = dv[0][NameValueMappingCollection.Instance[iInfo.CellEditorManagerParam].ValueMember];
                                if (!Feng.Utils.ReflectionHelper.ObjectEquals(iCell.Value, toValue))
                                {
                                    dm.OnSelectedDataValueChanged(new SelectedDataValueChangedEventArgs(s, iCell));
                                }
                                iCell.Value = toValue;
                            }

                            iCell.ReadOnly = (dv.Count == 0);

                            nv.ResetParams();
                        }
                        break;
                    case "ObjectPicker":
                        {
                            // Todo: if (!ls.Contains(changedDataControlName))

                            iCell.Value = null;
                            Feng.Windows.Forms.MyObjectPicker op = (iCell.CellEditorManager as Feng.Grid.Editors.MyObjectPickerEditor).TemplateControl;
                            string exp = (string)ParamCreatorHelper.TryGetParam(iInfo.CellEditorManagerParamFilter);
                            exp = EntityHelper.ReplaceEntity(exp, new EntityHelper.GetReplaceValue(delegate(string paramName)
                            {
                                return GetDataCellValue(paramName, iCell).Item2;
                            }));
                            op.DropDownControl.DisplayManager.SearchManager.LoadData(SearchExpression.Parse(exp), null);
                        }
                        break;
                }
            }
        }