Esempio n. 1
0
        private void DisposeChart()
        {
            panel.AutoScroll = false;
            panel.AutoScroll = true;

            chartBox.Reset();

            if (chartBox.PureImage != null)
            {
                chartBox.PureImage.Dispose();
            }

            wasMaximized = false;

            if (panel.Controls.Count > 1)
            {
                for (int i = 1; i < panel.Controls.Count; i++)
                {
                    ChartBox box = (ChartBox)panel.Controls[i];
                    box.DisposePrice();
                    panel.Controls.RemoveAt(i);
                }

                chartBox.Height = panel.Height - 19;
                //panel.ResizeMainChart(false);
            }

            //MessageBox.Show("cleared");
            instances           = new List <IGraphicsProvider>();
            panel.DisplayedUIDs = new List <Guid>();
        }
Esempio n. 2
0
        public void SetNodeText(ICustomPaint theObject, TreeNode theNode)
        {
            if (theObject is TextField)
            {
                TextField txtField = (TextField)theObject;
                string    theText  = txtField.Text.Length > 25 ? txtField.Text.Substring(0, 25) + "..." : txtField.Text;
                theNode.Name = txtField.Name;
                theNode.Text = "Text field [" + theText + "]";
            }
            else if (theObject is daReport.PictureBox)
            {
                theNode.Text = "Picture";
            }
            else if (theObject is daReport.ChartBox)
            {
                ChartBox chartBox = (ChartBox)theObject;
                theNode.Text = "Chart [" + chartBox.Name + "]";
            }
            else if (theObject is daReport.StyledTable)
            {
                StyledTable styledTable = (StyledTable)theObject;

                if (styledTable.DataSource != null)
                {
                    theNode.Text = "Styled table [" + styledTable.DataSource + "]";
                }
                else
                {
                    theNode.Text = "Styled table";
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Edits the value of the specified object using the editor style indicated by GetEditStyle.
        /// </summary>
        /// <param name="context">An ITypeDescriptorContext that can be used to gain additional context information.</param>
        /// <param name="provider">An IServiceProvider that this editor can use to obtain services. </param>
        /// <param name="value">The object to edit. </param>
        /// <returns>The new value of the object.</returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc = ((IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)));

            if (edSvc == null)
            {
                return(null);
            }

            if (context.Instance is ChartBox)
            {
                ChartBox chartBox = context.Instance as ChartBox;
                if (chartBox.Categories.Length == 0)
                {
                    MessageBox.Show("At least one category must be defined in order to set chart data.\nSet categories through Categories property.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(value);
                }
            }

            ChartDataEditorDialog f = new ChartDataEditorDialog();

            f.Data = value;
            if (edSvc.ShowDialog(f) == DialogResult.OK)
            {
                return((object)f.Data);
            }

            //If OK was not pressed, return the original value
            return(value);
        }
Esempio n. 4
0
    private void AddChart()
    {
        ChartBox subChart = chartBox.AddSubChart();

        subChart.UID = uid;
        //uid = subChart.UID;

        Chart volume = new Chart(chartBox.Charts[0].Values);

        volume.Type        = GraphicsProvider.Chart.ChartType.Volume;
        volume.VolumeColor = color;

        subChart.Charts.Add(volume);

        subChart.BaseChartIndex = 0;

        subChart.CalculateAll();
        subChart.DrawAll();

        subChart.Image = subChart.PureImage;

        subChart.DrawPrice();

        isDrawn = true;
    }
Esempio n. 5
0
        private void InitializeChart()
        {
            ChartBox cbox = new ChartBox();

            cbox.Figures.Add(new FigureBars());
            this._chartControl.ChartPanels.Add(cbox);
            _chartControl.Symbol = _symbol;
            this.UpdateText();
        }
Esempio n. 6
0
        void ChartBoxMouseDown(object sender, MouseEventArgs e)
        {
            foreach (ChartBox smallBox in panel.Controls)
            {
                smallBox.RemoveTick();
            }

            ChartBox box = (ChartBox)sender;

            toolStripStatusLabelDate.Text  = box.GetDate(e.X).ToShortDateString();
            toolStripStatusLabelPrice.Text = Decimal.Round(box.GetPrice(e.Y), 2).ToString();

            box.PutTick(e.X, e.Y);
        }
Esempio n. 7
0
        private void _chartControl_DragDrop(object sender, DragEventArgs e)
        {
            if (!e.Data.GetDataPresent(typeof(IndicatorItem)))
            {
                return;
            }
            ChartBox cbox = this._chartControl.GetChartPanel(new Point(e.X, e.Y)) as ChartBox;

            if (cbox == null)
            {
                return;
            }
            IndicatorItem indicatorItem = e.Data.GetData(typeof(IndicatorItem)) as IndicatorItem;

            FigureIndicator figure = new FigureIndicator(indicatorItem.IndicatorType);

            cbox.Figures.Add(figure);
            Global.MainForm.Properties.SetPropertiesObject(figure);
        }
Esempio n. 8
0
        private void ProcessR_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            Debug.WriteLine(e.Data);
            if (e.Data == null)
            {
                return;
            }
            string data = e.Data.ToString().Replace("\"", "");

            if (data.Contains("[1] "))
            {
                ChartBox.Invoke((MethodInvoker)(() =>
                {
                    ChartBox.Image = Image.FromFile(data.Substring(4, data.Length - 4) + ".png");
                }
                                                ));
                RLabel.Invoke((MethodInvoker)(() =>
                {
                    RLabel.Visible = false;
                }
                                              ));
            }
        }
Esempio n. 9
0
        protected override void OnChartMouseDown(MouseEventArgs e)
        {
            base.OnChartMouseDown(e);

            if (!ChartBox.Focused)
            {
                ChartBox.Focus();
            }

            IsMouseDown  = true;
            MouseDownPos = new Point(e.X, e.Y);
            PressObject  = HitTest(e.X, e.Y);
            LastMousePos = MouseDownPos;

            if (EditMode)
            {
                EndEdit(true);
            }

            ToolTipLayer.HideAllToolTips();

            // if the Shift is press, maybe is hover hyperlink, or reverse MouseMethod
            ChartMouseMethod mouseMethod = MouseMethod;

            if (Helper.TestModifierKeys(Keys.Shift))
            {
                if (mouseMethod == ChartMouseMethod.Select)
                {
                    mouseMethod = ChartMouseMethod.Scroll;
                }
            }

            //
            if (mouseMethod == ChartMouseMethod.Scroll)
            {
                _ResetCursor();
            }
            else if (mouseMethod == ChartMouseMethod.Select)
            {
                if (PressObject.Topic != null)
                {
                    if (PressObject.IsFoldingButton)
                    {
                        PressObject.Topic.Toggle();
                    }
                    else if (PressObject.Widget != null)
                    {
                        if (!PressObject.Widget.Selected)
                        {
                            Select(PressObject.Widget, !Helper.TestModifierKeys(Keys.Control));
                        }
                        else if (Helper.TestModifierKeys(Keys.Control))
                        {
                            Unselect(PressObject.Widget);
                        }
                    }
                    else
                    {
                        if (!PressObject.Topic.Selected)
                        {
                            Select(PressObject.Topic, !Helper.TestModifierKeys(Keys.Control));
                            //SelectTopic(PressObject.Topic, !Helper.TestModifierKeys(Keys.Control));
                        }
                        else if (Helper.TestModifierKeys(Keys.Control))
                        {
                            Unselect(PressObject.Topic);
                        }
                    }
                }
                else if (e.Button == MouseButtons.Left)
                {
                    if (!Helper.TestModifierKeys(Keys.Control))
                    {
                        ClearSelection();
                    }
                    EnterSelectMode();
                }
            }
        }
Esempio n. 10
0
        public static void WriteReport(string theFilename, ArrayList parameters, ICustomPaint[] staticObjects, ICustomPaint[] dynamicObjects, DaPrintDocument printDocument)
        {
            StreamWriter sw = new StreamWriter(theFilename, false, System.Text.Encoding.UTF8);
            //sw.Write("<?xml version='1.0' encoding='utf-8'?>");
            string theLayout = "Portrait";

            if (printDocument.Layout == DaPrintDocument.LayoutType.Landscape)
            {
                theLayout = "Landscape";
            }
            sw.WriteLine("<daReport papersize=\"" + printDocument.PaperType.ToString() + "\" layout=\"" + theLayout + "\">");
            sw.WriteLine("<margins left=\"" + printDocument.Margins.Left + "\" top=\"" + printDocument.Margins.Top + "\" right=\"" + printDocument.Margins.Right + "\" bottom=\"" + printDocument.Margins.Bottom + "\"></margins>");

            // write down report parameters
            if (parameters != null || parameters.Count > 0)
            {
                sw.WriteLine("<parameters>");
                for (int i = 0; i < parameters.Count; i++)
                {
                    sw.WriteLine("   <parameter name=\"" + parameters[i] + "\" />");
                }
                sw.WriteLine("</parameters>");
            }
            // end writing parameters

            sw.WriteLine("<content>");

            // writing down static objects
            if (staticObjects.Length > 0)
            {
                sw.WriteLine("<staticContent>");
                for (int i = 0; i < staticObjects.Length; i++)
                {
                    if (staticObjects[i] is TextField)
                    {
                        TextField txtField = (TextField)staticObjects[i];
                        sw.WriteLine(" ");
                        sw.WriteLine("<textField name=\"" + txtField.Name.ToString() + "\" x=\"" + txtField.X + "\" y=\"" + txtField.Y + "\" width=\"" + txtField.Width + "\" height=\"" + txtField.Height + "\" horAlignment=\"" + txtField.HorizontalAlignment.ToString() + "\" verAlignment=\"" + txtField.VerticalAlignment.ToString() + "\" Selectable=\"" + txtField.Selectable.ToString() + "\">");
                        sw.WriteLine("<text horAlignment=\"" + txtField.TextAlignment.ToString() + "\" verAlignment=\"" + txtField.TextVerticalAlignment.ToString() + "\">" + ReplaceForXML(txtField.Text) + "</text>");

                        if (txtField.Font != null)
                        {
                            string style = "";
                            if (txtField.Font.Bold && txtField.Font.Italic)
                            {
                                style = " style=\"Bold Italic\"";
                            }
                            else if (txtField.Font.Bold)
                            {
                                style = " style=\"Bold\"";
                            }
                            else if (txtField.Font.Italic)
                            {
                                style = " style=\"Italic\"";
                            }

                            sw.WriteLine("<font family=\"" + txtField.Font.Name + "\" size=\"" + txtField.Font.Size.ToString("f00") + "\" " + style + "></font>");
                        }

                        sw.WriteLine("<foregroundColor color=\"" + txtField.ForegroundColor.Name + "\"></foregroundColor>");
                        sw.WriteLine("<backgroundColor color=\"" + txtField.BackgroundColor.Name + "\"></backgroundColor>");
                        sw.WriteLine("<border width=\"" + txtField.BorderWidth.ToString() + "\" color=\"" + txtField.BorderColor.Name + "\"></border>");
                        sw.WriteLine("</textField>");
                    }
                    else if (staticObjects[i] is PictureBox)
                    {
                        PictureBox pictureBox = (PictureBox)staticObjects[i];
                        sw.WriteLine(" ");
                        sw.WriteLine("<pictureBox name=\"" + pictureBox.Name.ToString() + "\" x=\"" + pictureBox.X + "\" y=\"" + pictureBox.Y + "\" width=\"" + pictureBox.Width + "\" height=\"" + pictureBox.Height + "\" stretch=\"" + (pictureBox.Stretch == true ? "true" : "false") + "\"  horAlignment=\"" + pictureBox.HorizontalAlignment.ToString() + "\" verAlignment=\"" + pictureBox.VerticalAlignment.ToString() + "\" Selectable=\"" + pictureBox.Selectable.ToString() + "\">");

                        sw.WriteLine(@"<file>" + (pictureBox.ImageFile == null?" ":ReplaceForXML(pictureBox.ImageFile)) + "</file>");

                        sw.WriteLine("<border width=\"" + pictureBox.BorderWidth.ToString() + "\" color=\"" + pictureBox.BorderColor.Name + "\"></border>");
                        sw.WriteLine("</pictureBox>");
                    }
                    else if (staticObjects[i] is ChartBox)
                    {
                        ChartBox chartBox = (ChartBox)staticObjects[i];

                        string style = "";
                        if (chartBox.Type == ChartBox.ChartType.Pie)
                        {
                            style = " type=\"Pie\"";
                        }
                        else
                        {
                            style = " type=\"Bars\"";
                        }


                        sw.WriteLine(" ");
                        sw.WriteLine("<chartBox name=\"" + ReplaceForXML(chartBox.Name) + "\" x=\"" + chartBox.X + "\" y=\"" + chartBox.Y + "\" width=\"" + chartBox.Width + "\" height=\"" + chartBox.Height + "\" " + style + " horAlignment=\"" + chartBox.HorizontalAlignment.ToString() + "\" verAlignment=\"" + chartBox.VerticalAlignment.ToString() + "\" Selectable=\"" + chartBox.Selectable.ToString() + "\">");

                        sw.WriteLine("<title>" + ReplaceForXML(chartBox.Title) + "</title>");

                        if (chartBox.TitleFont != null)
                        {
                            string fontStyle = "";
                            if (chartBox.TitleFont.Bold && chartBox.TitleFont.Italic)
                            {
                                fontStyle = " style=\"Bold Italic\"";
                            }
                            else if (chartBox.TitleFont.Bold)
                            {
                                fontStyle = " style=\"Bold\"";
                            }
                            else if (chartBox.TitleFont.Italic)
                            {
                                fontStyle = " style=\"Italic\"";
                            }

                            sw.WriteLine("<titleFont family=\"" + chartBox.TitleFont.Name + "\" size=\"" + chartBox.TitleFont.Size.ToString("f00") + "\" " + fontStyle + "></titleFont>");
                        }

                        sw.WriteLine("<xLabel>" + ReplaceForXML(chartBox.XLabel) + "</xLabel>");

                        if (chartBox.LabelFont != null)
                        {
                            string fontStyle = "";
                            if (chartBox.LabelFont.Bold && chartBox.LabelFont.Italic)
                            {
                                fontStyle = " style=\"Bold Italic\"";
                            }
                            else if (chartBox.LabelFont.Bold)
                            {
                                fontStyle = " style=\"Bold\"";
                            }
                            else if (chartBox.LabelFont.Italic)
                            {
                                fontStyle = " style=\"Italic\"";
                            }

                            sw.WriteLine("<labelFont family=\"" + chartBox.LabelFont.Name + "\" size=\"" + chartBox.LabelFont.Size.ToString("f00") + "\" " + fontStyle + "></labelFont>");
                        }

                        sw.WriteLine("<mapAreaColor>" + chartBox.MapAreaColor.Name + "</mapAreaColor>");
                        sw.WriteLine("<showLegend>" + chartBox.ShowLegend.ToString() + "</showLegend>");
                        sw.WriteLine("<border width=\"" + chartBox.BorderWidth.ToString() + "\" color=\"" + chartBox.BorderColor.Name + "\"></border>");
                        sw.WriteLine("</chartBox>");
                    }
                    else if (staticObjects[i] is StyledTable)
                    {
                        // wrtie down table data
                        StyledTable styledTable = (StyledTable)staticObjects[i];
                        sw.WriteLine(" ");
                        sw.WriteLine("<table x=\"" + styledTable.X + "\" y=\"" + styledTable.Y + "\" width=\"" + styledTable.Width + "\" height=\"" + styledTable.Height + "\" drawEmptyRows=\"" + (styledTable.DrawEmptyRows == true?"true":"false") + "\" cellHeight=\"" + styledTable.CellHeight.ToString() + "\" horAlignment=\"" + styledTable.HorizontalAlignment.ToString() + "\" verAlignment=\"" + styledTable.VerticalAlignment.ToString() + "\" Selectable=\"" + styledTable.Selectable.ToString() + "\">");

                        string style = "";
                        if (styledTable.DataFont.Bold && styledTable.DataFont.Italic)
                        {
                            style = " style=\"Bold Italic\"";
                        }
                        else if (styledTable.DataFont.Bold)
                        {
                            style = " style=\"Bold\"";
                        }
                        else if (styledTable.DataFont.Italic)
                        {
                            style = " style=\"Italic\"";
                        }
                        sw.WriteLine("<font family=\"" + styledTable.DataFont.Name + "\" size=\"" + styledTable.DataFont.Size.ToString("f00") + "\" " + style + "></font>");

                        sw.WriteLine("<header headerColor=\"" + styledTable.HeaderBackgroundColor.Name + "\" headerFontColor=\"" + styledTable.HeaderFontColor.Name + "\">");

                        style = "";
                        if (styledTable.HeaderFont.Bold && styledTable.HeaderFont.Italic)
                        {
                            style = " style=\"Bold Italic\"";
                        }
                        else if (styledTable.HeaderFont.Bold)
                        {
                            style = " style=\"Bold\"";
                        }
                        else if (styledTable.HeaderFont.Italic)
                        {
                            style = " style=\"Italic\"";
                        }

                        sw.WriteLine("<font family=\"" + styledTable.HeaderFont.Name + "\" size=\"" + styledTable.HeaderFont.Size.ToString("f00") + "\" " + style + "></font>");

                        sw.WriteLine("</header>");

                        int numOfColumns = styledTable.Columns.Length;

                        sw.WriteLine("<columns>");
                        for (int j = 0; j < numOfColumns; j++)
                        {
                            string textAlignment = "Left";
                            if (styledTable.Columns[j].Alignment == StyledTableColumn.AlignmentType.Center)
                            {
                                textAlignment = "Center";
                            }
                            else if (styledTable.Columns[j].Alignment == StyledTableColumn.AlignmentType.Right)
                            {
                                textAlignment = "Right";
                            }
                            else
                            {
                                textAlignment = "Left";
                            }

                            sw.WriteLine("<column name=\"" + ReplaceForXML(styledTable.Columns[j].Name) + "\"  label=\"" + ReplaceForXML(styledTable.Columns[j].Label) + "\"  width=\"" + styledTable.Columns[j].Width + "\" align=\"" + textAlignment + "\"  />");
                        }

                        sw.WriteLine("</columns>");

                        if (styledTable.Data != null)
                        {
                            sw.WriteLine("<data>");

                            for (int j = 0; j < styledTable.Data.Rows.Count; j++)
                            {
                                sw.WriteLine("   <record>");

                                DataRow theRow = styledTable.Data.Rows[j];
                                for (int k = 0; k < styledTable.Data.Columns.Count; k++)
                                {
                                    sw.WriteLine("      <field>" + ReplaceForXML(theRow[k].ToString()) + "</field>");
                                }

                                sw.WriteLine("   </record>");
                            }
                            sw.WriteLine("</data>");
                        }

                        sw.WriteLine("</table>");
                    }
                }
                sw.WriteLine("</staticContent>");
            }

            // end writing static objects

            sw.WriteLine(" ");
            if (dynamicObjects.Length > 0)
            {
                sw.WriteLine("<dynamicContent>");
                for (int i = 0; i < dynamicObjects.Length; i++)
                {
                    if (dynamicObjects[i] is TextField)
                    {
                        TextField txtField = (TextField)dynamicObjects[i];
                        sw.WriteLine(" ");
                        sw.WriteLine("<textField name=\"" + txtField.Name.ToString() + "\" x=\"" + txtField.X + "\" y=\"" + txtField.Y + "\" width=\"" + txtField.Width + "\" height=\"" + txtField.Height + "\" horAlignment=\"" + txtField.HorizontalAlignment.ToString() + "\" verAlignment=\"" + txtField.VerticalAlignment.ToString() + "\" Selectable=\"" + txtField.Selectable.ToString() + "\">");
                        sw.WriteLine("<text horAlignment=\"" + txtField.TextAlignment.ToString() + "\" verAlignment=\"" + txtField.TextVerticalAlignment.ToString() + "\">" + ReplaceForXML(txtField.Text) + "</text>");

                        if (txtField.Font != null)
                        {
                            string style = "";
                            if (txtField.Font.Bold && txtField.Font.Italic)
                            {
                                style = " style=\"Bold Italic\"";
                            }
                            else if (txtField.Font.Bold)
                            {
                                style = " style=\"Bold\"";
                            }
                            else if (txtField.Font.Italic)
                            {
                                style = " style=\"Italic\"";
                            }

                            sw.WriteLine("<font family=\"" + txtField.Font.Name + "\" size=\"" + txtField.Font.Size.ToString("f00") + "\" " + style + "></font>");
                        }

                        sw.WriteLine("<foregroundColor color=\"" + txtField.ForegroundColor.Name + "\"></foregroundColor>");
                        sw.WriteLine("<backgroundColor color=\"" + txtField.BackgroundColor.Name + "\"></backgroundColor>");
                        sw.WriteLine("<border width=\"" + txtField.BorderWidth.ToString() + "\" color=\"" + txtField.BorderColor.Name + "\"></border>");
                        sw.WriteLine("</textField>");
                    }
                    else if (dynamicObjects[i] is StyledTable)
                    {
                        StyledTable styledTable = (StyledTable)dynamicObjects[i];
                        sw.WriteLine(" ");
                        sw.WriteLine("<table x=\"" + styledTable.X + "\" y=\"" + styledTable.Y + "\" width=\"" + styledTable.Width + "\" height=\"" + styledTable.Height + "\" borderColor=\"" + styledTable.BorderColor.Name + "\" drawEmptyRows=\"" + (styledTable.DrawEmptyRows == true?"true":"false") + "\" cellHeight=\"" + styledTable.CellHeight.ToString() + "\" dataSource=\"" + ReplaceForXML(styledTable.DataSource) + "\"  horAlignment=\"" + styledTable.HorizontalAlignment.ToString() + "\" verAlignment=\"" + styledTable.VerticalAlignment.ToString() + "\" Selectable=\"" + styledTable.Selectable.ToString() + "\" GroupByField=\"" + styledTable.GroupByField + "\">");

                        sw.WriteLine("<header headerColor=\"" + styledTable.HeaderBackgroundColor.Name + "\" headerFontColor=\"" + styledTable.HeaderFontColor.Name + "\">");

                        string style = "";
                        if (styledTable.HeaderFont.Bold && styledTable.HeaderFont.Italic)
                        {
                            style = " style=\"Bold Italic\"";
                        }
                        else if (styledTable.HeaderFont.Bold)
                        {
                            style = " style=\"Bold\"";
                        }
                        else if (styledTable.HeaderFont.Italic)
                        {
                            style = " style=\"Italic\"";
                        }

                        sw.WriteLine("<font family=\"" + styledTable.HeaderFont.Name + "\" size=\"" + styledTable.HeaderFont.Size.ToString("f00") + "\" " + style + "></font>");

                        sw.WriteLine("</header>");

                        sw.WriteLine("<dataRows dataFontColor=\"" + styledTable.DataFontColor.Name + "\">");

                        style = "";
                        if (styledTable.DataFont.Bold && styledTable.DataFont.Italic)
                        {
                            style = " style=\"Bold Italic\"";
                        }
                        else if (styledTable.DataFont.Bold)
                        {
                            style = " style=\"Bold\"";
                        }
                        else if (styledTable.DataFont.Italic)
                        {
                            style = " style=\"Italic\"";
                        }
                        sw.WriteLine("<font family=\"" + styledTable.DataFont.Name + "\" size=\"" + styledTable.DataFont.Size.ToString("f00") + "\" " + style + "></font>");

                        sw.WriteLine("</dataRows>");

                        int numOfColumns = styledTable.Columns.Length;

                        sw.WriteLine("<columns>");
                        for (int j = 0; j < numOfColumns; j++)
                        {
                            string textAlignment = "Left";
                            if (styledTable.Columns[j].Alignment == StyledTableColumn.AlignmentType.Center)
                            {
                                textAlignment = "Center";
                            }
                            else if (styledTable.Columns[j].Alignment == StyledTableColumn.AlignmentType.Right)
                            {
                                textAlignment = "Right";
                            }
                            else
                            {
                                textAlignment = "Left";
                            }

                            sw.WriteLine("<column name=\"" + ReplaceForXML(styledTable.Columns[j].Name) + "\"  label=\"" + ReplaceForXML(styledTable.Columns[j].Label) + "\" FormatMask=\"" + ReplaceForXML(styledTable.Columns[j].FormatMask) + "\" width=\"" + styledTable.Columns[j].Width + "\" align=\"" + textAlignment + "\" Visible=\"" + styledTable.Columns[j].Visible + "\"/>");
                        }
                        sw.WriteLine("</columns>");
                        sw.WriteLine("</table>");
                    }
                }
                sw.WriteLine("</dynamicContent>");
            }
            sw.WriteLine(" ");
            sw.WriteLine("</content>");
            sw.WriteLine("</daReport>");
            sw.Close();
        }
Esempio n. 11
0
        void PanelControlAdded(object sender, ControlEventArgs e)
        {
            ChartBox box = (ChartBox)panel.Controls[panel.Controls.Count - 1];

            box.MouseDown += new MouseEventHandler(this.ChartBoxMouseDown);
        }
Esempio n. 12
0
        public void SetData(ArrayList parameters, ICustomPaint[] staticElements, ICustomPaint[] dynamicElements)
        {
            InitNodes();
            for (int i = 0; i < parameters.Count; i++)
            {
                parametersNode.Nodes.Add(new TreeNode(parameters[i].ToString(), 2, 2));
            }
            parametersNode.Expand();

            for (int i = 0; i < staticElements.Length; i++)
            {
                if (staticElements[i] is TextField)
                {
                    TextField txtField = (TextField)staticElements[i];
                    string    theText  = txtField.Text.Length > 25 ? txtField.Text.Substring(0, 25) + "..." : txtField.Text;
                    string    name     = txtField.Name.ToString();
                    staticContentsNode.Nodes.Add(new TreeNode("Text field [" + name + "]", 0, 0));
                }
                else if (staticElements[i] is daReport.PictureBox)
                {
                    daReport.PictureBox picBox = (daReport.PictureBox)staticElements[i];
                    string theText             = picBox.ImageFile == null ? "none" : picBox.ImageFile;
                    staticContentsNode.Nodes.Add(new TreeNode("Picture [" + theText + "]", 1, 1));
                }
                else if (staticElements[i] is daReport.ChartBox)
                {
                    ChartBox chartBox = (ChartBox)staticElements[i];
                    staticContentsNode.Nodes.Add(new TreeNode("Chart [" + chartBox.Name + "]", 5, 5));
                }
                else if (staticElements[i] is daReport.StyledTable)
                {
                    StyledTable styledTable = (StyledTable)staticElements[i];

                    if (styledTable.DataSource != null)
                    {
                        staticContentsNode.Nodes.Add(new TreeNode("Styled table [" + styledTable.DataSource + "]", 3, 3));
                    }
                    else
                    {
                        staticContentsNode.Nodes.Add(new TreeNode("Styled table", 3, 3));
                    }
                }
            }
            staticContentsNode.Expand();

            for (int i = 0; i < dynamicElements.Length; i++)
            {
                if (dynamicElements[i] is TextField)
                {
                    TextField txtField = (TextField)dynamicElements[i];
                    string    theText  = txtField.Text.Length > 25 ? txtField.Text.Substring(0, 25) + "..." : txtField.Text;
                    dynamicContentsNode.Nodes.Add(new TreeNode("Text field [" + txtField.Name + "]", 0, 0));
                }
                else if (dynamicElements[i] is daReport.PictureBox)
                {
                    dynamicContentsNode.Nodes.Add(new TreeNode("Picture", 1, 1));
                }
                else if (dynamicElements[i] is daReport.StyledTable)
                {
                    StyledTable styledTable = (StyledTable)dynamicElements[i];

                    if (styledTable.DataSource != null)
                    {
                        dynamicContentsNode.Nodes.Add(new TreeNode("Styled table [" + styledTable.DataSource + "]", 3, 3));
                    }
                    else
                    {
                        dynamicContentsNode.Nodes.Add(new TreeNode("Styled table", 3, 3));
                    }
                }
            }
            dynamicContentsNode.Expand();
        }
        void ReleaseDesignerOutlets()
        {
            if (canvas != null)
            {
                canvas.Dispose();
                canvas = null;
            }

            if (ChartBox != null)
            {
                ChartBox.Dispose();
                ChartBox = null;
            }

            if (ChartBoxView != null)
            {
                ChartBoxView.Dispose();
                ChartBoxView = null;
            }

            if (CuspList != null)
            {
                CuspList.Dispose();
                CuspList = null;
            }

            if (DateSetterCombo != null)
            {
                DateSetterCombo.Dispose();
                DateSetterCombo = null;
            }

            if (DateSetterCurrentLat != null)
            {
                DateSetterCurrentLat.Dispose();
                DateSetterCurrentLat = null;
            }

            if (DateSetterCurrentLng != null)
            {
                DateSetterCurrentLng.Dispose();
                DateSetterCurrentLng = null;
            }

            if (DateSetterDatePicker != null)
            {
                DateSetterDatePicker.Dispose();
                DateSetterDatePicker = null;
            }

            if (DateSetterDay != null)
            {
                DateSetterDay.Dispose();
                DateSetterDay = null;
            }

            if (DateSetterHour != null)
            {
                DateSetterHour.Dispose();
                DateSetterHour = null;
            }

            if (DateSetterMinute != null)
            {
                DateSetterMinute.Dispose();
                DateSetterMinute = null;
            }

            if (DateSetterSecond != null)
            {
                DateSetterSecond.Dispose();
                DateSetterSecond = null;
            }

            if (Event1Date != null)
            {
                Event1Date.Dispose();
                Event1Date = null;
            }

            if (Event1Name != null)
            {
                Event1Name.Dispose();
                Event1Name = null;
            }

            if (Event2Date != null)
            {
                Event2Date.Dispose();
                Event2Date = null;
            }

            if (Event2Name != null)
            {
                Event2Name.Dispose();
                Event2Name = null;
            }

            if (horoscopeCanvas != null)
            {
                horoscopeCanvas.Dispose();
                horoscopeCanvas = null;
            }

            if (img != null)
            {
                img.Dispose();
                img = null;
            }

            if (testButton != null)
            {
                testButton.Dispose();
                testButton = null;
            }

            if (User1Date != null)
            {
                User1Date.Dispose();
                User1Date = null;
            }

            if (User1Name != null)
            {
                User1Name.Dispose();
                User1Name = null;
            }

            if (User2Date != null)
            {
                User2Date.Dispose();
                User2Date = null;
            }

            if (User2Name != null)
            {
                User2Name.Dispose();
                User2Name = null;
            }

            if (userDbDateColumn != null)
            {
                userDbDateColumn.Dispose();
                userDbDateColumn = null;
            }

            if (userDbNameColumn != null)
            {
                userDbNameColumn.Dispose();
                userDbNameColumn = null;
            }

            if (web != null)
            {
                web.Dispose();
                web = null;
            }

            if (settingMenu != null)
            {
                settingMenu.Dispose();
                settingMenu = null;
            }
        }