Ejemplo n.º 1
0
        private NSerializationFilter GetSeriazliationFilter()
        {
            PersistencyFormat format = (PersistencyFormat)SerializationFormatComboBox.SelectedIndex;

            if (format.Equals(PersistencyFormat.Binary) || format.Equals(PersistencyFormat.XML) || format.Equals(PersistencyFormat.SOAP))
            {
                return(null);
            }

            NSerializationFilter filter = null;

            switch (SerializationContentComboBox.SelectedIndex)
            {
            case 0:                     // All
                filter = null;
                break;

            case 1:                     // Data
                filter = new NDataSerializationFilter();
                break;

            case 2:                     // Appearance
                filter = new NAppearanceSerializationFilter();
                break;
            }

            return(filter);
        }
        private void LoadSecondChartButton_Click(object sender, System.EventArgs e)
        {
//			MemoryStream stream = new MemoryStream();
            NSerializationFilter filter = null;

            switch (SerializationContentComboBox.SelectedIndex)
            {
            case 0:                     // All
                filter = null;
                break;

            case 1:                     // Data
                filter = new NDataSerializationFilter();
                break;

            case 2:                     // Appearance
                filter = new NAppearanceSerializationFilter();
                break;
            }

            if (m_Chart2 != null)
            {
                nChartControl1.Panels.Remove(m_Chart2);
            }

            // clone the first chart
            m_Chart2 = (NChart)(nChartControl1.Charts[0].CloneWithNewUniqueId(null));

            // filter elements
            m_Chart2          = (NChart)nChartControl1.Serializer.DeepClone(m_Chart2, filter);
            m_Chart2.Location = new NPointL(
                new NLength(10, NRelativeUnit.RootPercentage),
                new NLength(55, NRelativeUnit.RootPercentage));

            // add to panels collection
            nChartControl1.Panels.Add(m_Chart2);
            nChartControl1.Refresh();
        }