Inheritance: Control
Example #1
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "Lytro Files (*.lfp)|*.lfp|All Files (*.*)|*.*";
                if (ofd.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    if (File.Exists(ofd.FileName))
                    {
                        try
                        {
                            lfp = new LytroFile(ofd.FileName);
                            lfp.Load();
                        }
                        catch (Exception ex)
                        {
                            ShowError("Could not load Lytro file:" + Environment.NewLine + ex.Message);
                            return;
                        }

                        ComboItem[] items = new ComboItem[lfp.JpegSections.Count];
                        for (int i = 0; i < items.Length; i++)
                        {
                            items[i] = new ComboItem(string.Format("{0}_{1}", lfp.Filename, i), i);
                        }
                        cbImages.DataSource = items;
                        cbImages.DisplayMember = "Text";
                        cbImages.ValueMember = "Value";
                    }
                }
            }
        }
Example #2
0
 public ComboItem AddItem(string name, System.Object value)
 {
     ComboItem newItem = new ComboItem(name, value);
     this.items.Add(newItem);
     newItem.OnMarkedAction += OnComboItemMarked;
     newItem.OnUnMarkedAction += OnComboItemUnMarked;
     return newItem;
 }
        public void Initialize()
        {
            Items.Add(new ComboItem(VEMapStyle.Road, Res.Get(StringId.MapRoad), "Images.RoadIcon.png"));

            if (AerialSupported)
            {
                Items.Add(new ComboItem(VEMapStyle.Aerial, Res.Get(StringId.MapAerial), "Images.AerialIcon.png"));
            }

            birdsEyeComboItem = new ComboItem(VEMapStyle.Birdseye, Res.Get(StringId.MapBirdseye), "Images.BEViewIcon.png");
        }
        private void BindSchedules()
        {
            lfa.pmgmt.data.DAO.Schedule.Schedule scheduleDAO = new data.DAO.Schedule.Schedule();
            scheduleDAO.ConnectionString = _connectionString;

            List<lfa.pmgmt.data.DTO.Schedule.Schedule> schedules = scheduleDAO.List();

            foreach (lfa.pmgmt.data.DTO.Schedule.Schedule schedule in schedules)
            {
                ComboItem item = new ComboItem();
                item.Id = schedule.Id;
                item.Name = schedule.Name;

                comboBox1.Items.Add(item);
            }
        }
        private void Frm_AddNew_Unit_Load_1(object sender, EventArgs e)
        {
            _connectionString = GetConnectionString();

            lfa.pmgmt.data.DAO.Schedule.Unit scheduleDAO = new data.DAO.Schedule.Unit();
            scheduleDAO.ConnectionString = _connectionString;
            List<lfa.pmgmt.data.DTO.Schedule.Unit> scheduleList = scheduleDAO.ListConfigurationUnits();

            foreach (lfa.pmgmt.data.DTO.Schedule.Unit scheduleItem in scheduleList)
            {
                ComboItem item = new ComboItem();
                item.Id = scheduleItem.Id;
                item.Name = scheduleItem.Name;

                comboBox1.Items.Add(item);
            }
        }
        private void Frm_AddNew_Unit_Load_1(object sender, EventArgs e)
        {
            _connectionString = GetConnectionString();

            lfa.pmgmt.data.DAO.Schedule.Device scheduleDAO = new data.DAO.Schedule.Device();
            scheduleDAO.ConnectionString = _connectionString;
            int s_unitId = scheduleDAO.GetUnitId(unitId);

            lfa.pmgmt.data.DAO.Configuration.Device DAO = new data.DAO.Configuration.Device();
            DAO.ConnectionString = _connectionString;
            List<lfa.pmgmt.data.DTO.Configuration.Device> scheduleList = DAO.List(unitId);

            foreach (lfa.pmgmt.data.DTO.Configuration.Device scheduleItem in scheduleList)
            {
                ComboItem item = new ComboItem();
                item.Id = scheduleItem.Id;
                item.Name = scheduleItem.Name;

                comboBox1.Items.Add(item);
            }

            comboBox2.Items.Add("On");
            comboBox2.Items.Add("Off");
        }
 public void Add(ComboItem item)
 {
     ComboItem importer = Importers.FindByName(System.IO.Path.GetExtension(item.Value).ToLower());
     this.Add(item.Value, System.IO.Path.GetFileNameWithoutExtension(item.Name), importer.Value, importer.Other);
 }
Example #8
0
        public FormColors(IceChatMessageFormat MessageFormat, IceChatColors IceChatColors)
        {
            InitializeComponent();

            this.Load += new EventHandler(FormColors_Load);

            //add the events for the Tab Bar Color Picker
            this.pictureTabCurrent.Click += new EventHandler(OnColor_Click);
            this.pictureTabMessage.Click += new EventHandler(OnColor_Click);
            this.pictureTabAction.Click += new EventHandler(OnColor_Click);

            this.pictureTabJoin.Click += new EventHandler(OnColor_Click);
            this.pictureTabPart.Click += new EventHandler(OnColor_Click);
            this.pictureTabQuit.Click += new EventHandler(OnColor_Click);
            this.pictureTabServer.Click += new EventHandler(OnColor_Click);
            this.pictureTabServerNotice.Click += new EventHandler(OnColor_Click);

            this.pictureTabBuddyNotice.Click += new EventHandler(OnColor_Click);

            this.pictureTabOther.Click += new EventHandler(OnColor_Click);
            this.pictureTabDefault.Click += new EventHandler(OnColor_Click);

            //add the events for the Nick Color Picker
            this.pictureAdmin.Click += new EventHandler(OnColor_Click);
            this.pictureOwner.Click += new EventHandler(OnColor_Click);
            this.pictureOperator.Click += new EventHandler(OnColor_Click);
            this.pictureHalfOperator.Click += new EventHandler(OnColor_Click);
            this.pictureVoice.Click += new EventHandler(OnColor_Click);
            this.pictureDefault.Click += new EventHandler(OnColor_Click);

            this.pictureConsole.Click += new EventHandler(OnColor_Click);
            this.pictureChannel.Click += new EventHandler(OnColor_Click);
            this.pictureQuery.Click += new EventHandler(OnColor_Click);
            this.pictureNickList.Click += new EventHandler(OnColor_Click);
            this.pictureServerList.Click += new EventHandler(OnColor_Click);
            this.pictureTabBarCurrent1.Click += new EventHandler(OnColor_Click);
            this.pictureTabBarCurrent2.Click += new EventHandler(OnColor_Click);
            this.pictureTabBarOther1.Click += new EventHandler(OnColor_Click);
            this.pictureTabBarOther2.Click += new EventHandler(OnColor_Click);
            this.pictureTabBackground.Click += new EventHandler(OnColor_Click);

            this.pictureTabBarHover1.Click += new EventHandler(OnColor_Click);
            this.pictureTabBarHover2.Click += new EventHandler(OnColor_Click);

            this.picturePanelHeaderBG1.Click += new EventHandler(OnColor_Click);
            this.picturePanelHeaderBG2.Click += new EventHandler(OnColor_Click);
            this.picturePanelHeaderForeColor.Click += new EventHandler(OnColor_Click);
            this.pictureUnreadTextMarkerColor.Click += new EventHandler(OnColor_Click);

            this.pictureToolBar.Click += new EventHandler(OnColor_Click);
            this.pictureMenuBar.Click += new EventHandler(OnColor_Click);
            this.pictureInputBox.Click += new EventHandler(OnColor_Click);
            this.pictureInputBoxFore.Click += new EventHandler(OnColor_Click);
            this.pictureChannelList.Click += new EventHandler(OnColor_Click);
            this.pictureChannelListFore.Click += new EventHandler(OnColor_Click);
            this.pictureStatusBar.Click += new EventHandler(OnColor_Click);
            this.pictureStatusFore.Click += new EventHandler(OnColor_Click);
            this.pictureHyperlink.Click += new EventHandler(OnColor_Click);

            this.iceChatColors = IceChatColors;

            UpdateColorSettings();

            messageIdentifiers = new Hashtable();
            AddMessageIdentifiers();

            colorPicker = new ColorButtonArray(panelColorPicker);
            colorPicker.OnClick += new ColorButtonArray.ColorSelected(colorPicker_OnClick);

            treeMessages.AfterSelect += new TreeViewEventHandler(treeMessages_AfterSelect);
            textRawMessage.TextChanged+=new EventHandler(textRawMessage_TextChanged);
            textRawMessage.KeyDown += new KeyEventHandler(textRawMessage_KeyDown);
            listIdentifiers.DoubleClick += new EventHandler(listIdentifiers_DoubleClick);

            treeBasicMessages.AfterSelect += new TreeViewEventHandler(treeBasicMessages_AfterSelect);

            tabMessages.SelectedTab = tabBasic;

            iceChatMessages = MessageFormat;

            textFormattedText.SingleLine = true;
            textFormattedText.NoEmoticons = true;
            textFormattedBasic.SingleLine = true;
            textFormattedBasic.NoEmoticons = true;

            //populate Message Settings

            UpdateMessageSettings();

            //load any plugin addons
            foreach (Plugin p in  FormMain.Instance.LoadedPlugins)
            {
                IceChatPlugin ipc = p as IceChatPlugin;
                if (ipc != null)
                {
                    if (ipc.plugin.Enabled == true)
                        ipc.plugin.LoadColorsForm(this.tabControlColors);
                }
            }

            ApplyLanguage();

            if (FormMain.Instance.IceChatOptions.Theme != null)
            {
                foreach (ThemeItem theme in FormMain.Instance.IceChatOptions.Theme)
                {
                    ComboItem item = new ComboItem();
                    item.ThemeName = theme.ThemeName;
                    item.ThemeType = theme.ThemeType;
                    comboTheme.Items.Add(item);
                }
            }

            if (FormMain.Instance.IceChatPluginThemes != null)
            {
                foreach (IThemeIceChat theme in FormMain.Instance.IceChatPluginThemes)
                {
                    ComboItem item = new ComboItem();
                    item.ThemeName = theme.Name;
                    item.ThemeType = "Plugin";
                    item.FileName = theme.FileName;
                    comboTheme.Items.Add(item);
                }

            }

            comboTheme.Text = FormMain.Instance.IceChatOptions.CurrentTheme;

            this.comboTheme.SelectedIndexChanged += new System.EventHandler(this.comboTheme_SelectedIndexChanged);
        }
Example #9
0
        private void buttonAddTheme_Click(object sender, EventArgs e)
        {
            //add the current color settings as a new theme
            //ask for the new theme
            InputBoxDialog i = new InputBoxDialog();
            i.FormPrompt = "New Monody Theme Name";
            i.FormCaption = "Add Monody Theme";
            if (i.ShowDialog() == DialogResult.OK)
            //i.ShowDialog();
            {
                if (i.InputResponse.Length > 0)
                {
                    //make file name theme-name.xml
                    string fileName = i.InputResponse;

                    string colorsFile = FormMain.Instance.CurrentFolder + System.IO.Path.DirectorySeparatorChar + "Colors-" + fileName + ".xml";

                    UpdateColors();

                    XmlSerializer serializer = new XmlSerializer(typeof(IceChatColors));
                    TextWriter textWriter = new StreamWriter(colorsFile);
                    serializer.Serialize(textWriter, iceChatColors);
                    textWriter.Close();
                    textWriter.Dispose();

                    string messageFile = FormMain.Instance.CurrentFolder + System.IO.Path.DirectorySeparatorChar + "Messages-" + fileName + ".xml";

                    XmlSerializer serializer2 = new XmlSerializer(typeof(IceChatMessageFormat));
                    TextWriter textWriter2 = new StreamWriter(messageFile);
                    serializer2.Serialize(textWriter2, iceChatMessages);
                    textWriter2.Close();
                    textWriter2.Dispose();

                    //add in the theme name into IceChatOptions

                    //make it the current theme
                    ComboItem item = new ComboItem();
                    item.ThemeName = fileName;
                    item.ThemeType = "XML";
                    comboTheme.Items.Add(item);

                    comboTheme.Text = fileName;

                }

            }
        }
Example #10
0
        public void Add(ComboItem item)
        {
            var extension = Path.GetExtension(item.Value);
            if (extension == null) {
                return;
            }

            var importer = _importers.FindByName(extension.ToLower());
            Add(item.Value, Path.GetFileNameWithoutExtension(item.Name), importer.Value, importer.Other);
        }
Example #11
0
 public void LoadOrganizations()
 {
     cbOrgName.DataSource = null;
     try
     {
         string sql = "SELECT id, CONCAT_WS(': ', name, chief_name) as org_name, name FROM organizations";
         MySqlCommand cmd = new MySqlCommand(sql, m_connection);
         MySqlDataReader rdr = cmd.ExecuteReader();
         List<ComboItem> items = new List<ComboItem>();
         List<ComboItem> org_rel_items = new List<ComboItem>();
         while (rdr.Read())
         {
             ComboItem item = new ComboItem(rdr["org_name"], rdr["id"]);
             ComboItem org_rel_item = new ComboItem(rdr["name"], rdr["id"]);
             items.Add(item);
             org_rel_items.Add(org_rel_item);
         }
         rdr.Close();
         cbOrgName.DataSource = items;
         cbOrgName.DisplayMember = "Text";
         cbOrgName.ValueMember = "Value";
         org_name.DataSource = org_rel_items;
         org_name.DisplayMember = "Text";
         org_name.ValueMember = "Text";
         //org_name.ValueType = typeof(long);
     }
     catch (MySql.Data.MySqlClient.MySqlException ex)
     {
         MessageBox.Show(ex.Message);
     }
     cbOrgName.SelectedIndex = -1;
 }
Example #12
0
        private int GetNurComboBoxValue(ComboBox comboBox)
        {
            ComboItem item = comboBox.SelectedItem as ComboItem;

            return(item.value);
        }
Example #13
0
 private void MultimeterChanged(ComboItem item)
 {
     _curentMultimeter = new Device(item.View, item.Value.ToString());
 }
Example #14
0
        //[ActionKey("View")]
        /// <summary>
        /// 获取下拉框Json结果集(统一处理)
        /// </summary>
        /// <returns></returns>
        public void GetCombobox()
        {
            string itemJson = Query <string>("sys_json");

            if (!string.IsNullOrEmpty(itemJson))
            {
                List <ComboItem> boxes = JsonHelper.ToList <ComboItem>(itemJson);
                JsonHelper       json  = new JsonHelper();
                if (boxes.Count > 0)
                {
                    List <MDataTable> dtList = new List <MDataTable>();
                    StringBuilder     sb     = new StringBuilder();
                    for (int i = 0; i < boxes.Count; i++)
                    {
                        ComboItem item = boxes[i];
                        string    code = SqlCode.GetCode(item.ObjName);
                        if (code != item.ObjName)
                        {
                            #region 核心处理
                            var sql = SqlCode.GetCode(item.ObjName);//已经处理过系统参数和Post参数
                            sql = ReplacePara(sql, "@para", item.Para);
                            sql = ReplacePara(sql, "@parent", item.Parent);

                            sb.Append(sql + " ; ");
                            #endregion
                        }
                        else
                        {
                            #region 找不到,则移除。
                            boxes.RemoveAt(i);
                            //从程序里找。
                            MDataTable dt = Combobox.Get(item.ObjName, Query <string>("q", item.Para));
                            if (dt != null)
                            {
                                dtList.Insert(0, dt);
                                boxes.Insert(0, item);
                            }
                            else
                            {
                                i--;
                            }
                            #endregion
                        }
                    }
                    if (sb.Length > 0)
                    {
                        string sql = sb.ToString().TrimEnd(';', ' ');
                        using (MProc proc = new MProc(null, CrossDb.GetConn(sql)))
                        {
                            if (proc.DalType == DalType.MsSql)
                            {
                                proc.ResetProc(sql);
                                dtList.AddRange(proc.ExeMDataTableList());
                            }
                            else
                            {
                                string[] items = sql.Split(';');
                                foreach (string item in items)
                                {
                                    proc.ResetProc(item);
                                    dtList.Add(proc.ExeMDataTable());
                                }
                            }
                        }
                    }
                    if (dtList.Count == 1 && Query <string>("q", null) != null)
                    {
                        jsonResult = dtList[0].ToJson(false, false, RowOp.None, true);
                        return;
                    }
                    for (int i = 0; i < dtList.Count; i++)
                    {
                        json.Add(boxes[i].ObjName, dtList[i].Rows.Count > 0 ? dtList[i].ToJson(false, false, RowOp.None, true) : "[]", true);
                    }
                    json.AddBr();
                }
                jsonResult = json.ToString();
            }
        }
Example #15
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            #region 检查
            if (string.IsNullOrEmpty(ProjectId))
            {
                MessageHelper.ShowMsg(MessageID.W000000002, MessageType.Alert, "项目");
                return;
            }
            if (string.IsNullOrEmpty(txtStep.Text.ToString()))
            {
                MessageHelper.ShowMsg(MessageID.W000000001, MessageType.Alert, "收入阶段");
                return;
            }
            //if (string.IsNullOrEmpty(txtExplanation.Text.ToString()))
            //{
            //    MessageHelper.ShowMsg(MessageID.W000000001, MessageType.Alert, "收入说明");
            //    return;
            //}
            //if (string.IsNullOrEmpty(iRatio.Text.ToString()))
            //{
            //    MessageHelper.ShowMsg(MessageID.W000000001, MessageType.Alert, "完成比例");
            //    return;
            //}
            #endregion

            DomainDLL.Income income = new DomainDLL.Income();
            income.ID          = ID;
            income.CREATED     = CREATED;
            income.Ratio       = Convert.ToDecimal(string.IsNullOrEmpty(iRatio.Text.ToString()) ? "0" : iRatio.Text.ToString());
            income.Remark      = txtRemark.Text.ToString();
            income.Step        = txtStep.Text.ToString();
            income.Explanation = txtExplanation.Text.ToString();
            income.UPDATED     = DateTime.Now;
            ComboItem item = (ComboItem)cbSFinishStatus.SelectedItem;
            if (item != null)
            {
                income.FinishStatus = int.Parse(item.Value.ToString());
            }
            income.FinishTag = txtFinishTag.Text.ToString();
            income.PID       = ProjectId;
            income.FilePath  = FilePath;
            if (!string.IsNullOrEmpty(txtFilePath.Text))
            {
                income.FilePath = FileHelper.UploadFile(txtFilePath.Text, UploadType.InCome, ProjectId, null);
            }

            if (string.IsNullOrEmpty(income.FilePath) && !string.IsNullOrEmpty(txtFilePath.Text.ToString()))
            {
                return;
            }
            else
            {
                JsonResult json = bll.SaveIncome(income);
                MessageHelper.ShowRstMsg(json.result);
                if (json.result)
                {
                    btnClear_Click(null, null);
                }
                DataBind();
            }
        }
Example #16
0
        /// <summary>
        /// populate a combo box on the toolbar
        /// </summary>
        /// <param name="group">The group that is the basis for this combo box.</param>
        private void FillCombo(ChoiceGroup group)
        {
            UIItemDisplayProperties groupDisplay = group.GetDisplayProperties();

#if USE_DOTNETBAR
            ComboBoxItem combo = group.ReferenceWidget as ComboBoxItem;
            if (combo.Focused)
            {
                return;                //don't mess while we're in the combo
            }
            // Disable if needed, but still show what's current, as for unicode fields where you can't change it, but you want to see what it is set to.
            combo.Enabled = groupDisplay.Enabled;

            ArrayList newItems     = new ArrayList();
            bool      fDifferent   = false;
            ComboItem selectedItem = null;
            foreach (ChoiceRelatedClass item in group)
            {
                if (item is SeparatorChoice)
                {
                    //TODO
                }
                else if (item is ChoiceBase)
                {
                    UIItemDisplayProperties display = ((ChoiceBase)item).GetDisplayProperties();
                    ComboItem ci = CreateComboItem((ChoiceBase)item, display);
                    if (ci != null)                    //will be null if item is supposed to be invisible now
                    {
                        newItems.Add(ci);
                        if (display.Checked)
                        {
                            selectedItem = ci;                             //nb: if there should be more than one, only the last one will be selected
                        }
                        if (combo.Items.Count < newItems.Count || ((combo.Items[newItems.Count - 1]) as ComboItem).Tag != item)
                        {
                            fDifferent = true;
                        }
                    }
                }
            }

            combo.AccessibleName = group.Label;
            if (fDifferent || selectedItem.Tag != (combo.SelectedItem as ComboItem).Tag)
            {
                combo.SuspendLayout = true;
                combo.Click        -= new EventHandler(OnComboClick);           //don't generate clicks (which end up being onpropertychanged() calls)
                combo.Items.Clear();
                combo.Items.AddRange(newItems.ToArray());
                combo.SelectedItem  = selectedItem;
                combo.Click        += new EventHandler(OnComboClick);
                combo.SuspendLayout = false;
            }

            //Set the ComboWidth of the combo box so that is is wide enough to show
            //the text of all items in the list.
            int maxStringLength = 0;
            for (int i = 0; i < combo.Items.Count; i++)
            {
                if (combo.Items[i].ToString().Length > maxStringLength)
                {
                    maxStringLength = combo.Items[i].ToString().Length;
                }
            }
            int factor = 6;
            if (maxStringLength > 0 && combo.ComboWidth < maxStringLength * factor)
            {
                combo.ComboWidth = maxStringLength * factor;
            }
            combo.Tooltip = combo.ToString();
#endif
        }
 void TemplateDocTemplate_DocAdded(Document doc)
 {
     TemplateDoc tmpd = (TemplateDoc)doc;
     tmpd.ModifiedChanged += new TemplateDoc.ModifiedChangedHandler(TemplateDoc_ModifiedChanged);
     tmpd.NameChanged += new TemplateDoc.NameChangedHandler(TemplateDoc_NameChanged);
     ComboItem ci = new ComboItem(tmpd);
     comboDocs.SelectedIndex = comboDocs.Items.Add(ci);
     Template[] atmpl = tmpd.GetTemplates();
     ArrayList alsNames = new ArrayList();
     foreach (Template tmpl in atmpl)
         alsNames.Add(tmpl.Name);
     toolTip.RemoveAll();
     TemplateDocTemplate_TemplatesAdded(tmpd, (string[])alsNames.ToArray(typeof(string)));
 }
        public List <ComboItem> GeneratecomboBoxItemsListSendkeys()
        {
            List <ComboItem> comboBoxItemsList = new List <ComboItem>();

            ComboItem CBI1 = new ComboItem();

            CBI1.text = "{BACKSPACE}";
            CBI1.text = "{BACKSPACE}";

            ComboItem CBI2 = new ComboItem();

            CBI2.text  = "{BREAK}";
            CBI2.Value = "{BREAK}";

            ComboItem CBI3 = new ComboItem();

            CBI3.text  = "{DELETE}";
            CBI3.Value = "{DELETE}";

            ComboItem CBI4 = new ComboItem();

            CBI4.text  = "{CAPSLOCK}";
            CBI4.Value = "{CAPSLOCK}";

            ComboItem CBI5 = new ComboItem();

            CBI5.text  = "DOWN ARROW";
            CBI5.Value = "{DOWN}";

            ComboItem CBI6 = new ComboItem();

            CBI6.text  = "{END}";
            CBI6.Value = "{END}";

            ComboItem CBI7 = new ComboItem();

            CBI7.text  = "{ENTER}";
            CBI7.Value = "{ENTER}";

            ComboItem CBI8 = new ComboItem();

            CBI8.text  = "{ESC}";
            CBI8.Value = "{ESC}";

            ComboItem CBI9 = new ComboItem();

            CBI9.text  = "{HELP}";
            CBI9.Value = "{HELP}";

            ComboItem CBI10 = new ComboItem();

            CBI10.text  = "{HOME}";
            CBI10.Value = "{HOME}";

            ComboItem CBI11 = new ComboItem();

            CBI11.text  = "{INSERT}";
            CBI11.Value = "{INSERT}";

            ComboItem CBI12 = new ComboItem();

            CBI12.text  = "{LEFT}";
            CBI12.Value = "{LEFT}";

            ComboItem CBI13 = new ComboItem();

            CBI13.text  = "{HOME}";
            CBI13.Value = "{HOME}";

            ComboItem CBI14 = new ComboItem();

            CBI14.text  = "{NUMLOCK}";
            CBI14.Value = "{NUMLOCK}";

            ComboItem CBI15 = new ComboItem();

            CBI15.text  = "{PGDN}";
            CBI15.Value = "{PGDN}";

            ComboItem CBI16 = new ComboItem();

            CBI16.text  = "PAGE UP";
            CBI16.Value = "{PGUP}";

            ComboItem CBI17 = new ComboItem();

            CBI17.text  = "{RIGHT}";
            CBI17.Value = "{RIGHT}";

            ComboItem CBI18 = new ComboItem();

            CBI18.text  = "{SCROLLLOCK}";
            CBI18.Value = "{SCROLLLOCK}";

            ComboItem CBI19 = new ComboItem();

            CBI19.text  = "{TAB}";
            CBI19.Value = "{TAB}";

            ComboItem CBI20 = new ComboItem();

            CBI20.text  = "{UP}";
            CBI20.Value = "{UP}";

            ComboItem CBI21 = new ComboItem();

            CBI21.text  = "+";
            CBI21.Value = "+";

            ComboItem CBI22 = new ComboItem();

            CBI22.text  = "^";
            CBI22.Value = "^";

            ComboItem CBI23 = new ComboItem();

            CBI23.text  = "%";
            CBI23.Value = "%";

            comboBoxItemsList.Add(CBI1);
            comboBoxItemsList.Add(CBI2);
            comboBoxItemsList.Add(CBI3);
            comboBoxItemsList.Add(CBI4);
            comboBoxItemsList.Add(CBI5);
            comboBoxItemsList.Add(CBI6);
            comboBoxItemsList.Add(CBI7);
            comboBoxItemsList.Add(CBI8);
            comboBoxItemsList.Add(CBI9);
            comboBoxItemsList.Add(CBI10);
            comboBoxItemsList.Add(CBI11);
            comboBoxItemsList.Add(CBI12);
            comboBoxItemsList.Add(CBI13);
            comboBoxItemsList.Add(CBI14);
            comboBoxItemsList.Add(CBI15);
            comboBoxItemsList.Add(CBI16);
            comboBoxItemsList.Add(CBI17);
            comboBoxItemsList.Add(CBI18);
            comboBoxItemsList.Add(CBI19);
            comboBoxItemsList.Add(CBI20);
            comboBoxItemsList.Add(CBI21);
            comboBoxItemsList.Add(CBI22);
            comboBoxItemsList.Add(CBI23);

            return(comboBoxItemsList);
        }
Example #19
0
        private void comboDocs_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ComboItem ci = (ComboItem)comboDocs.Items[comboDocs.SelectedIndex];

            DocManager.SetActiveDocument(typeof(TemplateDoc), ci.m_tmpd);
        }
Example #20
0
        private void metroTileAccept_Click(object sender, EventArgs e)
        {
            //Validaciones

            int count = 0;

            try
            {
                if (cboProveedor.SelectedIndex == -1)
                {
                    MetroMessageBox.Show(this, "Cliente no válido.\nSeleccione un cliente de la lista.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    count++;
                    return;
                }
                if (txtFactura.Text.Equals(""))
                {
                    MetroMessageBox.Show(this, "Factura no válida.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    count++;
                    return;
                }
                if (txtPrecio.Text.Equals(""))
                {
                    MetroMessageBox.Show(this, "Precio no válida.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    count++;
                    return;
                }
                if (cboProducto.SelectedIndex == -1)
                {
                    MetroMessageBox.Show(this, "Producto no válido.\nSeleccione un producto de la lista.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    count++;
                    return;
                }
                if (txtCantidad.Text.Equals(""))
                {
                    MetroMessageBox.Show(this, "Cantidad no válida.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    count++;
                    return;
                }
            }
            catch
            {
            }

            //Acción

            if (count == 0)
            {
                ComboItem selected_proveedor = (ComboItem)cboProveedor.SelectedItem;

                Movimiento movimiento        = new Movimiento();
                ArrayList  producto_list     = new ArrayList();
                ArrayList  producto_cantidad = new ArrayList();

                movimiento.Factura     = Convert.ToInt32(txtFactura.Text);
                movimiento.Fecha       = metroDateTimeFecha.Value;
                movimiento.Dinero      = (Convert.ToSingle(txtPrecio.Text) + Convert.ToSingle(txtPrecioFlete.Text)) * -1;
                movimiento.Id_personas = Convert.ToInt32(selected_proveedor.Value);

                for (int i = 0; i < GVProductos.Rows.Count; i++)
                {
                    producto_list.Add(GVProductos.Rows[i].Cells[0].Value.ToString());
                    producto_cantidad.Add(GVProductos.Rows[i].Cells[2].Value.ToString());
                }
                if (MetroMessageBox.Show(this, "¿Está seguro de que desea ingresar la siguiente compra?\nProveedor: " + selected_proveedor.Text + "\nFecha: " + metroDateTimeFecha.Value + "\nN° Factura: " + txtFactura.Text + "\nPrecio: $" + ((Convert.ToSingle(txtPrecio.Text) + Convert.ToSingle(txtPrecioFlete.Text))), "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    if (controllers.InsertMovimiento(movimiento))
                    {
                        controllers.InsertMasMovimiento_Productos(producto_list, producto_cantidad);
                        //Limpieza de formulario
                        cboProveedor.SelectedIndex = -1;
                        //metroDateTimeFecha.Value = new DateTime();
                        txtFactura.Clear();
                        txtPrecio.Clear();
                        txtPrecioFlete.Clear();
                        cboProducto.SelectedIndex = -1;
                        GVProductos.Rows.Clear();
                        txtCantidad.Text    = "1";
                        txtPrecioFlete.Text = "0";
                        cboProducto.Items.Clear();
                        LlenarCombo();

                        MetroMessageBox.Show(this, "La compra ha sido ingresada correctamente.", "EXITO", MessageBoxButtons.OK, MessageBoxIcon.Question);
                    }
                    else
                    {
                        MetroMessageBox.Show(this, "La compra no ha sido ingresada correctamente.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #21
0
    public void LoadItem(Item item)
    {
        if (stopSearch || item.ItemId == Item.NONE)
        {
            return;
        }
        CurrentItemID = item.ItemId;
        if (CurrentItemID == MESSAGEBOTTLEITEM)
        {
            CurrentFilter = ItemFilter.MsgBottle;
        }
        else if (CurrentItemID == RECIPEITEM)
        {
            CurrentFilter = ItemFilter.Recipes;
        }
        else if (CurrentItemID == FOSSILITEM)
        {
            CurrentFilter = ItemFilter.Fossils;
        }
        else
        {
            CurrentFilter = ItemFilter.Items;
        }

        List <ComboItem> list      = FilterToItems(CurrentFilter);
        ComboItem        comboItem = (CurrentFilter == ItemFilter.Items) ? list.Find((ComboItem x) => x.Value == item.ItemId) : list.Find((ComboItem x) => x.Value == item.Count);

        SearchField.text = comboItem.Text;
        CurrentItemID    = item.ItemId;
        ItemKind itemKind = ItemInfo.GetItemKind(Convert.ToUInt16(CurrentItemID));

        if (itemKind.IsFlower())
        {
            loadGenes(item.Genes);
            FlowerController.DaysWatered.text    = item.DaysWatered.ToString();
            FlowerController.GoldCanWatered.isOn = item.IsWateredGold;
            FlowerController.Watered.isOn        = item.IsWatered;
            bool[] array = new bool[10];
            for (int i = 0; i < 10; i++)
            {
                array[i] = item.GetIsWateredByVisitor(i);
            }
            FlowerController.SetVisitorWatered(array);
        }
        else
        {
            SetController.FCount.text = item.Count.ToString();
            SetController.CompileBodyFabricFromCount();
            SetController.FUses.text     = item.UseCount.ToString();
            SetController.FFlagZero.text = item.SystemParam.ToString();
        }

        if (itemKind == ItemKind.Kind_MessageBottle || CurrentItemID >= 60_000)
        {
            SetController.FFlagOne.text = item.AdditionalParam.ToString();
            SetController.FFlagOne.gameObject.SetActive(true);
        }
        else
        {
            WrapController.WrapToggle.isOn     = item.WrappingType != ItemWrapping.Nothing;
            WrapController.WrapType.value      = (int)item.WrappingType;
            WrapController.WrapColor.value     = (int)item.WrappingPaper;
            WrapController.ShowItemToggle.isOn = item.WrappingShowItem;
            WrapController.Flag80 = item.Wrapping80;
        }

        DropdownFilter.SetValueWithoutNotify((int)CurrentFilter);
        DropdownFilter.RefreshShownValue();

        UpdateSprite();
    }
Example #22
0
 private void DeviceChanged(ComboItem item)
 {
     _currentDevice = new Device(item.View, item.Value.ToString());
 }
        private void departmentsComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboItem itm = (ComboItem)departmentDropDown.SelectedItem;

            fillEmployeesDropDown(itm.ID);
        }
Example #24
0
        private void populateComboBoxes()
        {
            // Set the Text
            CB_HeldItem.DisplayMember                   =
                CB_Species.DisplayMember                =
                    CB_Ability.DisplayMember            =
                        CB_Nature.DisplayMember         =
                            CB_GameOrigin.DisplayMember =
                                CB_HPType.DisplayMember = "Text";

            // Set the Value
            CB_HeldItem.ValueMember                   =
                CB_Species.ValueMember                =
                    CB_Ability.ValueMember            =
                        CB_Nature.ValueMember         =
                            CB_GameOrigin.ValueMember =
                                CB_HPType.ValueMember = "Value";

            var Any = new ComboItem {
                Text = "Any", Value = -1
            };

            var DS_Species = new List <ComboItem>(GameInfo.SpeciesDataSource);

            DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;

            var DS_Item = new List <ComboItem>(GameInfo.ItemDataSource);

            DS_Item.Insert(0, Any); CB_HeldItem.DataSource = DS_Item;

            var DS_Nature = new List <ComboItem>(GameInfo.NatureDataSource);

            DS_Nature.Insert(0, Any); CB_Nature.DataSource = DS_Nature;

            var DS_Ability = new List <ComboItem>(GameInfo.AbilityDataSource);

            DS_Ability.Insert(0, Any); CB_Ability.DataSource = DS_Ability;

            var DS_Version = new List <ComboItem>(GameInfo.VersionDataSource);

            DS_Version.Insert(0, Any); CB_GameOrigin.DataSource = DS_Version;

            string[] hptypes = new string[GameInfo.Strings.types.Length - 2]; Array.Copy(GameInfo.Strings.types, 1, hptypes, 0, hptypes.Length);
            var      DS_Type = Util.getCBList(hptypes, null);

            DS_Type.Insert(0, Any); CB_HPType.DataSource = DS_Type;

            // Set the Move ComboBoxes too..
            var DS_Move = new List <ComboItem>(GameInfo.MoveDataSource);

            DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
            {
                foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
                {
                    cb.DisplayMember = "Text"; cb.ValueMember = "Value";
                    cb.DataSource    = new BindingSource(DS_Move, null);
                }
            }

            // Trigger a Reset
            resetFilters(null, null);
        }
Example #25
0
    private void OnComboItemUnMarked(ComboItem item)
    {
        //Debug.Log("Item: " + item.name + " unmarked");

        //clear the last marked if we've unmarked it
        if(item == lastMarked)
            lastMarked = null;
    }
Example #26
0
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboItem selectedItem = comboBox1.SelectedItem as ComboItem;
            int selectedUnit = selectedItem.Id;

            List<lfa.pmgmt.data.DTO.Configuration.Device> devices = new List<data.DTO.Configuration.Device>();
            lfa.pmgmt.data.DAO.Configuration.Device deviceDAO = new data.DAO.Configuration.Device();
            deviceDAO.ConnectionString = _connectionString;

            devices = deviceDAO.List(selectedUnit);

            foreach (lfa.pmgmt.data.DTO.Configuration.Device device in devices)
            {
                ComboItem item = new ComboItem();
                item.Id = device.Id;
                item.Name = device.Name;

                comboBox3.Items.Add(item);
            }
        }
Example #27
0
 public void AddItem(ComboItem newItem)
 {
     this.items.Add(newItem);
     newItem.OnMarkedAction += OnComboItemMarked;
     newItem.OnUnMarkedAction += OnComboItemUnMarked;
 }
        private void LoadProcesses()
        {
            ModuleProc PROC = new ModuleProc("", "LoadProcesses");
            lvwProcesses.Items.Clear();
            int pid = Process.GetCurrentProcess().Id;

            try
            {
                var processes = (from p in Process.GetProcesses()
                                 where p.Id != pid
                                 orderby p.ProcessName
                                 select p);
                var processes2 = BMC.CoreLib.WMI.Win32.Process.GetInstances().OfType<BMC.CoreLib.WMI.Win32.Process>();
                int index = 1;
                foreach (Process process in processes)
                {
                    ComboItem item = new ComboItem()
                    {
                        Id = process.Id,
                        Name = process.ProcessName,
                        Process = process,
                        MainWindowTitle = process.MainWindowTitle
                    };
                    var process2 = (from p in processes2
                                    where p.ProcessId == process.Id
                                    select p).FirstOrDefault();
                    if (process2 != null)
                    {
                        string path = process2.ExecutablePath;
                        item.SetProcessInfo(process2);
                        item.Name = process2.Caption;
                    }

                    ListViewItem item2 = new ListViewItem(index.ToString());
                    item2.SubItems.Add(item.DisplayName);
                    item2.Tag = item;
                    lvwProcesses.Items.Add(item2);
                    index++;
                    Thread.Sleep(1);
                }

                lvwProcesses.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
                lvwProcesses.Items[0].Selected = true;
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
Example #29
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboItem selectedItem = comboBox1.SelectedItem as ComboItem;
            int selectedZone = selectedItem.Id;

            List<lfa.pmgmt.data.DTO.Configuration.Unit> units = new List<data.DTO.Configuration.Unit>();
            lfa.pmgmt.data.DAO.Configuration.Unit unitDAO = new data.DAO.Configuration.Unit();
            unitDAO.ConnectionString = _connectionString;

            units = unitDAO.List(selectedZone);

            foreach (lfa.pmgmt.data.DTO.Configuration.Unit unit in units)
            {
                ComboItem item = new ComboItem();
                item.Id = unit.Id;
                item.Name = unit.Name;

                comboBox2.Items.Add(item);
            }
        }
Example #30
0
        private void buttonImportTheme_Click(object sender, EventArgs e)
        {
            //this will load an icechat 7 theme
            //do it the same way as icechat 7 did, from the clipboard

            OpenFileDialog ofd = new OpenFileDialog();
            ofd.DefaultExt = ".ini";
            ofd.CheckFileExists = true;
            ofd.CheckPathExists = true;
            ofd.AddExtension = true;
            ofd.AutoUpgradeEnabled = true;
            ofd.Filter = "Monody INI Setting (*.ini)|*.ini";
            ofd.Title = "Locate the Monody.ini settings file?";

            string directory = Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + Path.DirectorySeparatorChar + "Monody";

            //check if the folder exists
            if (File.Exists(directory + Path.DirectorySeparatorChar + "icechat.ini"))
                ofd.InitialDirectory = directory;
            else
                ofd.InitialDirectory = Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                //make sure it is icechat.ini
                System.Diagnostics.Debug.WriteLine(ofd.FileName);

                if (Path.GetFileName(ofd.FileName).ToLower().Equals("icechat.ini"))
                {
                    IniParser parser = new IniParser(ofd.FileName);

                    string[] themes = parser.EnumSectionTheme("Color Themes");
                    foreach (string theme in themes)
                    {
                        string name = theme.Substring(0, theme.IndexOf((char)255));
                        string value = theme.Substring(theme.IndexOf((char)255) + 1);
                        string[] colors = value.Split(',');

                        if (name == "Default")
                            name = "DefaultIce7";

                        IceChatColors ic = new IceChatColors();

                        ic.ChannelAdminColor = Convert.ToInt32(colors[38]);
                        ic.ChannelBackColor = Convert.ToInt32(colors[43]);
                        ic.ChannelListBackColor = Convert.ToInt32(colors[63]);
                        ic.ChannelListForeColor = Convert.ToInt32(colors[86]);
                        ic.ChannelOwnerColor = Convert.ToInt32(colors[39]);
                        ic.ChannelRegularColor = Convert.ToInt32(colors[34]);
                        ic.ChannelVoiceColor = Convert.ToInt32(colors[35]);
                        ic.ChannelHalfOpColor = Convert.ToInt32(colors[36]);
                        ic.ChannelOpColor = Convert.ToInt32(colors[37]);
                        ic.ConsoleBackColor = Convert.ToInt32(colors[42]);
                        ic.InputboxBackColor = Convert.ToInt32(colors[52]);
                        ic.InputboxForeColor = Convert.ToInt32(colors[25]);
                        ic.NickListBackColor = Convert.ToInt32(colors[53]);
                        ic.PanelHeaderBG1 = Convert.ToInt32(colors[70]);
                        ic.PanelHeaderBG2 = Convert.ToInt32(colors[71]);
                        ic.PanelHeaderForeColor = Convert.ToInt32(colors[88]);
                        ic.QueryBackColor = Convert.ToInt32(colors[44]);
                        ic.RandomizeNickColors = false;
                        ic.ServerListBackColor = Convert.ToInt32(colors[54]);
                        ic.StatusbarBackColor = Convert.ToInt32(colors[90]);
                        ic.StatusbarForeColor = Convert.ToInt32(colors[89]);
                        ic.TabBarChannelJoin = Convert.ToInt32(colors[30]);
                        ic.TabBarChannelPart = Convert.ToInt32(colors[31]);
                        ic.TabBarCurrent = Convert.ToInt32(colors[28]);
                        ic.TabBarDefault = Convert.ToInt32(colors[28]);
                        ic.TabBarNewMessage = Convert.ToInt32(colors[29]);
                        ic.TabBarOtherMessage = Convert.ToInt32(colors[32]);
                        ic.TabBarServerMessage = Convert.ToInt32(colors[32]);
                        ic.TabBarServerQuit = Convert.ToInt32(colors[32]);
                        ic.TabBarNewAction = Convert.ToInt32(colors[29]);
                        ic.TabBarServerNotice = Convert.ToInt32(colors[32]);
                        ic.TabBarBuddyNotice = Convert.ToInt32(colors[32]);
                        ic.ToolbarBackColor = Convert.ToInt32(colors[68]);
                        ic.UnreadTextMarkerColor = Convert.ToInt32(colors[67]);

                        XmlSerializer serializerC = new XmlSerializer(typeof(IceChatColors));
                        string themeFile = FormMain.Instance.CurrentFolder + System.IO.Path.DirectorySeparatorChar + "Colors-" + name + ".xml";
                        TextWriter textWriterC = new StreamWriter(themeFile);
                        serializerC.Serialize(textWriterC, ic);
                        textWriterC.Close();
                        textWriterC.Dispose();

                        IceChatMessageFormat im = new IceChatMessageFormat();
                        im.MessageSettings = new ServerMessageFormatItem[49];

                        im.MessageSettings[0] = NewMessageFormat("Server Connect", "&#x3;" + colors[18] + "*** Attempting to connect to $server ($serverip) on port $port");
                        im.MessageSettings[1] = NewMessageFormat("Server Disconnect", "&#x3;" + colors[19] + "*** Server disconnected on $server");
                        im.MessageSettings[2] = NewMessageFormat("Server Reconnect", "&#x3;" + colors[11] + "*** Attempting to re-connect to $server");
                        im.MessageSettings[3] = NewMessageFormat("Channel Invite", "&#x3;" + colors[22] + "* $nick invites you to $channel");
                        im.MessageSettings[4] = NewMessageFormat("Ctcp Reply", "&#x3;" + colors[27] + "[$nick $ctcp Reply] : $reply");
                        im.MessageSettings[5] = NewMessageFormat("Ctcp Send", "&#x3;" + colors[26] + "--> [$nick] $ctcp");
                        im.MessageSettings[6] = NewMessageFormat("Ctcp Request", "&#x3;" + colors[11] + "[$nick] $ctcp");
                        im.MessageSettings[7] = NewMessageFormat("Channel Mode", "&#x3;" + colors[7] + "* $nick sets mode $mode $modeparam for $channel");
                        im.MessageSettings[8] = NewMessageFormat("Server Mode", "&#x3;" + colors[16] + "* Your mode is now $mode");
                        im.MessageSettings[9] = NewMessageFormat("Server Notice", "&#x3;" + colors[24] + "*** $server $message");
                        im.MessageSettings[10] = NewMessageFormat("Server Message", "&#x3;" + colors[11] + "-$server- $message");
                        im.MessageSettings[11] = NewMessageFormat("User Notice", "&#x3;" + colors[3] + "--$nick-- $message");
                        im.MessageSettings[12] = NewMessageFormat("Channel Message", "&#x3;" + colors[0] + "<$color$status$nick&#x3;> $message");
                        im.MessageSettings[13] = NewMessageFormat("Self Channel Message", "&#x3;" + colors[2] + "<$nick&#x3;> $message");
                        im.MessageSettings[14] = NewMessageFormat("Channel Action", "&#x3;" + colors[1] + "* $nick $message");
                        im.MessageSettings[15] = NewMessageFormat("Self Channel Action", "&#x3;" + colors[2] + "* $nick $message");
                        im.MessageSettings[16] = NewMessageFormat("Channel Join", "&#x3;" + colors[5] + "* $nick ($host)$account has joined channel $channel");
                        im.MessageSettings[17] = NewMessageFormat("Self Channel Join", "&#x3;" + colors[5] + "* You have joined $channel");
                        im.MessageSettings[18] = NewMessageFormat("Channel Part", "&#x3;" + colors[4] + "* $nick ($host) has left $channel $reason");
                        im.MessageSettings[19] = NewMessageFormat("Self Channel Part", "&#x3;" + colors[4] + "* You have left $channel - You will be missed &#x3;10 $reason");
                        im.MessageSettings[20] = NewMessageFormat("Server Quit", "&#x3;" + colors[21] + "* $nick ($host) Quit ($reason)");
                        im.MessageSettings[21] = NewMessageFormat("Channel Nick Change", "&#x3;" + colors[20] + "* $nick is now known as $newnick");
                        im.MessageSettings[22] = NewMessageFormat("Self Nick Change", "&#x3;" + colors[20] + "* You are now known as $newnick");
                        im.MessageSettings[23] = NewMessageFormat("Channel Kick", "&#x3;" + colors[6] + "* $kickee was kicked by $nick($host) &#x3;3 - Reason ($reason)");
                        im.MessageSettings[24] = NewMessageFormat("Self Channel Kick", "&#x3;" + colors[6] + "* You were kicked from $channel by $kicker (&#x3;3$reason)");
                        im.MessageSettings[25] = NewMessageFormat("Private Message", "&#x3;" + colors[0] + "<$nick> $message");
                        im.MessageSettings[26] = NewMessageFormat("Self Private Message", "&#x3;" + colors[2] + "<$nick>&#x3;1 $message");
                        im.MessageSettings[27] = NewMessageFormat("Private Action", "&#x3;" + colors[1] + "* $nick $message");
                        im.MessageSettings[28] = NewMessageFormat("Self Private Action", "&#x3;" + colors[1] + "* $nick $message");
                        im.MessageSettings[29] = NewMessageFormat("DCC Chat Action", "&#x3;" + colors[1] + "* $nick $message");
                        im.MessageSettings[30] = NewMessageFormat("Self DCC Chat Action", "&#x3;" + colors[1] + "* $nick $message");
                        im.MessageSettings[31] = NewMessageFormat("DCC Chat Message", "&#x3;" + colors[0] + "<$nick> $message");
                        im.MessageSettings[32] = NewMessageFormat("Self DCC Chat Message", "&#x3;" + colors[2] + "<$nick> $message");
                        im.MessageSettings[33] = NewMessageFormat("DCC Chat Request", "&#x3;" + colors[11] + "* $nick ($host) is requesting a DCC Chat");
                        im.MessageSettings[34] = NewMessageFormat("DCC File Send", "&#x3;" + colors[11] + "* $nick ($host) is trying to send you a file ($file) [$filesize bytes]");
                        im.MessageSettings[35] = NewMessageFormat("Channel Topic Change", "&#x3;" + colors[8] + "* $nick changes topic to: $topic");
                        im.MessageSettings[36] = NewMessageFormat("Channel Topic Text", "&#x3;" + colors[8] + " Topic: $topic");
                        im.MessageSettings[37] = NewMessageFormat("Server MOTD", "&#x3;" + colors[10] + "$message");
                        im.MessageSettings[38] = NewMessageFormat("Channel Notice", "&#x3;" + colors[3] + "-$nick:$status$channel- $message");
                        im.MessageSettings[39] = NewMessageFormat("Channel Other", "&#x3;" + colors[9] + "$message");
                        im.MessageSettings[40] = NewMessageFormat("User Echo", "&#x3;" + colors[15] + "$message");
                        im.MessageSettings[41] = NewMessageFormat("Server Error", "&#x3;" + colors[17] + "ERROR: $message");
                        im.MessageSettings[42] = NewMessageFormat("User Whois", "&#x3;" + colors[14] + "->> $nick $data");
                        im.MessageSettings[43] = NewMessageFormat("User Error", "&#x3;" + colors[12] + "ERROR: $message");
                        im.MessageSettings[44] = NewMessageFormat("DCC Chat Connect", "&#x3;" + colors[18] + "* DCC Chat Connection Established with $nick");
                        im.MessageSettings[45] = NewMessageFormat("DCC Chat Disconnect", "&#x3;" + colors[19] + "* DCC Chat Disconnected from $nick");
                        im.MessageSettings[46] = NewMessageFormat("DCC Chat Outgoing", "&#x3;" + colors[11] + "* DCC Chat Requested with $nick");
                        im.MessageSettings[47] = NewMessageFormat("DCC Chat Timeout", "&#x3;" + colors[11] + "* DCC Chat with $nick timed out");
                        im.MessageSettings[48] = NewMessageFormat("Self Notice", "&#x3;" + colors[24] + "--> $nick - $message");

                        //check if we have this theme already...
                        bool themeFound = false;
                        foreach (ComboItem checkTheme in comboTheme.Items)
                        {
                            if (checkTheme.ThemeName.ToLower().Equals(name.ToLower()))
                                themeFound = true;
                        }

                        if (themeFound == false)
                        {
                            XmlSerializer serializerIM = new XmlSerializer(typeof(IceChatMessageFormat));
                            string messFile = FormMain.Instance.CurrentFolder + System.IO.Path.DirectorySeparatorChar + "Messages-" + name + ".xml";
                            TextWriter textWriterIM = new StreamWriter(messFile);
                            serializerIM.Serialize(textWriterIM, im);
                            textWriterIM.Close();
                            textWriterIM.Dispose();

                            ComboItem item = new ComboItem();
                            item.ThemeName = name;
                            item.ThemeType = "XML";
                            comboTheme.Items.Add(item);
                        }
                    }

                }

            }
        }
        private void Frm_Manage_Log_Load_1(object sender, EventArgs e)
        {
            _connectionString = GetConnectionString();

            lfa.pmgmt.data.DAO.Configuration.Zone zoneDOA = new data.DAO.Configuration.Zone();
            zoneDOA.ConnectionString = _connectionString;
            List<lfa.pmgmt.data.DTO.Configuration.Zone> zoneList = zoneDOA.List();

            foreach (lfa.pmgmt.data.DTO.Configuration.Zone zone in zoneList)
            {
                ComboItem item = new ComboItem();
                item.Id = zone.Id;
                item.Name = zone.Name;

                comboBox1.Items.Add(item);
            }
        }
Example #32
0
        private void buttonLoadTheme_Click(object sender, EventArgs e)
        {
            //load a new theme file(s)
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.DefaultExt = ".xml";
            ofd.CheckFileExists = true;
            ofd.CheckPathExists = true;
            ofd.AddExtension = true;
            ofd.AutoUpgradeEnabled = true;
            ofd.Filter = "XML file (*.xml)|Colors-*.xml";
            ofd.Title = "Which Theme File do you want to load?";
            ofd.InitialDirectory = FormMain.Instance.CurrentFolder;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string themeName = "";
                if (System.IO.Path.GetFileName(ofd.FileName).StartsWith("Colors-"))
                {
                    //get the theme name
                    string f = System.IO.Path.GetFileName(ofd.FileName).Substring(7);
                    themeName = f.Substring(0, f.Length - 4);
                }

                if (System.IO.Path.GetFileName(ofd.FileName).StartsWith("Messages-"))
                {
                    //get the theme name
                    string f = System.IO.Path.GetFileName(ofd.FileName).Substring(9);
                    themeName = f.Substring(0, f.Length - 4);
                }

                if (themeName.Length > 0)
                {
                    //add the new theme name
                    ComboItem item = new ComboItem();
                    item.ThemeName = themeName;
                    item.ThemeType = "XML";
                    comboTheme.Items.Add(item);

                    //make new theme default theme
                    comboTheme.Text = themeName;
                }

            }
        }
Example #33
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox3.Items.Clear();
            comboBox3.Text = string.Empty;

            ComboItem selectedCBItem = comboBox1.SelectedItem as ComboItem;
            int selectedItem = selectedCBItem.Id;

            if (selectedItem > -1)
            {
                lfa.pmgmt.data.DAO.Configuration.Unit units = new data.DAO.Configuration.Unit();
                units.ConnectionString = _connectionString;
                List<lfa.pmgmt.data.DTO.Configuration.Unit> unitList = units.List(selectedItem);

                foreach (lfa.pmgmt.data.DTO.Configuration.Unit unitItem in unitList)
                {
                    ComboItem item = new ComboItem();
                    item.Id = unitItem.Id;
                    item.Name = unitItem.Name;

                    comboBox3.Items.Add(item);
                }
            }
        }
Example #34
0
    private void OnComboItemMarked(ComboItem item)
    {
        //Debug.Log("Item: " + item.name + " marked");

        //keep track of last marked
        lastMarked = item;

        //Since ComboItems don't know about each other, we need to handle
        // unmarking any other Combo items a level up, here in the ComboBox
        if(!allowMultiple) {
            foreach(ComboItem comboItem in items) {
                if(comboItem != item && comboItem.marked) {
                    comboItem.UnMark();
                }
            }
        }
    }
        private void PopulateCombos()
        {
            comboBoxAFM.Items.Add("IO#4, Arduino Due A4, ECU AA4, TEMP SENSOR");
            comboBoxAFM.Items.Add("IO#5, Arduino Due A5, ECU AA3, DEFAULT CTS");
            comboBoxAFM.Items.Add("IO#6, Arduino Due A6, ECU AA2, DEFAULT ATS");
            comboBoxAFM.Items.Add("IO#7, Arduino Due A7, ECU AA1, TEMP SENSOR");
            comboBoxAFM.Items.Add("IO#8, Arduino Due A8, ECU BA4, DEFAULT TPS");
            comboBoxAFM.Items.Add("IO#9, Arduino Due A9, ECU BA3, DEFAULT MAP/MAF");
            comboBoxAFM.Items.Add("IO#10, Arduino Due A10, ECU BA2, DO NOT USE DUE");
            comboBoxAFM.Items.Add("IO#11, Arduino Due A11, ECU BA1, NON-TEMP SENSOR");
            comboBoxAFM.Items.Add("IO#103, Disabled");

            foreach (object ComboItem in comboBoxAFM.Items)
            {
                string   szComboString  = ComboItem.ToString();
                string[] szComboStrings = szComboString.Split(',');
                string   szNumber       = szComboStrings[0].Substring(3);
                if (Convert.ToByte(szNumber) == mu8MAFRes)
                {
                    comboBoxAFM.SelectedItem = ComboItem;
                }
            }

            if (comboBoxAFM.SelectedIndex < 0)
            {
                comboBoxAFM.SelectedIndex = comboBoxAFM.Items.Count - 1;
            }

            comboBoxMAP.Items.Add("IO#4, Arduino Due A4, ECU AA4, TEMP SENSOR");
            comboBoxMAP.Items.Add("IO#5, Arduino Due A5, ECU AA3, DEFAULT CTS");
            comboBoxMAP.Items.Add("IO#6, Arduino Due A6, ECU AA2, DEFAULT ATS");
            comboBoxMAP.Items.Add("IO#7, Arduino Due A7, ECU AA1, TEMP SENSOR");
            comboBoxMAP.Items.Add("IO#8, Arduino Due A8, ECU BA4, DEFAULT TPS");
            comboBoxMAP.Items.Add("IO#9, Arduino Due A9, ECU BA3, DEFAULT MAP/MAF");
            comboBoxMAP.Items.Add("IO#10, Arduino Due A10, ECU BA2, DO NOT USE DUE");
            comboBoxMAP.Items.Add("IO#11, Arduino Due A11, ECU BA1, NON-TEMP SENSOR");
            comboBoxMAP.Items.Add("IO#103, Disabled");

            foreach (object ComboItem in comboBoxMAP.Items)
            {
                string   szComboString  = ComboItem.ToString();
                string[] szComboStrings = szComboString.Split(',');
                string   szNumber       = szComboStrings[0].Substring(3);
                if (Convert.ToByte(szNumber) == mu8MAPRes)
                {
                    comboBoxMAP.SelectedItem = ComboItem;
                }
            }

            if (comboBoxMAP.SelectedIndex < 0)
            {
                comboBoxMAP.SelectedIndex = comboBoxMAP.Items.Count - 1;
            }

            comboBoxCTS.Items.Add("IO#4, Arduino Due A4, ECU AA4, TEMP SENSOR");
            comboBoxCTS.Items.Add("IO#5, Arduino Due A5, ECU AA3, DEFAULT CTS");
            comboBoxCTS.Items.Add("IO#6, Arduino Due A6, ECU AA2, DEFAULT ATS");
            comboBoxCTS.Items.Add("IO#7, Arduino Due A7, ECU AA1, TEMP SENSOR");
            comboBoxCTS.Items.Add("IO#8, Arduino Due A8, ECU BA4, DEFAULT TPS");
            comboBoxCTS.Items.Add("IO#9, Arduino Due A9, ECU BA3, DEFAULT MAP/MAF");
            comboBoxCTS.Items.Add("IO#10, Arduino Due A10, ECU BA2, DO NOT USE DUE");
            comboBoxCTS.Items.Add("IO#11, Arduino Due A11, ECU BA1, NON-TEMP SENSOR");
            comboBoxCTS.Items.Add("IO#103, Disabled");

            foreach (object ComboItem in comboBoxCTS.Items)
            {
                string   szComboString  = ComboItem.ToString();
                string[] szComboStrings = szComboString.Split(',');
                string   szNumber       = szComboStrings[0].Substring(3);
                if (Convert.ToByte(szNumber) == mu8CTSRes)
                {
                    comboBoxCTS.SelectedItem = ComboItem;
                }
            }

            if (comboBoxCTS.SelectedIndex < 0)
            {
                comboBoxCTS.SelectedIndex = comboBoxCTS.Items.Count - 1;
            }

            comboBoxATS.Items.Add("IO#4, Arduino Due A4, ECU AA4, TEMP SENSOR");
            comboBoxATS.Items.Add("IO#5, Arduino Due A5, ECU AA3, DEFAULT CTS");
            comboBoxATS.Items.Add("IO#6, Arduino Due A6, ECU AA2, DEFAULT ATS");
            comboBoxATS.Items.Add("IO#7, Arduino Due A7, ECU AA1, TEMP SENSOR");
            comboBoxATS.Items.Add("IO#8, Arduino Due A8, ECU BA4, DEFAULT TPS");
            comboBoxATS.Items.Add("IO#9, Arduino Due A9, ECU BA3, DEFAULT MAP/MAF");
            comboBoxATS.Items.Add("IO#10, Arduino Due A10, ECU BA2, DO NOT USE DUE");
            comboBoxATS.Items.Add("IO#11, Arduino Due A11, ECU BA1, NON-TEMP SENSOR");
            comboBoxATS.Items.Add("IO#103, Disabled");

            foreach (object ComboItem in comboBoxATS.Items)
            {
                string   szComboString  = ComboItem.ToString();
                string[] szComboStrings = szComboString.Split(',');
                string   szNumber       = szComboStrings[0].Substring(3);
                if (Convert.ToByte(szNumber) == mu8ATSRes)
                {
                    comboBoxATS.SelectedItem = ComboItem;
                }
            }

            if (comboBoxATS.SelectedIndex < 0)
            {
                comboBoxATS.SelectedIndex = comboBoxATS.Items.Count - 1;
            }

            comboBoxTPS.Items.Add("IO#4, Arduino Due A4, ECU AA4, TEMP SENSOR");
            comboBoxTPS.Items.Add("IO#5, Arduino Due A5, ECU AA3, DEFAULT CTS");
            comboBoxTPS.Items.Add("IO#6, Arduino Due A6, ECU AA2, DEFAULT ATS");
            comboBoxTPS.Items.Add("IO#7, Arduino Due A7, ECU AA1, TEMP SENSOR");
            comboBoxTPS.Items.Add("IO#8, Arduino Due A8, ECU BA4, DEFAULT TPS");
            comboBoxTPS.Items.Add("IO#9, Arduino Due A9, ECU BA3, DEFAULT MAP/MAF");
            comboBoxTPS.Items.Add("IO#10, Arduino Due A10, ECU BA2, DO NOT USE DUE");
            comboBoxTPS.Items.Add("IO#11, Arduino Due A11, ECU BA1, NON-TEMP SENSOR");
            comboBoxTPS.Items.Add("IO#103, Disabled");

            foreach (object ComboItem in comboBoxTPS.Items)
            {
                string   szComboString  = ComboItem.ToString();
                string[] szComboStrings = szComboString.Split(',');
                string   szNumber       = szComboStrings[0].Substring(3);
                if (Convert.ToByte(szNumber) == mu8TPSRes)
                {
                    comboBoxTPS.SelectedItem = ComboItem;
                }
            }

            if (comboBoxTPS.SelectedIndex < 0)
            {
                comboBoxTPS.SelectedIndex = comboBoxTPS.Items.Count - 1;
            }

            CheckBoxes();

            comboBoxTriggerSensorStrength.Items.Add("Low Noise");
            comboBoxTriggerSensorStrength.Items.Add("Medium Noise");
            comboBoxTriggerSensorStrength.Items.Add("High Noise");

            switch (mu8CrankSensorStrength)
            {
            case 0:
            default:
            {
                comboBoxTriggerSensorStrength.SelectedIndex = 0;
                break;
            }

            case 1:
            {
                comboBoxTriggerSensorStrength.SelectedIndex = 1;
                break;
            }

            case 2:
            {
                comboBoxTriggerSensorStrength.SelectedIndex = 2;
                break;
            }
            }

            comboBoxCamSensorStrength.Items.Add("Low Noise");
            comboBoxCamSensorStrength.Items.Add("Medium Noise");
            comboBoxCamSensorStrength.Items.Add("High Noise");

            switch (mu8CamSensorStrength)
            {
            case 0:
            default:
            {
                comboBoxCamSensorStrength.SelectedIndex = 0;
                break;
            }

            case 1:
            {
                comboBoxCamSensorStrength.SelectedIndex = 1;
                break;
            }

            case 2:
            {
                comboBoxCamSensorStrength.SelectedIndex = 2;
                break;
            }
            }

            comboBoxTriggerSensorType.Items.Add("Hall Effect/Optical");
            comboBoxTriggerSensorType.Items.Add("Magnetic Reluctor");

            switch (mu8CrankSensorType)
            {
            default:
            case 0:
            {
                comboBoxTriggerSensorType.SelectedIndex = 0;
                break;
            }

            case 1:
            {
                comboBoxTriggerSensorType.SelectedIndex = 1;
                break;
            }
            }

            comboBoxSyncSensorType.Items.Add("Hall Effect/Optical");
            comboBoxSyncSensorType.Items.Add("Magnetic Reluctor");

            switch (mu8CamSensorType)
            {
            default:
            case 0:
            {
                comboBoxSyncSensorType.SelectedIndex = 0;
                break;
            }

            case 1:
            {
                comboBoxSyncSensorType.SelectedIndex = 1;
                break;
            }
            }
        }
Example #36
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            try
            {
                using (BikkuInfo bInfo = new BikkuInfo(true))
                {
                    if (ValidateBeforeAdd(bInfo))
                    {
                        bInfo.NIC                  = nicTextBoxX.Text;
                        bInfo.SamaneraNumber       = samaneraNumberTextBoxX.Text;
                        bInfo.PassportNumber       = passportNumbrtTextBoxX.Text;
                        bInfo.PlaceOfBirth         = placeOfBirthtxt.Text;
                        bInfo.LayNameInFull        = layNameinFullTxt.Text;
                        bInfo.DateOfBirth          = dobDtm.Value.Date;
                        bInfo.NameOfFatherInFull   = nameOfFatheinFullTxt.Text;
                        bInfo.DateOfRobing         = dateOfRobingDtm.Value.Date;
                        bInfo.NameAssumedAtRobing  = nameOfAssumedAtRobinTxt.Text;
                        bInfo.NameOfRobingTutor    = nameOfRobingTutorCombo.SelectedValue == null ? 0 : (int)nameOfRobingTutorCombo.SelectedValue;
                        bInfo.TempleRobing         = templaRobingTookCombo.SelectedValue == null ? 0 : (int)templaRobingTookCombo.SelectedValue;
                        bInfo.TempleOfResidence    = templaResidenceCombo.SelectedValue == null ? 0 : (int)templaResidenceCombo.SelectedValue;
                        bInfo.NameOfViharadhipathi = nameOfViharadhipathiCombo.SelectedValue == null ? 0 : (int)nameOfViharadhipathiCombo.SelectedValue;

                        bInfo.IsUpasampanna                  = isUpasampannaCheckBox.Checked;
                        bInfo.PlaceOfHigherOrdination        = upasampannaPlaceComboBoxEx.SelectedValue == null ? 0 : (int)upasampannaPlaceComboBoxEx.SelectedValue;
                        bInfo.DateOfHigherOrdination         = upasampannaDatetp.Value.Date;
                        bInfo.NameOfUpadyaAtHigherOrdination = nameofUpadyaComboBoxEx.SelectedValue == null ? 0 : (int)nameofUpadyaComboBoxEx.SelectedValue;
                        bInfo.IsUpadyaThero                  = isUpadyaCheckBox.Checked;
                        //bInfo.Post = isSangaUpasCheckBox.Checked;
                        bInfo.District    = districtcomboBox.SelectedValue == null ? 0 : (int)districtcomboBox.SelectedValue;
                        bInfo.DateOfCame  = dateofCameDtm.Value; // == new DateTime()
                        bInfo.HomeAddress = homeaddressText.Text;
                        bInfo.HomeTP      = hometpText.Text;

                        if (bloodGroupCombo.SelectedItem != null)
                        {
                            ComboItem item = (ComboItem)bloodGroupCombo.SelectedItem;
                            bInfo.BloodGroup = item.Text;
                        }

                        if (bikkuImage == null)
                        {
                            bInfo.ImageData = string.Empty;
                        }
                        else
                        {
                            bInfo.ImageData = Utility.Get64String(bikkuImage);
                        }

                        if (bhikkuID == 0)
                        {
                            setActivitiesToObject(bInfo);
                            setAsapuHistryToObject(bInfo);
                            setOtherDataToObject(bInfo);

                            if (bInfo.Add() == 1)
                            {
                                MessageView.ShowMsg("Sucessfully Added");

                                //errorProvider1.SetError(idTxt, string.Empty);
                                //errorProvider1.SetError(nameTxt, string.Empty);

                                clear();
                            }
                        }
                        else
                        {
                            bInfo.ID = bhikkuID;

                            if (MessageView.ShowQuestionMsg("Update Current Item") == DialogResult.OK)
                            {
                                // if templae changed, ask for add record to histry
                                if (TempleOfResidenceBeforeChange != bInfo.TempleOfResidence)
                                {
                                    string message = string.Concat("<br/><br/><b>Asapuwa&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;</b>", TempleOfResidenceBeforeChangeName, "\r\n<br/><b>From Date&nbsp;&nbsp;:&nbsp;</b>", histryDatagrid.Rows[histryDatagrid.RowCount - 1].Cells[4].Value, "\r\n<br/><b>To Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;</b>", DateTime.Now.ToString("yyyy-MMM-dd"));
                                    if (MessageView.ShowQuestionMsg("Residence temple has edited, Add histry record? \n\n" + message) == System.Windows.Forms.DialogResult.OK)
                                    {
                                    }
                                }


                                if (bInfo.Update() == 1)
                                {
                                    MessageView.ShowMsg("Sucessfully Updated");

                                    //errorProvider1.SetError(idTxt, string.Empty);
                                    //errorProvider1.SetError(nameTxt, string.Empty);

                                    clear();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageView.ShowErrorMsg(ex.Message);
            }
        }
Example #37
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.groupPanel1  = new DevComponents.DotNetBar.Controls.GroupPanel();
     this.labelX1      = new DevComponents.DotNetBar.LabelX();
     this.linkLabel3   = new System.Windows.Forms.LinkLabel();
     this.radioButton2 = new System.Windows.Forms.RadioButton();
     this.linkLabel2   = new System.Windows.Forms.LinkLabel();
     this.radioButton1 = new System.Windows.Forms.RadioButton();
     this.linkLabel1   = new System.Windows.Forms.LinkLabel();
     this.buttonX1     = new DevComponents.DotNetBar.ButtonX();
     this.buttonX2     = new DevComponents.DotNetBar.ButtonX();
     this.sfd          = new System.Windows.Forms.SaveFileDialog();
     this.ofd          = new System.Windows.Forms.OpenFileDialog();
     this.groupPanel2  = new DevComponents.DotNetBar.Controls.GroupPanel();
     this.checkBoxX1   = new DevComponents.DotNetBar.Controls.CheckBoxX();
     this.labelX4      = new DevComponents.DotNetBar.LabelX();
     this.labelX3      = new DevComponents.DotNetBar.LabelX();
     this.textBoxX2    = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.textBoxX1    = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.comboBoxEx2  = new DevComponents.DotNetBar.Controls.ComboBoxEx();
     this.comboItem4   = new DevComponents.Editors.ComboItem();
     this.comboItem5   = new DevComponents.Editors.ComboItem();
     this.comboBoxEx1  = new DevComponents.DotNetBar.Controls.ComboBoxEx();
     this.comboItem1   = new DevComponents.Editors.ComboItem();
     this.comboItem2   = new DevComponents.Editors.ComboItem();
     this.comboItem3   = new DevComponents.Editors.ComboItem();
     this.comboItem6   = new DevComponents.Editors.ComboItem();
     this.labelX2      = new DevComponents.DotNetBar.LabelX();
     this.labelX5      = new DevComponents.DotNetBar.LabelX();
     this.labelX6      = new DevComponents.DotNetBar.LabelX();
     this.labelX7      = new DevComponents.DotNetBar.LabelX();
     this.txtSYSb      = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.txtSYSa      = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.groupPanel1.SuspendLayout();
     this.groupPanel2.SuspendLayout();
     this.SuspendLayout();
     //
     // groupPanel1
     //
     this.groupPanel1.BackColor        = System.Drawing.Color.Transparent;
     this.groupPanel1.CanvasColor      = System.Drawing.SystemColors.Control;
     this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
     this.groupPanel1.Controls.Add(this.labelX1);
     this.groupPanel1.Controls.Add(this.linkLabel3);
     this.groupPanel1.Controls.Add(this.radioButton2);
     this.groupPanel1.Controls.Add(this.linkLabel2);
     this.groupPanel1.Controls.Add(this.radioButton1);
     this.groupPanel1.Controls.Add(this.linkLabel1);
     this.groupPanel1.Location = new System.Drawing.Point(4, 5);
     this.groupPanel1.Name     = "groupPanel1";
     this.groupPanel1.Size     = new System.Drawing.Size(219, 94);
     //
     //
     //
     this.groupPanel1.Style.BackColor2SchemePart   = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
     this.groupPanel1.Style.BackColorGradientAngle = 90;
     this.groupPanel1.Style.BackColorSchemePart    = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
     this.groupPanel1.Style.BorderBottom           = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel1.Style.BorderBottomWidth      = 1;
     this.groupPanel1.Style.BorderColorSchemePart  = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
     this.groupPanel1.Style.BorderLeft             = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel1.Style.BorderLeftWidth        = 1;
     this.groupPanel1.Style.BorderRight            = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel1.Style.BorderRightWidth       = 1;
     this.groupPanel1.Style.BorderTop           = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel1.Style.BorderTopWidth      = 1;
     this.groupPanel1.Style.Class               = "";
     this.groupPanel1.Style.CornerDiameter      = 4;
     this.groupPanel1.Style.CornerType          = DevComponents.DotNetBar.eCornerType.Rounded;
     this.groupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
     this.groupPanel1.Style.TextLineAlignment   = DevComponents.DotNetBar.eStyleTextAlignment.Near;
     //
     //
     //
     this.groupPanel1.StyleMouseDown.Class      = "";
     this.groupPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     //
     //
     //
     this.groupPanel1.StyleMouseOver.Class      = "";
     this.groupPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.groupPanel1.TabIndex = 0;
     this.groupPanel1.Text     = "範本設定";
     //
     // labelX1
     //
     this.labelX1.AutoSize  = true;
     this.labelX1.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX1.BackgroundStyle.Class      = "";
     this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX1.ForeColor = System.Drawing.Color.Red;
     this.labelX1.Location  = new System.Drawing.Point(163, 35);
     this.labelX1.Name      = "labelX1";
     this.labelX1.Size      = new System.Drawing.Size(20, 21);
     this.labelX1.TabIndex  = 2;
     this.labelX1.Text      = "*";
     this.labelX1.Visible   = false;
     //
     // linkLabel3
     //
     this.linkLabel3.AutoSize     = true;
     this.linkLabel3.BackColor    = System.Drawing.Color.Transparent;
     this.linkLabel3.Location     = new System.Drawing.Point(134, 36);
     this.linkLabel3.Name         = "linkLabel3";
     this.linkLabel3.Size         = new System.Drawing.Size(34, 17);
     this.linkLabel3.TabIndex     = 4;
     this.linkLabel3.TabStop      = true;
     this.linkLabel3.Text         = "上傳";
     this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
     //
     // radioButton2
     //
     this.radioButton2.AutoSize  = true;
     this.radioButton2.BackColor = System.Drawing.Color.Transparent;
     this.radioButton2.Enabled   = false;
     this.radioButton2.Location  = new System.Drawing.Point(26, 38);
     this.radioButton2.Name      = "radioButton2";
     this.radioButton2.Size      = new System.Drawing.Size(14, 13);
     this.radioButton2.TabIndex  = 2;
     this.radioButton2.TabStop   = true;
     this.radioButton2.UseVisualStyleBackColor = false;
     //
     // linkLabel2
     //
     this.linkLabel2.AutoSize     = true;
     this.linkLabel2.BackColor    = System.Drawing.Color.Transparent;
     this.linkLabel2.Enabled      = false;
     this.linkLabel2.Location     = new System.Drawing.Point(45, 36);
     this.linkLabel2.Name         = "linkLabel2";
     this.linkLabel2.Size         = new System.Drawing.Size(86, 17);
     this.linkLabel2.TabIndex     = 3;
     this.linkLabel2.TabStop      = true;
     this.linkLabel2.Text         = "檢視自訂範本";
     this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
     //
     // radioButton1
     //
     this.radioButton1.AutoSize  = true;
     this.radioButton1.BackColor = System.Drawing.Color.Transparent;
     this.radioButton1.Location  = new System.Drawing.Point(26, 13);
     this.radioButton1.Name      = "radioButton1";
     this.radioButton1.Size      = new System.Drawing.Size(14, 13);
     this.radioButton1.TabIndex  = 0;
     this.radioButton1.TabStop   = true;
     this.radioButton1.UseVisualStyleBackColor = false;
     //
     // linkLabel1
     //
     this.linkLabel1.AutoSize     = true;
     this.linkLabel1.BackColor    = System.Drawing.Color.Transparent;
     this.linkLabel1.Location     = new System.Drawing.Point(45, 11);
     this.linkLabel1.Name         = "linkLabel1";
     this.linkLabel1.Size         = new System.Drawing.Size(86, 17);
     this.linkLabel1.TabIndex     = 1;
     this.linkLabel1.TabStop      = true;
     this.linkLabel1.Text         = "檢視預設範本";
     this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
     //
     // buttonX1
     //
     this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
     this.buttonX1.BackColor      = System.Drawing.Color.Transparent;
     this.buttonX1.ColorTable     = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
     this.buttonX1.DialogResult   = System.Windows.Forms.DialogResult.OK;
     this.buttonX1.Location       = new System.Drawing.Point(86, 371);
     this.buttonX1.Name           = "buttonX1";
     this.buttonX1.Size           = new System.Drawing.Size(65, 23);
     this.buttonX1.TabIndex       = 10;
     this.buttonX1.Text           = "儲存設定";
     this.buttonX1.Click         += new System.EventHandler(this.buttonX1_Click);
     //
     // buttonX2
     //
     this.buttonX2.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
     this.buttonX2.BackColor      = System.Drawing.Color.Transparent;
     this.buttonX2.ColorTable     = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
     this.buttonX2.Location       = new System.Drawing.Point(157, 371);
     this.buttonX2.Name           = "buttonX2";
     this.buttonX2.Size           = new System.Drawing.Size(65, 23);
     this.buttonX2.TabIndex       = 11;
     this.buttonX2.Text           = "取消";
     this.buttonX2.Click         += new System.EventHandler(this.buttonX2_Click);
     //
     // sfd
     //
     this.sfd.FileName = "學年成績單範本";
     this.sfd.Filter   = "Word檔案 (*.doc)|*.doc|所有檔案 (*.*)|*.*";
     this.sfd.Title    = "另存新檔";
     //
     // ofd
     //
     this.ofd.Filter = "Word檔案 (*.doc)|*.doc";
     this.ofd.Title  = "選擇自訂的學年成績單範本";
     //
     // groupPanel2
     //
     this.groupPanel2.BackColor        = System.Drawing.Color.Transparent;
     this.groupPanel2.CanvasColor      = System.Drawing.SystemColors.Control;
     this.groupPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
     this.groupPanel2.Controls.Add(this.labelX6);
     this.groupPanel2.Controls.Add(this.labelX7);
     this.groupPanel2.Controls.Add(this.txtSYSb);
     this.groupPanel2.Controls.Add(this.txtSYSa);
     this.groupPanel2.Controls.Add(this.checkBoxX1);
     this.groupPanel2.Controls.Add(this.labelX4);
     this.groupPanel2.Controls.Add(this.labelX3);
     this.groupPanel2.Controls.Add(this.textBoxX2);
     this.groupPanel2.Controls.Add(this.textBoxX1);
     this.groupPanel2.Controls.Add(this.comboBoxEx2);
     this.groupPanel2.Controls.Add(this.comboBoxEx1);
     this.groupPanel2.Controls.Add(this.labelX2);
     this.groupPanel2.Controls.Add(this.labelX5);
     this.groupPanel2.Location = new System.Drawing.Point(4, 102);
     this.groupPanel2.Margin   = new System.Windows.Forms.Padding(4);
     this.groupPanel2.Name     = "groupPanel2";
     this.groupPanel2.Size     = new System.Drawing.Size(219, 256);
     //
     //
     //
     this.groupPanel2.Style.BackColor2SchemePart   = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
     this.groupPanel2.Style.BackColorGradientAngle = 90;
     this.groupPanel2.Style.BackColorSchemePart    = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
     this.groupPanel2.Style.BorderBottom           = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel2.Style.BorderBottomWidth      = 1;
     this.groupPanel2.Style.BorderColorSchemePart  = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
     this.groupPanel2.Style.BorderLeft             = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel2.Style.BorderLeftWidth        = 1;
     this.groupPanel2.Style.BorderRight            = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel2.Style.BorderRightWidth       = 1;
     this.groupPanel2.Style.BorderTop           = DevComponents.DotNetBar.eStyleBorderType.Solid;
     this.groupPanel2.Style.BorderTopWidth      = 1;
     this.groupPanel2.Style.Class               = "";
     this.groupPanel2.Style.CornerDiameter      = 4;
     this.groupPanel2.Style.CornerType          = DevComponents.DotNetBar.eCornerType.Rounded;
     this.groupPanel2.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
     this.groupPanel2.Style.TextLineAlignment   = DevComponents.DotNetBar.eStyleTextAlignment.Near;
     //
     //
     //
     this.groupPanel2.StyleMouseDown.Class      = "";
     this.groupPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     //
     //
     //
     this.groupPanel2.StyleMouseOver.Class      = "";
     this.groupPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.groupPanel2.TabIndex = 2;
     this.groupPanel2.Text     = "列印設定";
     //
     // checkBoxX1
     //
     this.checkBoxX1.AutoSize  = true;
     this.checkBoxX1.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.checkBoxX1.BackgroundStyle.Class      = "";
     this.checkBoxX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.checkBoxX1.Location = new System.Drawing.Point(12, 196);
     this.checkBoxX1.Name     = "checkBoxX1";
     this.checkBoxX1.Size     = new System.Drawing.Size(161, 21);
     this.checkBoxX1.TabIndex = 9;
     this.checkBoxX1.Text     = "德行成績顯示允許破百";
     //
     // labelX4
     //
     this.labelX4.AutoSize  = true;
     this.labelX4.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX4.BackgroundStyle.Class      = "";
     this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX4.Location = new System.Drawing.Point(12, 104);
     this.labelX4.Name     = "labelX4";
     this.labelX4.Size     = new System.Drawing.Size(114, 21);
     this.labelX4.TabIndex = 4;
     this.labelX4.Text     = "需要重修科目標示";
     //
     // labelX3
     //
     this.labelX3.AutoSize  = true;
     this.labelX3.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX3.BackgroundStyle.Class      = "";
     this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX3.Location = new System.Drawing.Point(12, 73);
     this.labelX3.Name     = "labelX3";
     this.labelX3.Size     = new System.Drawing.Size(114, 21);
     this.labelX3.TabIndex = 4;
     this.labelX3.Text     = "需要補考科目標示";
     //
     // textBoxX2
     //
     //
     //
     //
     this.textBoxX2.Border.Class      = "TextBoxBorder";
     this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.textBoxX2.Location          = new System.Drawing.Point(127, 101);
     this.textBoxX2.Name     = "textBoxX2";
     this.textBoxX2.Size     = new System.Drawing.Size(70, 25);
     this.textBoxX2.TabIndex = 8;
     //
     // textBoxX1
     //
     //
     //
     //
     this.textBoxX1.Border.Class      = "TextBoxBorder";
     this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.textBoxX1.Location          = new System.Drawing.Point(127, 70);
     this.textBoxX1.Name     = "textBoxX1";
     this.textBoxX1.Size     = new System.Drawing.Size(70, 25);
     this.textBoxX1.TabIndex = 7;
     //
     // comboBoxEx2
     //
     this.comboBoxEx2.DisplayMember     = "Text";
     this.comboBoxEx2.DrawMode          = System.Windows.Forms.DrawMode.OwnerDrawFixed;
     this.comboBoxEx2.FormattingEnabled = true;
     this.comboBoxEx2.ItemHeight        = 19;
     this.comboBoxEx2.Items.AddRange(new object[] {
         this.comboItem4,
         this.comboItem5
     });
     this.comboBoxEx2.Location = new System.Drawing.Point(86, 35);
     this.comboBoxEx2.Name     = "comboBoxEx2";
     this.comboBoxEx2.Size     = new System.Drawing.Size(100, 25);
     this.comboBoxEx2.TabIndex = 6;
     //
     // comboItem4
     //
     this.comboItem4.Text = "戶籍地址";
     //
     // comboItem5
     //
     this.comboItem5.Text = "聯絡地址";
     //
     // comboBoxEx1
     //
     this.comboBoxEx1.DisplayMember     = "Text";
     this.comboBoxEx1.DrawMode          = System.Windows.Forms.DrawMode.OwnerDrawFixed;
     this.comboBoxEx1.FormattingEnabled = true;
     this.comboBoxEx1.ItemHeight        = 19;
     this.comboBoxEx1.Items.AddRange(new object[] {
         this.comboItem1,
         this.comboItem2,
         this.comboItem3,
         this.comboItem6
     });
     this.comboBoxEx1.Location = new System.Drawing.Point(86, 3);
     this.comboBoxEx1.Name     = "comboBoxEx1";
     this.comboBoxEx1.Size     = new System.Drawing.Size(100, 25);
     this.comboBoxEx1.TabIndex = 5;
     //
     // comboItem1
     //
     this.comboItem1.Text = "監護人";
     //
     // comboItem2
     //
     this.comboItem2.Text = "父親";
     //
     // comboItem3
     //
     this.comboItem3.Text = "母親";
     //
     // comboItem6
     //
     this.comboItem6.Text = "學生";
     //
     // labelX2
     //
     this.labelX2.AutoSize  = true;
     this.labelX2.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX2.BackgroundStyle.Class      = "";
     this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX2.Location = new System.Drawing.Point(12, 39);
     this.labelX2.Name     = "labelX2";
     this.labelX2.Size     = new System.Drawing.Size(74, 21);
     this.labelX2.TabIndex = 0;
     this.labelX2.Text     = "收件人地址";
     //
     // labelX5
     //
     this.labelX5.AutoSize  = true;
     this.labelX5.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX5.BackgroundStyle.Class      = "";
     this.labelX5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX5.Location = new System.Drawing.Point(12, 7);
     this.labelX5.Name     = "labelX5";
     this.labelX5.Size     = new System.Drawing.Size(47, 21);
     this.labelX5.TabIndex = 0;
     this.labelX5.Text     = "收件人";
     //
     // labelX6
     //
     this.labelX6.AutoSize  = true;
     this.labelX6.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX6.BackgroundStyle.Class      = "";
     this.labelX6.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX6.Location = new System.Drawing.Point(12, 165);
     this.labelX6.Name     = "labelX6";
     this.labelX6.Size     = new System.Drawing.Size(114, 21);
     this.labelX6.TabIndex = 10;
     this.labelX6.Text     = "學年重修成績標示";
     //
     // labelX7
     //
     this.labelX7.AutoSize  = true;
     this.labelX7.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX7.BackgroundStyle.Class      = "";
     this.labelX7.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX7.Location = new System.Drawing.Point(12, 134);
     this.labelX7.Name     = "labelX7";
     this.labelX7.Size     = new System.Drawing.Size(114, 21);
     this.labelX7.TabIndex = 11;
     this.labelX7.Text     = "學年補考成績標示";
     //
     // txtSYSb
     //
     //
     //
     //
     this.txtSYSb.Border.Class      = "TextBoxBorder";
     this.txtSYSb.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.txtSYSb.Location          = new System.Drawing.Point(127, 162);
     this.txtSYSb.Name     = "txtSYSb";
     this.txtSYSb.Size     = new System.Drawing.Size(70, 25);
     this.txtSYSb.TabIndex = 13;
     //
     // txtSYSa
     //
     //
     //
     //
     this.txtSYSa.Border.Class      = "TextBoxBorder";
     this.txtSYSa.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.txtSYSa.Location          = new System.Drawing.Point(127, 131);
     this.txtSYSa.Name     = "txtSYSa";
     this.txtSYSa.Size     = new System.Drawing.Size(70, 25);
     this.txtSYSa.TabIndex = 12;
     //
     // ConfigForm
     //
     this.ClientSize = new System.Drawing.Size(227, 399);
     this.Controls.Add(this.groupPanel2);
     this.Controls.Add(this.buttonX2);
     this.Controls.Add(this.buttonX1);
     this.Controls.Add(this.groupPanel1);
     this.DoubleBuffered = true;
     this.Name           = "ConfigForm";
     this.StartPosition  = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text           = "變更設定";
     this.Load          += new System.EventHandler(this.ConfigForm_Load);
     this.groupPanel1.ResumeLayout(false);
     this.groupPanel1.PerformLayout();
     this.groupPanel2.ResumeLayout(false);
     this.groupPanel2.PerformLayout();
     this.ResumeLayout(false);
 }
Example #38
0
        private void BindZonesComboBox()
        {
            List<lfa.pmgmt.data.DTO.Configuration.Zone> zones = new List<data.DTO.Configuration.Zone>();

            lfa.pmgmt.data.DAO.Configuration.Zone zoneDAO = new data.DAO.Configuration.Zone();
            zoneDAO.ConnectionString = _connectionString;

            zones = zoneDAO.List();

            foreach (lfa.pmgmt.data.DTO.Configuration.Zone zone in zones)
            {
                ComboItem item = new ComboItem();
                item.Id = zone.Id;
                item.Name = zone.Name;

                comboBox1.Items.Add(item);
            }
        }
Example #39
0
 private void CalboxChanged(ComboItem item)
 {
     _curentCalbox = new Device(item.View, item.Value.ToString());
 }
Example #40
0
        private void Frm_AddNew_Unit_Load_1(object sender, EventArgs e)
        {
            _connectionString = GetConnectionString();

            lfa.pmgmt.data.DAO.Configuration.Zone DAO = new lfa.pmgmt.data.DAO.Configuration.Zone();
            DAO.ConnectionString = _connectionString;

            List<lfa.pmgmt.data.DTO.Configuration.Zone> List = DAO.List();

            ComboItem blank = new ComboItem();
            blank.Id = -1;
            blank.Name = string.Empty;

            comboBox1.Items.Add(blank);

            foreach (lfa.pmgmt.data.DTO.Configuration.Zone zone in List)
            {
                ComboItem item = new ComboItem();
                item.Id = zone.Id;
                item.Name = zone.Name;

                comboBox1.Items.Add(item);
            }

            comboBox2.Items.Add("On");
            comboBox2.Items.Add("Off");
        }
Example #41
0
        private void departmentComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboItem itm = (ComboItem)departmentComboBox.SelectedItem;

            populateEmployeesDropdown(itm.ID);
        }