Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        private PictureBox AddStatusImage(int row, Session.Status status)
        {
            var statusPicBox = new PictureBox
            {
                Name     = "picture_" + status,
                Anchor   = AnchorStyles.Top | AnchorStyles.Left,
                Image    = ResourceImageCache.GetBitmap("Status" + status),
                Margin   = new Padding(5, 4, 0, 2),
                SizeMode = PictureBoxSizeMode.AutoSize,
            };

            statusPicBox.Size = statusPicBox.Image.Size;

            var toolTip = GetStatusToolTip(status);

            if (toolTip != null)
            {
                _toolTip.SetToolTip(statusPicBox, toolTip);
            }

            statusPicBox.MouseEnter += delegate
            {
                _toolTip.ToolTipTitle = Session.GetLocalizedStatus(status.ToString());
            };

            if (row == _tableLayoutOuter.GetRow(_labelStages))
            {
                _tableLayoutOuter.RowStyles.Insert(row, new RowStyle(SizeType.AutoSize));
            }

            _tableLayoutOuter.Controls.Add(statusPicBox, 0, row);
            return(statusPicBox);
        }
Esempio n. 2
0
        /// ------------------------------------------------------------------------------------
        protected override object GetValueForField(ProjectElement element, string fieldName)
        {
            if (fieldName == SessionFileType.kStatusFieldName)
            {
                var    value      = element.MetaDataFile.GetStringValue(fieldName, string.Empty, false);
                var    objectName = "Status" + Session.GetStatusAsEnumParsableString(value);
                object obj;
                if (!_statusIcons.TryGetValue(objectName, out obj))
                {
                    obj = ResourceImageCache.GetBitmap(objectName);
                    _statusIcons[objectName] = obj;
                }
                return(obj);
            }

            if (fieldName == SessionFileType.kStagesFieldName)
            {
                return(_stagesDataProvider.CreateImageForComponentStage(element.GetCompletedStages()));
            }

            if (fieldName == SessionFileType.kDateFieldName)
            {
                var date = base.GetValueForField(element, fieldName);
                return(date);
            }

            return(base.GetValueForField(element, fieldName));
        }