예제 #1
0
        private void LeadListForm_Load(object sender, EventArgs e)
        {
            ObjectGridView.InitWithDefaultLayout(ObjectName);
            RegisterEventHandlers();


            //apply formats.
            if (this.ObjectGridView is GridView)
            {
                FormatRequestMessage msg = new FormatRequestMessage();
                msg.ObjectName = this.ObjectName;
                msg.GridView   = this.ObjectGridView;
                EventAggregationManager.SendMessage <FormatRequestMessage>(msg);
            }
        }
        /// <summary>
        /// FormatRequestMessage Entry
        /// </summary>
        /// <param name="message"></param>
        public void Handle(FormatRequestMessage message)
        {
            string fileName = this.GetFileName(message.ObjectName);
            IList <FormatCondition> conditions = this.GetFormatConditions(fileName);
            var activeConditons = conditions.Where(c => c.Active);

            GridView gridview = message.GridView as GridView;

            gridview.BeginUpdate();
            gridview.FormatConditions.Clear();
            foreach (FormatCondition conditionSetting in activeConditons)
            {
                var condition = CreateStyleFormatCondition(conditionSetting);
                gridview.FormatConditions.Add(condition);
            }
            gridview.EndUpdate();
        }