Ejemplo n.º 1
0
 private void OutputChangedHandler(object sender, EventArgs e)
 {
     if (yesOutputButton.Checked)
     {
         Output = DataElementOutput.Output;
     }
     else if (noOutputButton.Checked)
     {
         Output = DataElementOutput.NoOutput;
     }
     else if (autoOutputButton != null && autoOutputButton.Checked)
     {
         Output = DataElementOutput.Auto;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates an ReportItem from its RDL representation.
        /// </summary>
        /// <param name="reader">The <typeparamref name="XmlReader"/> stream from which the ReportItem is deserialized</param>
        public void ReadXml(XmlReader reader)
        {
            if (reader.AttributeCount > 0)
            {
                _name = reader[Rdl.NAME];
            }

            if (reader.IsEmptyElement)
            {
                return;
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == GetRootElement())
                {
                    break;
                }
                else if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
                {
                    //--- Delegate to the implementing class for any additional attributes
                    ReadRDL(reader);

                    //--- Style
                    if (reader.Name == Rdl.STYLE)
                    {
                        if (_style == null)
                        {
                            _style = new Style();
                        }

                        ((IXmlSerializable)_style).ReadXml(reader);
                    }


                    //--- Top
                    if (reader.Name == Rdl.TOP)
                    {
                        _top = Size.Parse(reader.ReadString());
                    }

                    //--- Left
                    if (reader.Name == Rdl.LEFT)
                    {
                        _left = Size.Parse(reader.ReadString());
                    }

                    //--- Height
                    if (reader.Name == Rdl.HEIGHT)
                    {
                        _height = Size.Parse(reader.ReadString());
                    }

                    //--- Width
                    if (reader.Name == Rdl.WIDTH)
                    {
                        _width = Size.Parse(reader.ReadString());
                    }

                    //--- ZIndex
                    if (reader.Name == Rdl.ZINDEX)
                    {
                        _zIndex = int.Parse(reader.ReadString());
                    }

                    //--- Visibility
                    if (reader.Name == Rdl.VISIBILITY)
                    {
                        if (_visibility == null)
                        {
                            _visibility = new Visibility();
                        }

                        ((IXmlSerializable)_visibility).ReadXml(reader);
                    }

                    //--- ToolTip
                    if (reader.Name == Rdl.TOOLTIP)
                    {
                        if (_toolTip == null)
                        {
                            _toolTip = new Expression();
                        }

                        _toolTip.Value = reader.ReadString();
                    }

                    //--- Label
                    if (reader.Name == Rdl.LABEL)
                    {
                        if (_label == null)
                        {
                            _label = new Expression();
                        }

                        _label.Value = reader.ReadString();
                    }

                    //--- LinkToChild
                    if (reader.Name == Rdl.LINKTOCHILD)
                    {
                        _linkToChild = reader.ReadString();
                    }

                    //--- Bookmark
                    if (reader.Name == Rdl.BOOKMARK)
                    {
                        if (_bookmark == null)
                        {
                            _bookmark = new Expression();
                        }

                        _bookmark.Value = reader.ReadString();
                    }

                    //--- RepeatWith
                    if (reader.Name == Rdl.REPEATWITH)
                    {
                        _repeatWith = reader.ReadString();
                    }

                    //--- CustomProperties
                    if (reader.Name == Rdl.CUSTOMPROPERTIES)
                    {
                        if (_customProperties == null)
                        {
                            _customProperties = new CustomPropertiesCollection();
                        }

                        ((IXmlSerializable)_customProperties).ReadXml(reader);
                    }

                    //--- DataElementName
                    if (reader.Name == Rdl.DATAELEMENTNAME)
                    {
                        _dataElementName = reader.ReadString();
                    }

                    //--- DataElementOutput
                    if (reader.Name == Rdl.DATAELEMENTOUTPUT)
                    {
                        _dataElementOutput = (DataElementOutput)Enum.Parse(typeof(DataElementOutput), reader.ReadString());
                    }
                }
            }
        }