Inheritance: MonoBehaviour
示例#1
0
 public BarItemClickBinding(BarItem control, IUiCommand command)
 {
     _control = control;
     _command = command;
     _control.ItemClick += _control_ItemClick;
     Application.Idle += Application_Idle;
 }
示例#2
0
 bool IsChecked(BarItem item)
 {
     if(item is BarButtonItem)
         return ((BarButtonItem)item).Down;
     if (item is BarCheckItem)
         return ((BarCheckItem) item).Checked;
     return false;
 }
示例#3
0
	protected override void OnDieStarts ()
	{
		base.OnDieStarts ();
		if (hpBar != null)
		{
			BarItem.RecycleHPBar(hpBar);
			hpBar = null;
		}
	}
示例#4
0
        private void createChildItem(BarItem itemParent,string itemId)
        {
            BarSubItem parentBar = (BarSubItem)itemParent;
            if (ds.Tables[0].Select("Parents='" + itemId + "'").Length > 0)
            {
                BarSubItem subItem = new BarSubItem();
                subItem.Id = frmRibbonMain.IIII++;
                subItem.Caption = getName(itemId);
                subItem.RibbonStyle = RibbonItemStyles.Default;
                subItem.PaintStyle = BarItemPaintStyle.CaptionGlyph;
                //subItem.Glyph = ResourceMan.getImage16(getImageName(itemId));
                try
                {
                    Image image = this.getImage16(itemId);
                    subItem.Glyph = image;
                }
                catch { }
                subItem.ItemClick += new ItemClickEventHandler(itemClick);
                parentBar.ItemLinks.Add(subItem);
                {
                    CreateToolTip(subItem, getToolTip(itemId));
                }
                //parentBar.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(subItem) });
                foreach (DataRow dr in ds.Tables[0].Select("Parents='" + itemId + "'"))
                {
                    string childId = dr[0] as string;
                    createChildItem(subItem, childId);
                }
            }
            else
            {
                BarButtonItem buttonItem = new BarButtonItem();
                buttonItem.Id = frmRibbonMain.IIII++;
                buttonItem.Name = itemId;
                buttonItem.Caption = getName(itemId);
                buttonItem.RibbonStyle = RibbonItemStyles.Default;
                buttonItem.PaintStyle = BarItemPaintStyle.CaptionGlyph;
                try
                {
                    Image image = this.getImage16(itemId);
                    buttonItem.Glyph = image;
                    //buttonItem.Glyph = ResourceMan.getImage16(getImageName(itemId));
                }
                catch { }
                buttonItem.ItemClick+= new ItemClickEventHandler(itemClick);
                parentBar.ItemLinks.Add(buttonItem);
                if (getToolTip(itemId) != "")
                {
                    CreateToolTip(buttonItem, getToolTip(itemId));
                }
                //parentBar.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[]{new DevExpress.XtraBars.LinkPersistInfo(buttonItem)});

            }
        }
 void OnTriggerEnter2D(Collider2D collider2d)
 {
     switch (collider2d.tag)
     {
         case "Whiskey":
             otherPresent = collider2d.tag;
             otherCollider = collider2d;
             itemToMake = shotGlassFull;
             break;
     }
 }
示例#6
0
	public static void RecycleHPBar(BarItem bar)
	{
		if (bar != null)
		{
            PopupManager.Instance.RemoveItem(bar.gameObject);
		}
		else
		{
			BaseLogger.Log("Recyle a null HPBar!");
		}
	}
示例#7
0
        //Tao con cua item trong Page Group
        private void createChildItem(BarItem itemParent, string parentItemID)
        {
            BarSubItem subItemParent = (BarSubItem)itemParent;
            if (ds.Tables[0].Select("Parents='" + parentItemID + "'").Length > 0)
            {
                BarSubItem barSubItem = new BarSubItem();
                barSubItem.Caption = parentItemID;
                barSubItem.PaintStyle = BarItemPaintStyle.CaptionGlyph;
                barSubItem.RibbonStyle = RibbonItemStyles.Default;
                barSubItem.Enabled = getEnable(parentItemID);
                //subItemParent.ItemLinks.Add(barSubItem);
                subItemParent.ItemLinks.Add(barSubItem, getSep(parentItemID));
                try
                {
                    //Image image = ResourceMan.getImage16(getImageName(parentItemID));
                    Image image = this.getImage16(parentItemID);
                    barSubItem.Glyph = image;
                }
                catch { }
                if (getToolTip(parentItemID) != "")
                {
                    CreateToolTip(barSubItem, getToolTip(parentItemID));
                }
                foreach (DataRow dr in ds.Tables[0].Select("Parents='" + parentItemID + "'"))
                {
                    createChildItem(barSubItem, dr[0].ToString());
                }

            }
            else
            {
                BarButtonItem barButtonItem = new BarButtonItem();
                barButtonItem.Id = frmRibbonMain.IIII++;
                barButtonItem.Name = parentItemID;
                barButtonItem.Caption = getName(parentItemID);
                barButtonItem.PaintStyle = BarItemPaintStyle.CaptionGlyph;
                barButtonItem.RibbonStyle = RibbonItemStyles.Large;
                barButtonItem.Enabled = getEnable(parentItemID);
                //subItemParent.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(barButtonItem, true) });
                subItemParent.ItemLinks.Add(barButtonItem,getSep(parentItemID));
                if (getToolTip(parentItemID) != "")
                {
                    CreateToolTip(barButtonItem, getToolTip(parentItemID));
                }
                try
                {
                    Image image = this.getImage16(parentItemID);
                    //Image image = ResourceMan.getImage16(getImageName(parentItemID));
                    barButtonItem.Glyph = image;
                }
                catch { }
                barButtonItem.ItemClick += new ItemClickEventHandler(itemClick);
            }
        }
示例#8
0
 public ColorPopup(PopupControlContainer container, BarItem item, PLWord editor)
 {
     this.wordEditor = editor;
     this.container = container;
     itemFontColor = item;
     this.fResultColor = Color.Empty;
     this.tabControl = CreateTabControl();
     this.tabControl.TabStop = false;
     this.tabControl.TabPages.AddRange(new XtraTabPage[] { new XtraTabPage(), new XtraTabPage(), new XtraTabPage()});
     for(int i = 0; i < tabControl.TabPages.Count; i++) SetTabPageProperties(i);
     tabControl.Dock = DockStyle.Fill;
     this.container.Controls.AddRange(new System.Windows.Forms.Control[] {tabControl});
     this.container.Size = CalcFormSize();
 }
示例#9
0
        /// <summary>
        /// Adds all menu items.
        /// </summary>
        private void AddAllMenuItems()
        {
            bbiTabbed = AddBarItem("选项卡式窗口布局(&T)", null, null, utility.MdiChangeMode, false);
            bbiTabbed.ButtonStyle = BarButtonStyle.Check;

            bbiCascade = AddBarItem("层叠(&C)", Resource.windows, null, utility.MdiLayoutCascade, true);
            bbiHorizontal =  AddBarItem("水表排列(&H)", Resource.window_split_hor, null, utility.MdiLayoutTileHorizontal, false);
            bbiVertical = AddBarItem("垂直排列(&V)", Resource.window_split_ver, null, utility.MdiLayoutTileVertical, false);

            BarSubItem bsiWindows = new BarSubItem(Manager, "所有窗口(&W)");
            BarItemLink link = AddItem(bsiWindows);
            link.BeginGroup = true;
            bsiWindows.AddItem(new BarMdiChildrenListItem());
        }
示例#10
0
 public static void SetImageColor(BarItem item, Color clr)
 {
     int imIndex = item.ImageIndex;
     ImageCollection iml = item.Images as ImageCollection;
     Bitmap im = (Bitmap)iml.Images[imIndex];
     Graphics g = Graphics.FromImage(im);
     Rectangle r = new Rectangle(2, 12, 12, 3);
     g.FillRectangle(new SolidBrush(clr), r);
     if(imIndex == iml.Images.Count - 1) {
         iml.Images.RemoveAt(imIndex);
     }
     g.Dispose();
     iml.Images.Add(im);
     item.ImageIndex = iml.Images.Count - 1;
 }
        private void ValidateUiElement(BarItem uiElement)
        {
            // this will be called for the Ribbon Gallery - but we handle that separately.
            if (uiElement is RibbonGalleryBarItem)
                return;

            if (uiElement == null)
                throw new ArgumentException("uiElement.Tag cannot null. It must contain a DynamicCommandEventLink.");
            if (uiElement.Tag is DynamicCommandEventLink)
            {
                if (String.IsNullOrEmpty((uiElement.Tag as DynamicCommandEventLink).EventTopicName))
                    throw new ArgumentException("uiElement.Tag EventTopicName cannot be empty. It must contain the Event to be fired.");
            }
            else
                throw new ArgumentException("uiElement.Tag must be a DynamicCommandEventLink and must contain the Event to be fired.");
        }
示例#12
0
 void OnTriggerEnter2D(Collider2D collider2d)
 {
     switch (collider2d.tag)
     {
         case "FriesCooked":
             otherPresent = collider2d.tag;
             otherCollider = collider2d;
             itemToPlate = fries;
             break;
         case "ChickenWingsCooked":
             otherPresent = collider2d.tag;
             otherCollider = collider2d;
             itemToPlate = chicken;
             break;
     }
 }
示例#13
0
 public static void SetImageColor(BarItem item, Color clr)
 {
     int num = item.ImageIndex;
     ImageCollection images = item.Images as ImageCollection;
     Bitmap image = (Bitmap) images.Images[num];
     Graphics graphics = Graphics.FromImage(image);
     Rectangle rect = new Rectangle(2, 12, 12, 3);
     graphics.FillRectangle(new SolidBrush(clr), rect);
     if (num == (images.Images.Count))
     {
         images.Images.RemoveAt(num);
     }
     graphics.Dispose();
     images.Images.Add(image);
     item.ImageIndex = (images.Images.Count - 1);
 }
示例#14
0
 public ColorPopup(PopupControlContainer container, BarItem item, ProtocolVN.Framework.Win.Trial.PLWord editor)
 {
     this.wordEditor = editor;
     this.container = container;
     itemFontColor = item;
     this.fResultColor = Color.Empty;
     this.tabControl = this.CreateTabControl();
     this.tabControl.TabStop = false;
     this.tabControl.TabPages.AddRange(new XtraTabPage[] { new XtraTabPage(), new XtraTabPage(), new XtraTabPage() });
     for (int i = 0; i < this.tabControl.TabPages.Count; i++)
     {
         this.SetTabPageProperties(i);
     }
     this.tabControl.Dock = DockStyle.Fill;
     this.container.Controls.AddRange(new Control[] { this.tabControl });
     this.container.Size = this.CalcFormSize();
 }
示例#15
0
 void OnTriggerEnter2D(Collider2D collider2d)
 {
     switch (collider2d.tag)
     {
         case "FriesUncooked":
             otherPresent = collider2d.tag;
             otherCollider = collider2d;
             if (!busy)
                 itemToFry = fries;
             break;
         case "ChickenWingsUncooked":
             otherPresent = collider2d.tag;
             otherCollider = collider2d;
             if (!busy)
                 itemToFry = chicken;
             break;
     }
 }
 void BarItemSetup(IModelRibbonActionLink actionLink, BarItem barItem) {
     if (actionLink.RibbonStyle.HasValue)
         barItem.RibbonStyle = actionLink.RibbonStyle.Value;
     if (!string.IsNullOrEmpty(actionLink.ShortcutKeyDisplayString))
         barItem.ShortcutKeyDisplayString = actionLink.ShortcutKeyDisplayString;
     if (actionLink.ShowInCustomizationForm.HasValue)
         barItem.ShowInCustomizationForm = actionLink.ShowInCustomizationForm.Value;
     if (actionLink.SmallWithTextWidth.HasValue)
         barItem.SmallWithTextWidth = actionLink.SmallWithTextWidth.Value;
     if (actionLink.SmallWithoutTextWidth.HasValue)
         barItem.SmallWithoutTextWidth = actionLink.SmallWithoutTextWidth.Value;
     if (actionLink.Visibility.HasValue)
         barItem.Visibility = actionLink.Visibility.Value;
     if (actionLink.VisibleWhenVertical.HasValue)
         barItem.VisibleWhenVertical = actionLink.VisibleWhenVertical.Value;
     if (actionLink.Width.HasValue)
         barItem.Width = actionLink.Width.Value;
 }
示例#17
0
 private void SetVisible(BarItem item, bool isVisible)
 {
     item.Visibility = isVisible ? BarItemVisibility.Always : BarItemVisibility.Never;
 }
示例#18
0
 //bool IsChecked(object item)
 //{
 //    if(item is BarButtonItem)
 //        return item.Down;
 //}
 void SetEnable(BarItem item, bool isEnable)
 {
     item.Enabled = isEnable;
 }
示例#19
0
 private void EnableOrDisable(BarItem thisControl, bool Enable)
 {
     thisControl.Enabled = Enable;
 }
示例#20
0
 public BarButtonItemLink(BarItemLinkReadOnlyCollection ALinks, BarItem AItem, object ALinkedObject) : base(ALinks, AItem, ALinkedObject)
 {
 }
        private void CreateChart(ZedGraphControl zgc, GetBenefitReportsPara pagePara, List <DayBenefitReport> list)
        {
            GraphPane myPane = zgc.GraphPane;

            if (myPane == null)
            {
                return;
            }
            myPane?.CurveList?.Clear();
            myPane?.GraphItemList?.Clear();
            zgc.AxisChange();
            zgc.Refresh();


            //   zgc.AxisChange();

            // Set the titles and axis labels
            myPane.Title       = "营业报表";
            myPane.XAxis.Title = "时间";
            myPane.YAxis.Title = "销售额";

            // Make up some random data points
            //   string[] labels = { "Panther", "Lion", "Cheetah", "Cougar", "Tiger", "Leopard" };


            String[] labels = null;
            double[] points = null;
            if (pagePara.IsMonth)
            {
                labels = new string[12];
                points = new double[12];
                for (int i = 0; i <= 11; i++)
                {
                    labels[i] = (i + 1).ToString();
                    DayBenefitReport achievement = list.Find(t => Int32.Parse(t.ReportDate.ToString().Substring(4, 2)) == (i + 1));
                    if (achievement != null)
                    {
                        points[i] = decimal.ToDouble(achievement.SalesTotalMoney);
                    }
                }
            }
            else
            {
                //获取月份对应的数量
                if (list.Count > 0)
                {
                    DayBenefitReport achievement = list[0];
                    int days = TimeHelper.GetReportMonthMaxDay(achievement.ReportDate);
                    labels = new string[days];
                    points = new double[days];
                    for (int i = 0; i < days; i++)
                    {
                        labels[i]   = (i + 1).ToString();
                        achievement = list.Find(t => Int32.Parse(t.ReportDate.ToString().Substring(6, 2)) == (i + 1));
                        if (achievement != null)
                        {
                            points[i] = decimal.ToDouble(achievement.SalesTotalMoney);
                        }
                    }
                }
            }

            // Generate a red bar with "Curve 1" in the legend
            BarItem myBar = myPane.AddBar("销售总额", null, points, Color.Blue);

            myBar.Bar.Fill = new Fill(Color.Blue, Color.White, Color.Blue);
            myPane.XAxis.IsTicsBetweenLabels = true;

            // Set the XAxis labels
            myPane.XAxis.TextLabels = labels;

            // Set the XAxis to Text type
            myPane.XAxis.Type = AxisType.Text;

            // Fill the axis area with a gradient
            myPane.AxisFill = new Fill(Color.White,
                                       Color.FromArgb(255, 255, 166), 90F);
            // Fill the pane area with a solid color
            myPane.PaneFill = new Fill(Color.FromArgb(250, 250, 255));

            zgc.AxisChange();
            zgc.Invalidate();
            //   this.skinTabPage2.Invalidate();
            //  this.Invalidate();
        }
示例#22
0
        private void GraphSelectedDatasetDay(SQLiteConnection conn, string sqlString, string whereUrlEq = "")
        {
            TxtDBOutput.Clear();
            SQLiteCommand    cmd    = new SQLiteCommand(String.Format(sqlString, whereUrlEq), conn);
            SQLiteDataReader reader = cmd.ExecuteReader();

            double min = 1;
            double max = 1;

            List <string> xLabels = new List <string>();
            List <string> xVals   = new List <string>();
            List <string> yVals   = new List <string>();

            Dictionary <int, string> labels = new Dictionary <int, string>();

            labels.Add(0, "Min Deceptive (CB/Satire/Fals.)");
            labels.Add(1, "Min Not Deceptive (Not CB/Not Satire/Legit)");
            labels.Add(2, "Avg Deceptive (CB/Satire/Fals.)");
            labels.Add(3, "Avg Not Deceptive (Not CB/Not Satire/Legit)");
            labels.Add(4, "Max Deceptive (CB/Satire/Fals.)");
            labels.Add(5, "Max Not Deceptive (Not CB/Not Satire/Legit)");

            Dictionary <string, Color> barColors = new Dictionary <string, Color>();

            barColors.Add("Min Deceptive (CB/Satire/Fals.)", Color.Green);
            barColors.Add("Min Not Deceptive (Not CB/Not Satire/Legit)", Color.LightGreen);
            barColors.Add("Avg Deceptive (CB/Satire/Fals.)", Color.Blue);
            barColors.Add("Avg Not Deceptive (Not CB/Not Satire/Legit)", Color.LightBlue);
            barColors.Add("Max Deceptive (CB/Satire/Fals.)", Color.DarkMagenta);
            barColors.Add("Max Not Deceptive (Not CB/Not Satire/Legit)", Color.Magenta);

            while (reader.Read())
            {
                string   avgFirst        = reader.GetDouble(0).ToString();
                string   minFirst        = reader.GetDouble(1).ToString();
                string   maxFirst        = reader.GetDouble(2).ToString();
                string   avgSecond       = reader.GetDouble(3).ToString();
                string   minSecond       = reader.GetDouble(4).ToString();
                string   maxSecond       = reader.GetDouble(5).ToString();
                string   timestamp       = reader.GetString(6);
                DateTime datestampParsed = DateTime.Parse(timestamp, provider);

                int keyFromTimestamp = -1;
                if (RadDay.Checked == true)
                {
                    keyFromTimestamp = datestampParsed.DayOfYear;
                    xLabels.Add(datestampParsed.ToShortDateString());
                }
                else if (RadMonth.Checked == true)
                {
                    keyFromTimestamp = datestampParsed.Month;
                    //todo: add format for month here
                }

                #region "Bad code that makes the timeline work for now"

                //NOTE: I am really not happy with the following messy copy+paste fix to get the graph working - it needs cleaned up - but it works

                if (ChkMinimum.Checked == true)
                {
                    if (ActiveGroupShowGoodValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(minFirst);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                    if (ActiveGroupShowBadValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(minSecond);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                }
                else
                {
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                }

                if (ChkMean.Checked == true)
                {
                    if (ActiveGroupShowGoodValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(avgFirst);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                    if (ActiveGroupShowBadValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(avgSecond);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                }
                else
                {
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                }

                if (ChkMaximum.Checked == true)
                {
                    if (ActiveGroupShowGoodValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(maxFirst);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                    if (ActiveGroupShowBadValue())
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add(maxSecond);
                    }
                    else
                    {
                        xVals.Add(keyFromTimestamp.ToString());
                        yVals.Add("0");
                    }
                }
                else
                {
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                    xVals.Add(keyFromTimestamp.ToString());
                    yVals.Add("0");
                }

                #endregion
            }

            max = xVals.Count;

            Dictionary <string, PointPairList> allVals = new Dictionary <string, PointPairList>();

            for (int i = 0; i < xVals.Count; ++i)
            {
                if (allVals.ContainsKey(labels[i % labels.Count]) == false)
                {
                    allVals[labels[i % labels.Count]] = new PointPairList();
                }

                allVals[labels[i % labels.Count]].Add(new PointPair(Convert.ToDouble(xVals[i]), Convert.ToDouble(yVals[i])));
            }

            foreach (KeyValuePair <string, PointPairList> kv in allVals)
            {
                BarItem scatterPlot = zedGraphStats.GraphPane.AddBar(kv.Key, kv.Value, barColors[kv.Key]);
                scatterPlot.Bar.Fill.RangeMin = min;
                scatterPlot.Bar.Fill.RangeMax = max;
            }

            string[] dateLabels = xLabels.Distinct().ToArray();
            zedGraphStats.GraphPane.XAxis.Title            = new AxisLabel("Timestamp", "Consolas", 12, Color.Black, true, false, false);
            zedGraphStats.GraphPane.XAxis.Type             = AxisType.Text;
            zedGraphStats.GraphPane.XAxis.Scale.TextLabels = dateLabels;

            //write sql output
            for (int i = 0; i < dateLabels.Length; ++i)
            {
                TxtDBOutput.Text += dateLabels[i] + Environment.NewLine;
                foreach (KeyValuePair <string, PointPairList> kv in allVals)
                {
                    TxtDBOutput.Text += kv.Key + ": " + kv.Value[i] + Environment.NewLine;
                }
            }
        }
示例#23
0
        private void Draw_Load()
        {
            zedGraphControl1.GraphPane.CurveList.Clear();
            zedGraphControl1.GraphPane.GraphObjList.Clear();
            GraphPane myPane = zedGraphControl1.GraphPane;

            // 画图面版X标题
            myPane.XAxis.Title.Text = "区域";
            // myPane.XAxis.Type = AxisType.Text;
            myPane.XAxis.Scale.Min = 0;
            myPane.XAxis.Scale.Max = 20;
            //myPane.YAxis.Scale.MinorStep = 10;
            //myPane.YAxis.Scale.MajorStep = 10;
            myPane.Chart.Border.IsVisible    = false;
            myPane.YAxis.MajorTic.IsOpposite = false;
            //初始化数据
            PointPairList list  = new PointPairList();
            PointPairList list2 = new PointPairList();
            PointPairList list3 = new PointPairList();

            for (int i = 0; i < 100; i++)////这里的数量要和lable的一致,比如横坐标显示了5个lable,这里就要给5个
            {
                list.Add(i, i + 10);
                list2.Add(i, i + 20);
            }
            // 画图面版Y标题
            myPane.YAxis.Title.Text = "销售情况";
            //柱的画笔
            BarItem myCurve = myPane.AddBar("收入1", list, Color.Blue);
            BarItem barItem = myPane.AddBar("收入2", list2, Color.Red);

            // BarItem myCurve = myPane.AddBar("收入1", null, Color.Blue);
            //BarItem myCurve1 = myPane.AddBar("收入2", list2, Color.Green);
            for (int i = 0; i < myCurve.Points.Count; i++)
            {
                //PointPair pt = myCurve.Points[i];
                //TextObj text = new TextObj(pt.Y.ToString("f2"), float.Parse(pt.X + ""), float.Parse(pt.Y + offset + ""), CoordType.AxisXYScale, AlignH.Right, AlignV.Center);
                //text.ZOrder = ZOrder.A_InFront;

                //// 隐藏标注的边框和填充
                //text.FontSpec.Border.IsVisible = false;
                //text.FontSpec.Fill.IsVisible = false;
                //// 选择标注字体90°
                ////text.FontSpec.Angle = 90;

                //myPane.GraphObjList.Add(text);

                //pt = myCurve1.Points[i];
                //text = new TextObj(pt.Y.ToString("f2"), float.Parse(pt.X + ""), float.Parse(pt.Y + offset + ""), CoordType.AxisXYScale, AlignH.Left, AlignV.Center);
                //text.FontSpec.Border.IsVisible = false;
                //text.FontSpec.Fill.IsVisible = false;
                //myPane.GraphObjList.Add(text);
            }

            //myPane.XAxis.MajorTic.IsBetweenLabels = true;
            //XAxis标注
            // string[] labels = { "产品1", "产品2", "产品3", "产品4", "产品5", "产品5", "产品5", "产品1", "产品2", "产品3", "产品4", "产品5", "产品5", "产品5" };
            //  string[] labels = { "产品1" };
            //  myPane.XAxis.Scale.TextLabels = labels;
            //  //myPane.XAxis.Scale.Min = 0;
            //  myPane.XAxis.Scale.Max = 10;
            ////  myPane.XAxis.Scale.MajorStep = 50;
            // /// myPane.XAxis.Scale.MaxAuto = true;
            //  myPane.XAxis.Type = AxisType.Text;
            //图区以外的颜色  fo
            // myPane.Fill = new Fill(Color.White, Color.FromArgb(200, 200, 255), 45.0f);
            //背景颜色
            //myPane.Chart.Fill = new Fill(Color.Red, Color.LightGoldenrodYellow, 45.0f);
            //myPane.Fill = new Fill(Color.White, Color.FromArgb(200, 200, 255), 45.0f);
            zedGraphControl1.AxisChange();
            zedGraphControl1.Refresh();


            //DataTable dt = new DataTable("cart");
            //DataColumn dc1 = new DataColumn("areaid", Type.GetType("System.String"));
            //DataColumn dc2 = new DataColumn("house", Type.GetType("System.String"));
            //DataColumn dc3 = new DataColumn("seq", Type.GetType("System.String"));
            //DataColumn dc4 = new DataColumn("remark", Type.GetType("System.String"));

            //dt.Columns.Add(dc1);
            //dt.Columns.Add(dc2);
            //dt.Columns.Add(dc3);
            //dt.Columns.Add(dc4);


            //DataRow dr = dt.NewRow();
            //dr["areaid"] = "北京";
            //dr["house"] = "北京仓库";
            //dr["seq"] = "2";
            //dr["remark"] = "货到付款";
            //dt.Rows.Add(dr);


            //DataRow dr1 = dt.NewRow();
            //dr1["areaid"] = "北京";
            //dr1["house"] = "上海仓库";
            //dr1["seq"] = "1";
            //dr1["remark"] = "货到付款";
            //dt.Rows.Add(dr1);

            //DataRow dr2 = dt.NewRow();
            //dr2["areaid"] = "上海";
            //dr2["house"] = "上海仓库";
            //dr2["seq"] = "1";
            //dr2["remark"] = "货到付款";
            //dt.Rows.Add(dr2);

            //DataRow dr3 = dt.NewRow();
            //dr3["areaid"] = "上海";
            //dr3["house"] = "北京仓库";
            //dr3["seq"] = "1";
            //dr3["remark"] = "货到付款";
            //dt.Rows.Add(dr3);


            //var query = from cus in dt.AsEnumerable()
            //            group cus by new { t1 = cus.Field<string>("areaid"), t2 = cus.Field<string>("seq") } into m
            //            select new
            //            {
            //                areaid = m.Key.t1,
            //                seq = m.Key.t2,
            //                house = m.First().Field<string>("house"),
            //                rowcount = m.Count()
            //            };


            //Console.WriteLine("区域 " + "  库房" + "   数量");
            //foreach (var item in query.ToList())
            //{
            //    if (item.rowcount > 1)
            //    {
            //        MessageBox.Show(item.areaid + "---" + item.house);
            //    }
            //    Console.WriteLine(item.areaid + "---" + item.house + "---" + item.rowcount);
            //    Console.WriteLine("\r\n");
            //}
        }
示例#24
0
 ///<summary>
 /// constructor
 ///</summary>
 public BarItemWrapper(BarItemLinkCollection itemLinkCollection, BarItem barItem)
 {
     this.barItem = barItem;
     barItemLinks = itemLinkCollection;
 }
        /// <summary>
        ///
        /// </summary>
        public void UpdatePane()
        {
            // Make up some random data points
            string[] labels = { "1", "2", "3", "4", "5", "6", "7" };
            double[] y      = { loop1, loop2, loop3, loop4, loop5, loop6, loop7 };
            double[] z      = { loopwdead1, loopwdead2, loopwdead3, loopwdead4, loopwdead5, loopwdead6, loopwdead7 };
            double[] avgy   = { avgloop1, avgloop2, avgloop3, avgloop4, avgloop5, avgloop6, avgloop7 };
            double[] avgz   = { avgloopwdead1, avgloopwdead2, avgloopwdead3, avgloopwdead4, avgloopwdead5, avgloopwdead6, avgloopwdead7 };
            try
            {
                // Generate a red bar with "Curve 1" in the legend
                if (myBar1 == null)
                {
                    /// Generate a black line with "Curve 4" in the legend
                    average7curve = graphpane.AddCurve("Avg Hands()", null, avgy, Color.BurlyWood, SymbolType.Circle);
                    //average7curve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F);
                    //// Fix up the curve attributes a little
                    average7curve.Symbol.Size = 8.0F;
                    average7curve.Symbol.Fill = new Fill(Color.White);
                    average7curve.Line.Width  = 2.0F;

                    /// Generate a black line with "Curve 4" in the legend
                    average5curve = graphpane.AddCurve("Avg Hands() w/dead", null, avgz, Color.OliveDrab, SymbolType.TriangleDown);
                    //average7curve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F);
                    //// Fix up the curve attributes a little
                    average5curve.Symbol.Size = 8.0F;
                    average5curve.Symbol.Fill = new Fill(Color.White);
                    average5curve.Line.Width  = 2.0F;


                    myBar1 = graphpane.AddBar("Hands()", null, y, Color.Violet);
                    myBar2 = graphpane.AddBar("Hands() W/Dead", null, z, Color.Blue);


                    myBar1.Bar.Fill = new Fill(Color.Chocolate, Color.White, Color.Chocolate);
                    myBar2.Bar.Fill = new Fill(Color.Green, Color.White, Color.Green);
                }
                else
                {
                    int size = myBar1.NPts;
                    for (int i = 0; i < size; i++)
                    {
                        myBar1.RemovePoint(0);
                    }

                    foreach (double v in y)
                    {
                        myBar1.AddPoint(v, v);
                    }

                    size = myBar2.NPts;
                    for (int i = 0; i < size; i++)
                    {
                        myBar2.RemovePoint(0);
                    }

                    foreach (double v in z)
                    {
                        myBar2.AddPoint(v, v);
                    }

                    size = average7curve.NPts;
                    for (int i = 0; i < size; i++)
                    {
                        average7curve.RemovePoint(0);
                    }

                    foreach (double v in avgy)
                    {
                        average7curve.AddPoint(v, v);
                    }

                    size = average5curve.NPts;
                    for (int i = 0; i < size; i++)
                    {
                        average5curve.RemovePoint(0);
                    }

                    foreach (double v in avgz)
                    {
                        average5curve.AddPoint(v, v);
                    }
                }

                // Draw the X tics between the labels instead of
                // at the labels
                //graph.GraphPane.XAxis.M.IsBetweenLabels = true;

                // Set the XAxis labels
                graphpane.XAxis.Scale.TextLabels = labels;
                // Set the XAxis to Text type
                graphpane.XAxis.Type = AxisType.Text;
            }
            catch
            {
            }
        }
示例#26
0
    //void CreateTableHead()
    //{
    //    if(TextBoxRoleName.Text!=null&&TextBoxRoleName.Text.Trim().Length!=0)
    //    {
    //        TableRow rowHead = new TableRow();

    //        TableHeaderCell cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.RoleName;
    //        rowHead.Cells.Add(cellHead);

    //        cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Date;
    //        rowHead.Cells.Add(cellHead);

    //        cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Count;
    //        rowHead.Cells.Add(cellHead);

    //        cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Percentage;
    //        rowHead.Cells.Add(cellHead);

    //        TableSearchTaiSuiList.Rows.Add(rowHead);
    //    }
    //    else
    //    {
    //        TableRow rowHead = new TableRow();

    //        TableHeaderCell cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Date;
    //        rowHead.Cells.Add(cellHead);

    //        cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Count;
    //        rowHead.Cells.Add(cellHead);

    //        cellHead = new TableHeaderCell();
    //        cellHead.Text = StringDef.Percentage;
    //        rowHead.Cells.Add(cellHead);

    //        TableSearchTaiSuiList.Rows.Add(rowHead);
    //    }
    //}

    //void CreateSearchResultList(TaiSuiUseInfo[] infos, int total)
    //{
    //    if (infos != null)
    //    {
    //        if (TextBoxRoleName.Text != null && TextBoxRoleName.Text.Trim().Length != 0)
    //        {
    //            foreach (TaiSuiUseInfo info in infos)
    //            {
    //                TableRow row = new TableRow();
    //                TableCell cell = new TableCell();
    //                cell.Text = TextBoxRoleName.Text.Trim();
    //                row.Cells.Add(cell);
    //                cell = new TableCell();
    //                cell.Text = info.date.ToShortDateString();
    //                row.Cells.Add(cell);
    //                cell = new TableCell();
    //                cell.Text = info.num.ToString();
    //                row.Cells.Add(cell);
    //                cell = new TableCell();
    //                cell.Text = total == 0 ? "0" : Decimal.Round((decimal)info.num / total, 2) * 100 + "%";
    //                row.Cells.Add(cell);
    //                TableSearchTaiSuiList.Rows.Add(row);
    //            }
    //        }
    //        else
    //        {
    //            foreach (TaiSuiUseInfo info in infos)
    //            {
    //                TableRow row = new TableRow();
    //                TableCell cell = new TableCell();
    //                cell.Text = info.date.ToShortDateString();
    //                row.Cells.Add(cell);
    //                cell = new TableCell();
    //                cell.Text = info.num.ToString();
    //                row.Cells.Add(cell);
    //                cell = new TableCell();
    //                cell.Text = total == 0 ? "0" : Decimal.Round((decimal)info.num / total, 2) * 100 + "%";
    //                row.Cells.Add(cell);
    //                TableSearchTaiSuiList.Rows.Add(row);
    //            }
    //        }
    //        TableRow rowTail = new TableRow();
    //        TableCell cellTail = new TableCell();
    //        cellTail.ColumnSpan = TextBoxRoleName.Text != null && TextBoxRoleName.Text.Trim().Length != 0 ? 4 : 3;
    //        cellTail.Font.Bold = true;
    //        cellTail.Text = StringDef.Total + StringDef.Colon + total;
    //        rowTail.Cells.Add(cellTail);

    //        TableSearchTaiSuiList.Rows.Add(rowTail);
    //    }
    //}

    protected void ZedGraphWebTaiSuiStatistic_RenderGraph(ZedGraph.Web.ZedGraphWeb webObject, Graphics g, MasterPane masterPane)
    {
        if (_statInfo != null)
        {
            //整理数据
            double[] timeArray = null;
            double[] counts    = null;

            if (RadioButtonListType.SelectedValue.Equals("Day"))
            {
                //按天
                TimeSpan span = _end.Subtract(_start);
                timeArray = new double[span.Days + 1];
                counts    = new double[span.Days + 1];

                for (int index = 0; index != span.Days + 1; ++index)
                {
                    DateTime tempDate = _start.Date.AddDays(index);
                    timeArray[index] = new XDate(tempDate);
                    foreach (TaiSuiUseInfo info in _statInfo)
                    {
                        //如果相等赋num,如果比date的日期小则结束
                        if (tempDate.Date.Equals(info.date))
                        {
                            counts[index] = info.num;
                            break;
                        }
                        else if (tempDate.Date < info.date)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                //按月
                int monthLength = (_end.Year - _start.Year) * 12 + (_end.Month - _start.Month);
                timeArray = new double[monthLength + 1];
                counts    = new double[monthLength + 1];

                for (int index = 0; index != monthLength + 1; ++index)
                {
                    DateTime tempDate = _start.Date.AddMonths(index);
                    timeArray[index] = new XDate(tempDate);
                    foreach (TaiSuiUseInfo info in _statInfo)
                    {
                        //如果相等赋num,如果比date的日期小则结束
                        if (tempDate.ToString("yyyyMM").Equals(info.date.ToString("yyyyMM")))
                        {
                            counts[index] = info.num;
                            break;
                        }
                        else if (tempDate.Date < info.date)
                        {
                            break;
                        }
                    }
                }
            }

            GraphPane graphPane = masterPane[0];

            //绘制图表
            graphPane.Title.Text = string.Format("{0} {1} {2} {3}", _start.ToShortDateString(), StringDef.To, _end.ToShortDateString(),
                                                 StringDef.TaiSui + StringDef.Total + StringDef.Colon + _totalCount.ToString());
            graphPane.Title.IsVisible     = true;
            graphPane.Title.FontSpec.Size = 14;

            graphPane.Fill = new Fill(WebConfig.GraphPaneBgColor);
            graphPane.Legend.FontSpec.Fill.IsVisible = false;
            graphPane.Legend.FontSpec.Size           = 10.5f;
            graphPane.Legend.Fill.IsVisible          = false;
            graphPane.Legend.Border.IsVisible        = false;

            graphPane.YAxis.Title.Text            = StringDef.UseCount;
            graphPane.YAxis.Title.FontSpec.IsBold = false;
            graphPane.YAxis.Title.FontSpec.Size   = 10.5f;
            graphPane.YAxis.Scale.FontSpec.Size   = 10.5f;
            graphPane.YAxis.MajorGrid.IsVisible   = true;
            graphPane.YAxis.MajorGrid.DashOff     = 0;
            graphPane.YAxis.MajorGrid.Color       = Color.Gray;
            graphPane.YAxis.MinorGrid.IsVisible   = true;
            graphPane.YAxis.MinorGrid.Color       = Color.LightGray;
            graphPane.YAxis.MinorGrid.DashOff     = 0;

            graphPane.XAxis.Title.Text            = StringDef.Date;
            graphPane.XAxis.Title.FontSpec.IsBold = false;
            graphPane.XAxis.Title.FontSpec.Size   = 10.5f;
            graphPane.XAxis.Scale.MajorUnit       = DateUnit.Day;
            graphPane.XAxis.MinorGrid.IsVisible   = false;
            graphPane.XAxis.Type = AxisType.DateAsOrdinal;
            if (RadioButtonListType.SelectedValue.Equals("Day"))
            {
                graphPane.XAxis.Scale.Format = "MM-dd";
            }
            else
            {
                graphPane.XAxis.Scale.Format = "yyyy-MM";
            }
            graphPane.XAxis.Scale.FontSpec.Size = 10.5f;
            //graphPane.XAxis.Scale.FontSpec.Angle = 45;

            graphPane.BarSettings.Type = BarType.Cluster;

            BarItem barItem = graphPane.AddBar(StringDef.UseCount, timeArray, counts, Color.Blue);
            masterPane.AxisChange(g);
            BarItem.CreateBarLabels(graphPane, false, string.Empty, TextObj.Default.FontFamily, 10.5f,
                                    TextObj.Default.FontColor, false, false, false);
        }
    }
示例#27
0
 /// <summary>
 ///  用户点击不同主菜单项,动态生成不同的其在菜单项目 比如点击停车场,将生成停车场下面所有的菜单项目
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="id"></param>
 /// <param name="Name"></param>
 private void BarMenuClick(BarItem item)
 {
     if (null == item) return;
     string tag = Convert.ToString(item.Tag);
     string id = basefun.valtag(tag, "id");
     if (string.IsNullOrEmpty(id))
         return;
     foreach (Form fr in this.MdiChildren)
         fr.Close();
     this.navSystemFun.Groups.Clear();
     DataRow[] drs = user.DsDeptRight.Tables[0].Select(string.Format("PID='{0}' and hide='false'", id));
     if (null == drs || drs.Length < 1)
         return;
     int picgrp = -1;
     int picitem = -1;
     foreach (DataRow dr in drs)
     {
         picgrp++;
         string grpname = basefun.valtag(Convert.ToString(dr["ntag"]), "name");
         DevExpress.XtraNavBar.NavBarGroup group = new NavBarGroup();
         group.Appearance.Options.UseTextOptions = true;
         group.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
         group.AppearanceBackground.Options.UseTextOptions = true;
         group.AppearanceBackground.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
         group.GroupStyle = DevExpress.XtraNavBar.NavBarGroupStyle.LargeIconsList;
         group.Caption = grpname;
         group.Tag = Convert.ToString(dr["id"]);
         group.LargeImage = this.imageGroup.Images[picgrp];
         DataRow[] drSunnode = user.DsDeptRight.Tables[0].Select(string.Format("PID='{0}' and hide='false'", group.Tag));
         foreach (DataRow drv in drSunnode)
         {
             picitem++;
             NavBarItem navitem = this.navSystemFun.Items.Add();
             navitem.Caption = Convert.ToString(drv["text"]);
             navitem.Tag = Convert.ToString(drv["ntag"]);
             navitem.LargeImage = this.imageItem.Images[picitem];
             navitem.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(navBarItemLinkCliced);
             group.ItemLinks.Add(navitem);
         }
         this.navSystemFun.Groups.Add(group);
     }
 }
示例#28
0
    protected void ZedGraphWebLevelSuiStatistic_RenderGraph(ZedGraph.Web.ZedGraphWeb webObject, Graphics g, MasterPane masterPane)
    {
        if (_infoHashtable != null)
        {
            //整理数据
            int      startLevel = int.Parse(TextBoxStartLevel.Text.Trim());
            int      endLevel   = int.Parse(TextBoxEndLevel.Text.Trim());
            int      groupCount = int.Parse(TextBoxGroup.Text.Trim());
            string[] levels     = new string[(endLevel - startLevel) / groupCount + 1];
            double[] counts;
            Color[]  roleTypeColor = new Color[] {
                Color.Blue,
                Color.Brown,
                Color.DarkGoldenrod,
                Color.Beige,
                Color.Yellow,
                Color.Coral,
                Color.Pink,
                Color.Green,
                Color.Gray
            };

            for (int index = 0; index != levels.Length; ++index)
            {
                levels[index] = string.Concat(startLevel + index * groupCount, '-', startLevel + (index + 1) * groupCount - 1);
            }

            GraphPane graphPane = masterPane[0];

            //绘制图表
            graphPane.Title.Text = string.Format("{0}-{1} {2} {3}", startLevel, endLevel,
                                                 StringDef.Role + StringDef.Total + StringDef.Colon, _total.ToString());
            graphPane.Title.IsVisible     = true;
            graphPane.Title.FontSpec.Size = 14;

            graphPane.Fill = new Fill(WebConfig.GraphPaneBgColor);
            graphPane.Legend.FontSpec.Fill.IsVisible = false;
            graphPane.Legend.FontSpec.Size           = 10.5f;
            graphPane.Legend.Fill.IsVisible          = false;
            graphPane.Legend.Border.IsVisible        = false;

            graphPane.YAxis.Title.Text            = StringDef.Count;
            graphPane.YAxis.Title.FontSpec.IsBold = false;
            graphPane.YAxis.Title.FontSpec.Size   = 10.5f;
            graphPane.YAxis.Scale.FontSpec.Size   = 10.5f;
            graphPane.YAxis.MajorGrid.IsVisible   = true;
            graphPane.YAxis.MajorGrid.DashOff     = 0;
            graphPane.YAxis.MajorGrid.Color       = Color.Gray;
            graphPane.YAxis.MinorGrid.IsVisible   = true;
            graphPane.YAxis.MinorGrid.Color       = Color.LightGray;
            graphPane.YAxis.MinorGrid.DashOff     = 0;

            graphPane.XAxis.Title.Text            = StringDef.Level;
            graphPane.XAxis.Title.FontSpec.IsBold = false;
            graphPane.XAxis.Title.FontSpec.Size   = 10.5f;
            graphPane.XAxis.Scale.IsVisible       = true;
            graphPane.XAxis.Type                = AxisType.Text;
            graphPane.XAxis.Scale.TextLabels    = levels;
            graphPane.XAxis.Scale.FontSpec.Size = 10.5f;

            switch (DropDownListBarType.SelectedItem.Text)
            {
            case "Stack":
                graphPane.BarSettings.Type = BarType.Stack;
                break;

            case "PercentStack":
                graphPane.BarSettings.Type = BarType.PercentStack;
                break;

            case "Cluster":
                graphPane.BarSettings.Type = BarType.Cluster;
                break;

            case "ClusterHiLow":
                graphPane.BarSettings.Type = BarType.ClusterHiLow;
                break;

            case "Overlay":
                graphPane.BarSettings.Type = BarType.Overlay;
                break;

            case "SortedOverlay":
                graphPane.BarSettings.Type = BarType.SortedOverlay;
                break;
            }

            for (int roleType = 0; roleType != 10; ++roleType)
            {
                ArrayList infoList = _infoHashtable[(FS2RoleType)roleType] as ArrayList;
                if (infoList != null)
                {
                    counts = new double[(endLevel - startLevel) / groupCount + 1];
                    for (int index = 0; index != levels.Length; ++index)
                    {
                        foreach (LevelInfo info in (LevelInfo[])infoList.ToArray(typeof(LevelInfo)))
                        {
                            if (info.Level >= startLevel + index * groupCount && info.Level < startLevel + (index + 1) * groupCount)
                            {
                                counts[index] += info.Num;
                            }
                            else if (info.Level >= startLevel + (index + 1) * groupCount)
                            {
                                break;
                            }
                        }
                    }
                    string classDescription = string.Empty;
                    switch ((FS2RoleType)roleType)
                    {
                    case FS2RoleType.Jiashi:
                        classDescription = StringDef.Jiashi;
                        break;

                    case FS2RoleType.Xuanfeng:
                        classDescription = StringDef.XuanFeng;
                        break;

                    case FS2RoleType.Xingtian:
                        classDescription = StringDef.XingTian;
                        break;

                    case FS2RoleType.Daoshi:
                        classDescription = StringDef.Daoshi;
                        break;

                    case FS2RoleType.Zhenren:
                        classDescription = StringDef.ZhenRen;
                        break;

                    case FS2RoleType.Tianshi:
                        classDescription = StringDef.TianShi;
                        break;

                    case FS2RoleType.Yiren:
                        classDescription = StringDef.Yiren;
                        break;

                    case FS2RoleType.Shoushi:
                        classDescription = StringDef.ShouShi;
                        break;

                    case FS2RoleType.Yishi:
                        classDescription = StringDef.YiShi;
                        break;
                    }
                    BarItem bar = graphPane.AddBar(classDescription, null, counts, roleTypeColor[(int)roleType]);
                    bar.Bar.Fill = new Fill(roleTypeColor[(int)roleType]);
                }
            }

            masterPane.AxisChange(g);
            BarItem.CreateBarLabels(graphPane, true, string.Empty, TextObj.Default.FontFamily, 10.5f,
                                    TextObj.Default.FontColor, false, false, false);
        }
    }
示例#29
0
        public void SetContextMenu(Control mapControl)
        {
            if (string.IsNullOrEmpty(_oldToolName))
            {
                _ribbonManager.SetPopupContextMenu(mapControl, null);
                return;
            }
            BarItem item = _ribbonManager.Items[_oldToolName];

            if (item == null)
            {
                _ribbonManager.SetPopupContextMenu(mapControl, null);
                return;
            }
            YutaiTool tool = item.Tag as YutaiTool;

            if (!(tool is IToolContextMenu))
            {
                _ribbonManager.SetPopupContextMenu(mapControl, null);
                return;
            }

            PopupMenu mPCurrentPopupMenu = this.m_pCurrentPopupMenu;

            mPCurrentPopupMenu.ClearLinks();
            string[] keys = ((IToolContextMenu)tool).ContextMenuKeys;
            if (keys == null)
            {
                return;
            }
            item = null;
            bool nextGroup = false;

            for (int i = 0; i < keys.Length; i++)
            {
                if (keys[i].Equals('-'))
                {
                    nextGroup = true;
                    continue;
                }
                item = _ribbonManager.Items[keys[i]];

                if (item == null)
                {
                    continue;
                }
                BarItemLink link = mPCurrentPopupMenu.AddItem(item);
                if (nextGroup)
                {
                    link.BeginGroup = true;
                    nextGroup       = false;
                }
            }
            if (mPCurrentPopupMenu.ItemLinks.Count <= 0)
            {
                _ribbonManager.SetPopupContextMenu(mapControl, this.m_pSystemPopupMenu);
            }
            else
            {
                _ribbonManager.SetPopupContextMenu(mapControl, mPCurrentPopupMenu);
            }
        }
示例#30
0
 /// <summary>
 /// Copy the properties of this <see cref="ZedGraphWebBarItem"/> to the specified
 /// <see cref="ZedGraph.BarItem"/> object.
 /// </summary>
 /// <param name="item">The destination <see cref="ZedGraph.BarItem"/> object</param>
 internal void CopyTo( BarItem item )
 {
     base.CopyTo( item );
     this.Border.CopyTo( item.Bar.Border );
     this.Fill.CopyTo( item.Bar.Fill );
 }
示例#31
0
 public void CreateToolTip(BarItem item, string itemName)
 {
     DevExpress.Utils.SuperToolTip superToolTip = new DevExpress.Utils.SuperToolTip();
     DevExpress.Utils.ToolTipItem tooltipItem = new DevExpress.Utils.ToolTipItem();
     tooltipItem.Text = itemName;
     superToolTip.Items.Add(itemName);
     item.SuperTip = superToolTip;
 }
示例#32
0
        private void test_Load(object sender, EventArgs e)
        {
            checkBox2.Text = "Kütüphanedeki Toplam Kitap Sayısı" + Environment.NewLine + "Grafiğini Göster/Gizle";
            checkBox3.Text = "Kütüphanede Verilmeye Hazır Kitap Sayısı" + Environment.NewLine + "Grafiğini Göster/Gizle";
            //ms access bağlantısı
            OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\kutuphane.accdb");
            //query sorgusu
            OleDbDataAdapter da = new OleDbDataAdapter("SELECT *from odunc_kitap", con);
            DataSet          ds;

            ds = new DataSet();
            da.Fill(ds, "odunc_kitap");
            this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; //tüm sütunları datagridview'e sığdırma
            dataGridView1.DataSource = ds.Tables["odunc_kitap"];                           //db'deki ödünçkitap tablosunu datagridview'e çekme
            dataGridView1.ReadOnly   = true;
            dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.White;

            // DATAGRİDVİEW 0.SÜTUNU YANİ ID SUTUNUNU DOLAŞIP ÖDÜNÇ KİTAP SAYISINI BULMA
            if (dataGridView1.Rows.Count > 0)
            {
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (dataGridView1.Rows[i].Cells[0].Value != DBNull.Value)
                    {
                        string rak = Convert.ToString((dataGridView1.Rows[i].Cells[0].Value));
                        if (rak == null)
                        {
                            MessageBox.Show("odunc kitap yok");
                        }
                        else
                        {
                            toplam = toplam + 1;
                        }
                    }
                }
            }
            label1.Text = "Toplam ödünç kitap sayısı = " + (toplam - 1);


            GraphPane grafik1 = zedGraphControl1.GraphPane;               //graphane sınıfından grafik1 adında yeni bir graphane türet.

            grafik1.Title.Text       = "Toplam Ödünç Kitap Sayısı";       //grafik1 adı
            grafik1.YAxis.Title.Text = "Kitap Sayısı";                    //grafik1 y eksen adı
            grafik1.XAxis.Title.Text = "   ";                             //grafik1 x eksen adı

            ZedGraph.PointPairList liste1 = new ZedGraph.PointPairList(); //pointpairlist sınıfından liste1 adında yeni bir pointpairlist türet.
            liste1.Add(0, toplam - 1);
            BarItem bar1 = zedGraphControl1.GraphPane.AddBar("Toplam Ödünç Kitap Sayısı", liste1, Color.Red);

            bar1.Bar.Fill            = new Fill(Color.Green);
            grafik1.BarSettings.Type = BarType.Cluster; // bar tipi
            grafik1.BarSettings.ClusterScaleWidth = 1;  //bar sıklığı
            zedGraphControl1.AxisChange();              // grafiği güncelle



            OleDbCommand xy = new OleDbCommand("SELECT COUNT(id) FROM kitap", con);  // kitap tablosundaki id'i sayıp kütüphanedeki toplam-

            con.Open();                                                              //kitap sayısını bulma

            Int32 zt = (Int32)xy.ExecuteScalar();

            GraphPane grafik2 = zedGraphControl2.GraphPane;                 //graphane sınıfından grafik2 adında yeni bir graphane türet.

            grafik2.Title.Text       = "Kütüphanedeki Toplam Kitap Sayısı"; //grafik2 adı
            grafik2.YAxis.Title.Text = "Kitap Sayısı";                      //grafik2 y eksen adı
            grafik2.XAxis.Title.Text = "   ";                               //grafik2 x eksen adı

            ZedGraph.PointPairList liste2 = new ZedGraph.PointPairList();   //pointpairlist sınıfından liste2 adında yeni bir pointpairlist türet.
            liste2.Add(0, zt);
            BarItem bar2 = zedGraphControl2.GraphPane.AddBar("Kütüphanedeki Toplam Kitap Sayısı", liste2, Color.Red);

            bar2.Bar.Fill            = new Fill(Color.Yellow);
            grafik2.BarSettings.Type = BarType.Cluster; // bar tipi
            grafik2.BarSettings.ClusterScaleWidth = 1;  //bar sıklığı
            zedGraphControl2.AxisChange();              // grafiği güncelle
            label2.Text = "Toplam Kitap sayısı = " + zt;



            GraphPane grafik3 = zedGraphControl3.GraphPane;                        //graphane sınıfından grafik1 adında yeni bir graphane türet.

            grafik3.Title.Text       = "Kütüphanede Verilmeye Hazır Kitap Sayısı"; //grafik3 adı
            grafik3.YAxis.Title.Text = "Kitap Sayısı";                             //grafik3 y eksen adı
            grafik3.XAxis.Title.Text = "   ";                                      //grafik1 x eksen adı

            ZedGraph.PointPairList liste3 = new ZedGraph.PointPairList();          //pointpairlist sınıfından liste1 adında yeni bir pointpairlist türet.
            //KÜTÜPHANEDEKİ TOPLAM KİTAP SAYISINDAN ÖDÜNÇ KİTAP SAYISI ÇIKARILDI.
            liste3.Add(0, zt - toplam + 1);
            BarItem bar3 = zedGraphControl3.GraphPane.AddBar("Kütüphanede Verilmeye Hazır Kitap Sayısı", liste3, Color.Orange);

            bar3.Bar.Fill            = new Fill(Color.Orange);
            grafik3.BarSettings.Type = BarType.Cluster; // bar tipi
            grafik3.BarSettings.ClusterScaleWidth = 1;  //bar sıklığı
            zedGraphControl3.AxisChange();              // grafiği güncelle
            label3.Text = "Toplam Kitap sayısı = " + (zt - toplam + 1);
        }
示例#33
0
        private void AddMenus()
        {
            BarItem bItem;

            #region ViewMenu
            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Code");
            bItem.Shortcut = Shortcut.F7;
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 4;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnBarItemClick"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Designer");
            bItem.Shortcut = Shortcut.ShiftF7;
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 4;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnBarItemClick"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Object Browser");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 42;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowObjectBrowser"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Class View");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 38;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowClassView"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Output Window");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 32;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowOutputWindow"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Error List");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 34;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowErrorList"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Task List");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 30;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowTaskList"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("ToolBox");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 0;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
            this.controller.WorkItem.Commands["OnShowToolBox"].AddInvoker(bItem, "Click");

            bItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem("Solution Explorer");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 31;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.View].Add(bItem);
              //  this.controller.WorkItem.Commands["OnShowSolutionExplorer"].AddInvoker(bItem, "Click");
            this.controller.WorkItem.Commands["OnShowNhapThongTinBenhNhan"].AddInvoker(bItem, "Click");
            #endregion

            #region Project Menu Add
            bItem = new BarItem("Add Windows Form");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 5;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddWindowsForm"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add UserControl");
            this.controller.WorkItem.Commands["OnAddWindowsForm"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add Component");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddComponent"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add Class");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 2;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddCode"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add NewItem");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddNewItem"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add Existing Item");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddExistingItem"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Show All Files");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 7;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnShowAllFiles"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Add Reference");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnAddReference"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Project Properties");
            bItem.ImageList = this.dockingImageList;
            bItem.ImageIndex = 8;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Project].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnShowProjectProperties"].AddInvoker(bItem, "Click");
            #endregion

            #region Build MenuItems

            bItem = new BarItem("Build Solution");
            bItem.Shortcut = Shortcut.CtrlShiftB;
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Build].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnBuildSolution"].AddInvoker(bItem, "Click");

            bItem = new BarItem("ReBuild Solution");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Build].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnRebuildSolution"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Clean Solution");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Build].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnCleanSolution"].AddInvoker(bItem, "Click");

            bItem = new BarItem("Configuration Manager");
            this.controller.WorkItem.UIExtensionSites[VSDemoCommon.UIElements.Build].Add<BarItem>(bItem);
            this.controller.WorkItem.Commands["OnConfigurationManager"].AddInvoker(bItem, "Click");

            #endregion
        }
示例#34
0
        /// <summary>
        /// Muestra la seccion detalles del error del formulario.
        /// </summary>
        private void ShowDetail(BarItem pItem)
        {

            if (_Detalle == FormExpansion.Show)
            {
                this.Height = _HeightExpanded;
                pItem.Glyph = Health.Front.Base.Properties.Resource.collapseVertical_16;
                //mnuExpandir.ToolTipText = "Ocultar detalle...";
                //mnuExpandir.Image = Fwk.Bases.FrontEnd.Controls.Properties.Resources.MaxImage;//imgFormExpansion.Images[1];
                _Detalle = FormExpansion.Hide;
            }
            else
            {
                this.Height = _HeightCollapsed;
                pItem.Glyph = Health.Front.Base.Properties.Resource.expandVertical_16;
                //mnuExpandir.ToolTipText = "Ver detalle...";
                //mnuExpandir.Image = Fwk.Bases.FrontEnd.Controls.Properties.Resources.MinImage;
                _Detalle = FormExpansion.Show;
            }
            
        }
示例#35
0
 public void AddItem(BarItem item, bool init)
 {
     listBox1.Items.Add(item.Caption);
     if(!init) listBox1.SelectedIndex = listBox1.Items.Count - 1;
 }
示例#36
0
        /// <summary>
        /// 更新按钮
        /// </summary>
        /// <param name="item"></param>
        private void UpdateButton(BarItem item,string sFunid)
        {
            string filter = string.Format(tb_sys_Fun_MenuBar.FNumber + "='{0}' and " + tb_sys_Fun_MenuBar.FFunctionID + "={1}", item.Name,sFunid);
            DataRow[] exists =_AuthorityItem.Select(filter);
            if (exists.Length > 0)
            {
                string caption = ConvertEx.ToString(exists[0][tb_sys_Fun_MenuBar.FName]);
                if (caption != item.Caption)
                {
                    _ButtonUpdated += 1;
                    exists[0][tb_sys_Fun_MenuBar.FName] = item.Caption; //更新菜单标题.
                }
            }
            else
            {
                DataRow append = _AuthorityItem.NewRow(); ;
                append[tb_sys_Fun_MenuBar.FID] = Convert.ToInt32(BridgeFactory.CreateCommonServiceBridge().GetTableID(tb_sys_Fun_MenuBar.__TableName, tb_sys_Fun_MenuBar.__KeyName)) + _ButtonInserted;
                append[tb_sys_Fun_MenuBar.FNumber] = item.Name;
                append[tb_sys_Fun_MenuBar.FName] = item.Caption;
                append[tb_sys_Fun_MenuBar.FFunctionID] = sFunid;
                append[tb_sys_Fun_MenuBar.FAuthority] = _MaxAuthorID;
                _MaxAuthorID = _MaxAuthorID * 2;
                _AuthorityItem.Rows.Add(append);

                _ButtonInserted += 1;
            }
        }
示例#37
0
        private void CreateBarItem(object pGroup, XmlNode xmlNode)
        {
            if (xmlNode != null)
            {
                string itemTye    = GetXMLAttribute(xmlNode, "ItemType");
                string nodeKey    = GetXMLAttribute(xmlNode, "Key");
                string widthStr   = GetXMLAttribute(xmlNode, "Width");
                string subItemStr = GetXMLAttribute(xmlNode, "SubItems");
                if (itemTye.ToLower().Equals("buttongroup"))
                {
                    //表示下面还是组的形式,有子对象;
                    BarItem groupButton = CreateRibbonButtonGroup(pGroup as RibbonPageGroup, xmlNode);
                    if (!string.IsNullOrEmpty(widthStr))
                    {
                        groupButton.Width = Convert.ToInt32(widthStr);
                    }
                    return;
                }
                else if (!string.IsNullOrEmpty(subItemStr))
                {
                    BarSubItem barItem = _ribbonManager.Items[nodeKey] as BarSubItem;
                    if (barItem == null)
                    {
                        return;
                    }
                    if (!string.IsNullOrEmpty(subItemStr))
                    {
                        string[] subs = subItemStr.Split(';');
                        for (int i = 0; i < subs.Length; i++)
                        {
                            BarItem oneItem = _ribbonManager.Items[subs[i]];
                            if (oneItem == null)
                            {
                                continue;
                            }
                            barItem.LinksPersistInfo.Add(new LinkPersistInfo(oneItem));
                        }
                    }
                    if (pGroup is RibbonPageGroup)
                    {
                        ((pGroup) as RibbonPageGroup).ItemLinks.Add(barItem);
                    }
                    else if (pGroup is BarButtonGroup)
                    {
                        ((pGroup) as BarButtonGroup).ItemLinks.Add(barItem);
                    }
                }
                else
                {
                    //首先检查已有的对象里面是否存在该菜单
                    BarItem barItem = _ribbonManager.Items[nodeKey];
                    if (barItem == null)
                    {
                        return;
                    }

                    if (!string.IsNullOrEmpty(widthStr))
                    {
                        barItem.Width = Convert.ToInt32(widthStr);
                    }
                    if (barItem != null)
                    {
                        if (pGroup is RibbonPageGroup)
                        {
                            ((pGroup) as RibbonPageGroup).ItemLinks.Add(barItem);
                        }
                        else if (pGroup is BarButtonGroup)
                        {
                            ((pGroup) as BarButtonGroup).ItemLinks.Add(barItem);
                        }
                    }
                }
            }
            return;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="BarLinksOwnerCollectionUIAdapter"/> using the
 /// specified item and linkCollection
 /// </summary>
 /// <param name="item"></param>
 /// <param name="linkCollection"></param>
 public BarLinksOwnerCollectionUIAdapter(BarItem item, BarItemLinkCollection linkCollection)
     : base(linkCollection, item.Manager.Items)
 {
     this.item = item;
 }
示例#39
0
 private void InitPaintStyle(BarItem item)
 {
     //if(item == null) return;
     //iPaintStyle.ImageIndex = item.ImageIndex;
     //iPaintStyle.Caption = item.Caption;
     //iPaintStyle.Hint = item.Description;
     //ctrlFavorites1.barManager1.GetController().PaintStyleName = barManager1.GetController().PaintStyleName;
 }
示例#40
0
 private void CreatePopupItem(BarItem parentItem, string itemId)
 {
     PopupMenu popup = new PopupMenu(new System.ComponentModel.Container());
     popup.MenuDrawMode = MenuDrawMode.LargeImagesText;
     BarButtonItem item = (BarButtonItem)parentItem;
     item.Id = frmRibbonMain.IIII++;
     item.ButtonStyle = BarButtonStyle.DropDown;
     item.DropDownControl = popup;
     popup.Ribbon = ribbonControl;
     foreach (DataRow drTemp in ds.Tables[0].Select("Parents='" + itemId + "'"))
     {
         createChildItem(popup, drTemp[0].ToString());
     }
 }
示例#41
0
    private string CreateStatisticMoneyImage(GameServer server, string dateFrom, string dateTo, ChartType type, bool showSymbol)
    {
        using (IBlazeDatabase db = DbFactory.GetDatabase())
        {
            IBlazeTable gameLogTable = db.GetTable(TableString.GameLogTableName);
            DataSet     data         = new DataSet();

            gameLogTable.Get(
                data,
                FilterFactory.CreateAndFilter(
                    FilterFactory.CreateEqualFilter(TableString.GameLogFieldGameServerId, server.Id),
                    FilterFactory.CreateAndFilter(
                        FilterFactory.CreateLargerEqualFilter(TableString.GameLogFieldDate, dateFrom),
                        FilterFactory.CreateLesserEqualFilter(TableString.GameLogFieldDate, dateTo)
                        )
                    )
                );

            DataTable table = data.Tables[0];

            int      count      = table.Rows.Count;
            double[] money      = new double[count];
            double[] moneyInBox = new double[count];
            double[] moneyTotal = new double[count];
            double[] date       = new double[count];
            for (int i = 0; i < count; i++)
            {
                DataRow row = table.Rows[i];
                money[i]      = (long)row[TableString.GameLogFieldTotalMoney];
                moneyInBox[i] = (long)row[TableString.GameLogFieldTotalMoneyInBox];
                moneyTotal[i] = money[i] + moneyInBox[i];
                DateTime currentDate = (DateTime)row[TableString.GameLogFieldDate];
                date[i] = new XDate(currentDate.Year, currentDate.Month, currentDate.Day);
            }

            bool success = true;

            if (success)
            {
                //»æÖÆͼ±í
                GraphPane graphPane = new GraphPane();

                graphPane.Title.Text = StringDef.MoneyStatistic;
                graphPane.Fill       = new Fill(WebConfig.GraphPaneBgColor);

                graphPane.Legend.Fill.IsVisible   = false;
                graphPane.Legend.Border.IsVisible = false;

                graphPane.XAxis.Title.Text          = StringDef.Date;
                graphPane.XAxis.MajorGrid.Color     = WebConfig.GraphXAxisGridColor;
                graphPane.XAxis.Type                = AxisType.DateAsOrdinal;
                graphPane.XAxis.MinorTic.Size       = 0;
                graphPane.XAxis.Scale.MajorStep     = 1;
                graphPane.XAxis.Scale.MajorUnit     = DateUnit.Day;
                graphPane.XAxis.Scale.FontSpec.Size = 12;
                graphPane.XAxis.Scale.Format        = "M-d";

                graphPane.YAxis.Title.Text          = StringDef.Money;
                graphPane.YAxis.MajorGrid.IsVisible = true;
                graphPane.YAxis.MajorGrid.DashOff   = 0;
                graphPane.YAxis.MajorGrid.Color     = Color.Gray;
                graphPane.YAxis.MinorGrid.IsVisible = true;
                graphPane.YAxis.MinorGrid.Color     = Color.LightGray;
                graphPane.YAxis.MinorGrid.DashOff   = 0;

                if (type == ChartType.Bar)
                {
                    graphPane.BarSettings.Type = BarType.Stack;

                    BarItem barItemMoney      = graphPane.AddBar(StringDef.Money, date, money, Colors[0]);
                    BarItem barItemMoneyInBox = graphPane.AddBar(StringDef.MoneyInBox, date, moneyInBox, Colors[1]);
                    barItemMoney.Bar.Fill      = new Fill(Colors[0]);
                    barItemMoneyInBox.Bar.Fill = new Fill(Colors[1]);
                }
                else if (type == ChartType.Line)
                {
                    LineItem lineItemMoney      = graphPane.AddCurve(StringDef.Money, date, money, Colors[0], (showSymbol ? WebConfig.GraphSymbols[0] : SymbolType.None));
                    LineItem lineItemMoneyInBox = graphPane.AddCurve(StringDef.MoneyInBox, date, moneyInBox, Colors[1], (showSymbol ? WebConfig.GraphSymbols[1] : SymbolType.None));
                    LineItem lineItemMoneyTotal = graphPane.AddCurve(StringDef.MoneyTotal, date, moneyTotal, Colors[2], (showSymbol ? WebConfig.GraphSymbols[2] : SymbolType.None));
                }

                Bitmap bitmap = new Bitmap(1, 1);
                using (Graphics g = Graphics.FromImage(bitmap))
                {
                    graphPane.AxisChange(g);
                }

                bitmap = graphPane.GetImage(WebConfig.StatisticRoleCountByLevelGraphWidth, WebConfig.StatisticRoleCountByLevelGraphHeight, 75.0f);
                string imageName = WebUtil.CreateRandomName("Statistic", WebConfig.GraphFileSuffix);
                string file      = WebConfig.WebsiteRootPath + WebConfig.TempGraphPath + imageName;
                try
                {
                    bitmap.Save(file, WebConfig.GraphImageFormat);
                    TempFileManager.TheInstance.AddTempFile(file, 5000 * WebConfig.TempGraphDeleteDelayMultiple);

                    return(imageName);
                }
                catch (Exception)
                {
                    //TODO ¼Ç¼´íÎó
                    return(null);
                }
            }

            return(null);
        }
    }