public void parameterizeCollectionEventPropertyNode(CollectionEventProperty ceProp, TreeNode node)
        {
            if (ceProp != null && node != null)
            {
                StringBuilder text = new StringBuilder();
                if (!ceProp.DisplayText.Equals(String.Empty))
                    text.Append(ceProp.DisplayText);

                if (con != null)
                {
                    IRestriction res = RestrictionFactory.Eq(typeof(Property), "_PropertyID", ceProp.PropertyID);
                    Property prop = con.Load<Property>(res);

                    if (prop != null && !prop.DisplayText.Equals(String.Empty))
                    {
                        text.Append(" (");
                        text.Append(prop.DisplayText);
                        text.Append(")");
                    }
                }

                node.Text = text.ToString();
                node.ImageIndex = node.SelectedImageIndex = (int)TreeViewIconIndex.SiteProperty;
                node.Tag = new TreeViewNodeData((int)ceProp.PropertyID, TreeViewNodeTypes.SitePropertyNode);
            }
        }
        public EventPropertyForm(CollectionEventProperty ceProp)
            : this(true)
        {
            if (ceProp != null)
            {
                this._ceProp = ceProp;
                Cursor.Current = Cursors.WaitCursor;

                Property prop = null;

                try
                {
                    prop = DataFunctions.Instance.RetrieveProperty((int)_ceProp.PropertyID);
                }
                catch (ConnectionCorruptedException ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    this.Close();
                }

                // fill Form
                if (prop != null)
                {
                    if (prop.DisplayText != null)
                        this.labelCaption.Text = prop.DisplayText;
                }

                if (_ceProp.AverageValueCache != null)
                    this.labelAverageValue.Text = _ceProp.AverageValueCache.ToString();

                if (_ceProp.DisplayText != null)
                    this.textBoxDisplayText.Text = _ceProp.DisplayText;

                if (_ceProp.PropertyValue != null)
                    this.textBoxValue.Text = _ceProp.PropertyValue;

                if (_ceProp.ResponsibleName != null)
                    this.labelResponsible.Text = _ceProp.ResponsibleName;

                Cursor.Current = Cursors.Default;
            }
            else
                this.Close();
        }
 public EventPropertyVM(CollectionEventProperty p)
     : base(p)
 {
 }