Exemple #1
0
        /// <summary>
        /// 创建菜单项
        /// </summary>
        /// <param name="node">节点</param>
        /// <param name="menu">菜单</param>
        /// <param name="parentItem">父节点</param>
        protected override void CreateMenuItem(XmlNode node, MenuA menu, MenuItemA parentItem)
        {
            MenuItemA item = new MenuItemA();

            item.Native = Native;
            item.Font   = new FONT("微软雅黑", 12, false, false, false);
            SetAttributesBefore(node, item);
            if (parentItem != null)
            {
                parentItem.AddItem(item);
            }
            else
            {
                menu.AddItem(item);
            }
            if (node.ChildNodes != null && node.ChildNodes.Count > 0)
            {
                foreach (XmlNode subNode in node.ChildNodes)
                {
                    CreateMenuItem(subNode, menu, item);
                }
            }
            SetAttributesAfter(node, item);
            OnAddControl(item, node);
        }
Exemple #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="mainFrame"></param>
 public MacIndustry(MainFrame mainFrame)
 {
     m_mainFrame     = mainFrame;
     m_cbMacIndustry = mainFrame.GetComboBox("cbMacIndustry");
     m_cbMacIndustry.RegisterEvent(new ControlEvent(SelectedIndexChanged), EVENTID.SELECTEDINDEXCHANGED);
     m_gridMacIndustry = mainFrame.GetGrid("gridMacIndustry");
     m_gridMacIndustry.GridLineColor      = COLOR.EMPTY;
     m_gridMacIndustry.BackColor          = COLOR.ARGB(0, 0, 0);
     m_gridMacIndustry.RowStyle           = new GridRowStyle();
     m_gridMacIndustry.RowStyle.BackColor = COLOR.ARGB(0, 0, 0);
     m_tvMacIndustry                    = mainFrame.GetTree("tvMacIndustry");
     m_tvMacIndustry.BackColor          = COLOR.ARGB(0, 0, 0);
     m_tvMacIndustry.ForeColor          = COLOR.ARGB(255, 255, 255);
     m_tvMacIndustry.RowStyle           = new GridRowStyle();
     m_tvMacIndustry.RowStyle.BackColor = COLOR.ARGB(0, 0, 0);
     m_tvMacIndustry.RegisterEvent(new GridCellMouseEvent(GridCellClick), EVENTID.GRIDCELLCLICK);
     String[] names = Enum.GetNames(typeof(MacroDataType));
     for (int i = 0; i < names.Length; i++)
     {
         MenuItemA item = new MenuItemA();
         item.Text = names[i];
         m_cbMacIndustry.AddItem(item);
     }
     m_cbMacIndustry.SelectedIndex = 0;
     m_fundCurve           = mainFrame.FindControl("graphMacIndustry") as FundCurveDiv;
     m_fundCurve.BackColor = COLOR.ARGB(0, 0, 0);
 }
Exemple #3
0
        /// <summary>
        /// 数值改变事件
        /// </summary>
        /// <param name="sender">调用者</param>
        private void SelectedIndexChangedEvent(object sender)
        {
            MenuItemA item  = m_cmbGroup.GetItems()[m_cmbGroup.SelectedIndex];
            JGroup    group = item.Tag as JGroup;

            m_cmbCategory.ClearItems();
            int size = group.Categories.Count;

            for (int i = 0; i < size; i++)
            {
                JCategory category = group.Categories[i];
                MenuItemA item1    = new MenuItemA();
                item1.Text = category.Name;
                item1.Tag  = category;
                m_cmbCategory.AddItem(item1);
            }
            m_cmbCategory.SelectedIndex = 0;
        }
Exemple #4
0
        /// <summary>
        /// 绑定服务器到下拉列表
        /// </summary>
        private void BindServersToComboBox()
        {
            m_cbMainServerIP.ClearItems();
            List <ServerInfo> serverInfos = new List <ServerInfo>();

            m_serverService.GetServers(serverInfos);
            int serverInfosSize = serverInfos.Count;

            for (int i = 0; i < serverInfosSize; i++)
            {
                ServerInfo connectInfo = serverInfos[i];
                String     type        = connectInfo.m_type;
                MenuItemA  item        = new MenuItemA(connectInfo.m_ip);
                item.Value = connectInfo.m_port.ToString();
                if (type == "主服务器")
                {
                    m_cbMainServerIP.AddItem(item);
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// 创建Jira
        /// </summary>
        /// <param name="date">日期</param>
        /// <param name="jira">Jira</param>
        /// <param name="jiras">Jira列表</param>
        public void Create(Jira jira)
        {
            //初始化分组
            int count = XmlHandle.Groups.Count;

            for (int i = 0; i < count; i++)
            {
                MenuItemA item = new MenuItemA();
                item.Text = XmlHandle.Groups[i].Name;
                item.Tag  = XmlHandle.Groups[i];
                this.m_cmbGroup.AddItem(item);
            }
            if (jira != null)
            {
                //初始化界面信息
                this.m_chbCloseTask.Checked        = jira.CloseTask;
                this.m_chbDeveloperPass.Checked    = jira.DeveloperPass;
                this.m_chbDeveloperReceive.Checked = jira.DeveloperReceive;
                this.m_cmbHurry.Text          = jira.Hurry;
                this.m_chbProductPass.Checked = jira.ProductPass;
                this.m_chbPublished.Checked   = jira.Published;
                this.m_chbTestPass.Checked    = jira.TestPass;
                this.m_chbWaitPublish.Checked = jira.WaitPublish;
                this.m_jira                  = jira;
                this.m_txtBranches.Text      = jira.Branches;
                this.m_rtbDescription.Text   = jira.Description;
                this.m_txtCreater.Text       = jira.Creater;
                this.m_txtDeveloper.Text     = jira.Developer;
                this.m_txtHttpPath.Text      = jira.HttpPath;
                this.m_txtJiraID.Text        = jira.JiraID;
                this.m_txtRelativeGroup.Text = jira.RelativeGroup;
                this.m_txtTitle.Text         = jira.Title;
                //日期格式化
                try
                {
                    this.m_dtpStart.Text = jira.StartDate.ToString("D");
                }
                catch (Exception ex)
                {
                    ErrorException.OnError(ex);
                }
                try
                {
                    this.m_dtpEnd.Text = jira.EndDate.ToString("D");
                }
                catch (Exception ex)
                {
                    ErrorException.OnError(ex);
                }
                //int groupCount = XmlHandle.Groups.Count;
                //选中下拉列表
                for (int i = 0; i < count; i++)
                {
                    if (XmlHandle.Groups[i].Id == jira.GroupID)
                    {
                        this.m_cmbGroup.SelectedIndex = i;
                        List <JCategory> categories = XmlHandle.Groups[i].Categories;
                        int categoriesCount         = categories.Count;
                        for (int j = 0; j < categoriesCount; j++)
                        {
                            if (categories[j].Id == jira.CategoryID)
                            {
                                this.m_cmbCategory.SelectedIndex = j;
                            }
                        }
                        break;
                    }
                }
            }
            else
            {
                m_isAdd = true;
                //创建Jira对象
                this.m_jira            = new Jira();
                this.m_jira.CreateDate = DateTime.Now;
                //默认显示当前日期
                m_dtpEnd.Text   = DateTime.Now.ToString("D");
                m_dtpStart.Text = DateTime.Now.ToString("D");
                try
                {
                    //根据缓存选中下拉列表
                    string cachePath = Path.Combine(XmlHandle.UserDir, "SetCache.txt");
                    string groupID   = File.Exists(cachePath) ? File.ReadAllText(cachePath, Encoding.UTF8) : "";
                    if (groupID != null && groupID.Length > 0)
                    {
                        //int count = XmlHandle.Groups.Count;
                        for (int i = 0; i < count; i++)
                        {
                            if (XmlHandle.Groups[i].Id == groupID)
                            {
                                this.m_cmbGroup.SelectedIndex = i;
                                return;
                            }
                        }
                    }
                    else
                    {
                        //默认选中
                        this.m_cmbGroup.SelectedIndex = 0;
                    }
                }
                catch (Exception ex)
                {
                    ErrorException.OnError(ex);
                }
            }
        }