Ejemplo n.º 1
0
        /// <summary>
        /// 1: None
        /// 2: Text Colour
        /// 3: Border
        /// 4: Translucent
        /// 5: Light Box
        /// </summary>
        /// <param name="olv"></param>
        /// <param name="vStyle"></param>
        internal static void ChangeHotItemStyle(ObjectListView olv, HotItemStyleNum vStyle)
        {
            olv.UseTranslucentHotItem = false;
            olv.UseHotItem            = true;
            olv.UseExplorerTheme      = false;

            switch (vStyle)
            {
            case HotItemStyleNum.TurnOff:    // 0:
                olv.UseHotItem = false;
                break;

            case HotItemStyleNum.None:
                HotItemStyle hotItemStyle = new HotItemStyle
                {
                    ForeColor = Color.AliceBlue,
                    BackColor = Color.FromArgb(255, 64, 64, 64)
                };
                olv.HotItemStyle = hotItemStyle;
                break;

            case HotItemStyleNum.TextColour:
                RowBorderDecoration rbd = new RowBorderDecoration
                {
                    BorderPen      = new Pen(Color.SeaGreen, 2),
                    FillBrush      = null,
                    CornerRounding = 4.0f
                };
                HotItemStyle hotItemStyle2 = new HotItemStyle
                {
                    Decoration = rbd
                };
                olv.HotItemStyle = hotItemStyle2;
                break;

            case HotItemStyleNum.Border:
                olv.UseTranslucentHotItem = true;
                break;

            case HotItemStyleNum.Translucent:
                HotItemStyle hotItemStyle3 = new HotItemStyle
                {
                    Decoration = new LightBoxDecoration()
                };
                olv.HotItemStyle = hotItemStyle3;
                break;

            case HotItemStyleNum.LightBox:
                olv.FullRowSelect    = true;
                olv.UseHotItem       = false;
                olv.UseExplorerTheme = true;
                break;
            }
            olv.Invalidate();
        }
Ejemplo n.º 2
0
        public void ChangeHotItemStyle(ObjectListView olv, ComboBox cb)
        {
            olv.UseTranslucentHotItem = false;
            olv.UseHotItem            = true;
            olv.UseExplorerTheme      = false;

            switch (cb.SelectedIndex)
            {
            case 0:
                olv.UseHotItem = false;
                break;

            case 1:
                HotItemStyle hotItemStyle = new HotItemStyle
                {
                    ForeColor = Color.AliceBlue,
                    BackColor = Color.FromArgb(255, 64, 64, 64)
                };
                olv.HotItemStyle = hotItemStyle;
                break;

            case 2:
                RowBorderDecoration rbd = new RowBorderDecoration
                {
                    BorderPen      = new Pen(Color.SeaGreen, 2),
                    FillBrush      = null,
                    CornerRounding = 4.0f
                };
                HotItemStyle hotItemStyle2 = new HotItemStyle
                {
                    Decoration = rbd
                };
                olv.HotItemStyle = hotItemStyle2;
                break;

            case 3:
                olv.UseTranslucentHotItem = true;
                break;

            case 4:
                HotItemStyle hotItemStyle3 = new HotItemStyle
                {
                    Decoration = new LightBoxDecoration()
                };
                olv.HotItemStyle = hotItemStyle3;
                break;

            case 5:
                olv.FullRowSelect    = true;
                olv.UseHotItem       = false;
                olv.UseExplorerTheme = true;
                break;
            }
            olv.Invalidate();
        }
Ejemplo n.º 3
0
        private void InitializeHotStyle()
        {
            HotItemStyle        nHotItemStyle = new HotItemStyle();
            RowBorderDecoration rbd           = new RowBorderDecoration();

            rbd.BorderPen                     = new Pen(Color.LightBlue, 2);
            rbd.FillBrush                     = null;
            rbd.CornerRounding                = 16.0f;
            nHotItemStyle.Decoration          = rbd;
            this.objectListView1.HotItemStyle = nHotItemStyle;
        }
Ejemplo n.º 4
0
        private void InitUIControl()
        {
            //materialSingleLineTextField_ThreadNum.Text = Convert.ToString(Environment.ProcessorCount * 4);

            comboBox_SelectTaskGroup.Items.Clear();
            List <string> taskGroupNameList = GlobalVar.Instance.taskGroupManager.TaskGroupNameList();

            foreach (var name in taskGroupNameList)
            {
                comboBox_SelectTaskGroup.Items.Add(name);
            }
            //if(comboBox_SelectTaskGroup.Items.Count >= 1)
            //{
            //    comboBox_SelectTaskGroup.SelectedIndex = 0;
            //}

            comboBox_UA.Items.Clear();
            List <string> uaTypeList = GlobalVar.Instance.uaList.uaTypeList;

            foreach (var name in uaTypeList)
            {
                comboBox_UA.Items.Add(name);
            }
            //if (comboBox_UA.Items.Count >= 1)
            //{
            //    comboBox_UA.SelectedIndex = 0;
            //}
            GlobalVar.Instance.logger.Debug($"加载UA成功 [{GlobalVar.Instance.uaList.Count()}] 个");


            fastObjectListView_main.UseTranslucentHotItem = false;
            fastObjectListView_main.UseHotItem            = true;
            fastObjectListView_main.FullRowSelect         = true;
            fastObjectListView_main.UseExplorerTheme      = false;

            RowBorderDecoration rbd = new RowBorderDecoration();

            rbd.BorderPen      = new Pen(Color.Purple, 2);
            rbd.FillBrush      = null;
            rbd.CornerRounding = 4.0f;
            HotItemStyle hotItemStyle = new HotItemStyle();

            hotItemStyle.Decoration = rbd;
            fastObjectListView_main.HotItemStyle             = hotItemStyle;
            fastObjectListView_main.View                     = View.Details;
            fastObjectListView_main.OwnerDraw                = true;
            fastObjectListView_main.UseAlternatingBackColors = true;
            fastObjectListView_main.CheckBoxes               = false;
            fastObjectListView_main.TriStateCheckBoxes       = false;
            fastObjectListView_main.Invalidate();

            timer_Main.Enabled = true;
        }
Ejemplo n.º 5
0
        public void ChangeHotItemStyle(ObjectListView olv, int index)
        {
            olv.UseTranslucentHotItem = false;
            olv.UseHotItem            = true;
            olv.UseExplorerTheme      = false;

            switch (index)
            {
            case 0:
                olv.UseHotItem = false;
                break;

            case 1:
                HotItemStyle hotItemStyle = new HotItemStyle();
                hotItemStyle.ForeColor = Color.AliceBlue;
                hotItemStyle.BackColor = Color.FromArgb(255, 64, 64, 64);
                olv.HotItemStyle       = hotItemStyle;
                break;

            case 2:
                RowBorderDecoration rbd = new RowBorderDecoration();
                rbd.BorderPen      = new Pen(Color.SeaGreen, 2);
                rbd.FillBrush      = null;
                rbd.CornerRounding = 4.0f;
                HotItemStyle hotItemStyle2 = new HotItemStyle();
                hotItemStyle2.Decoration = rbd;
                olv.HotItemStyle         = hotItemStyle2;
                break;

            case 3:
                olv.UseTranslucentHotItem = true;
                break;

            case 4:
                HotItemStyle hotItemStyle3 = new HotItemStyle();
                hotItemStyle3.Decoration = new LightBoxDecoration();
                olv.HotItemStyle         = hotItemStyle3;
                break;

            case 5:
                olv.FullRowSelect    = true;
                olv.UseHotItem       = false;
                olv.UseExplorerTheme = true;
                break;
            }
            olv.Invalidate();
        }
Ejemplo n.º 6
0
        public static void SetHotItemStyle(ObjectListView listView, OLVHotItemStyle style)
        {
            listView.UseTranslucentHotItem = false;
            listView.UseHotItem            = true;
            listView.UseExplorerTheme      = false;

            switch ((int)style)
            {
            case 0:
                listView.UseHotItem = false;
                break;

            case 1:
                HotItemStyle hotItemStyle = new HotItemStyle();
                hotItemStyle.ForeColor = Color.AliceBlue;
                hotItemStyle.BackColor = Color.FromArgb(255, 64, 64, 64);
                listView.HotItemStyle  = hotItemStyle;
                break;

            case 2:
                RowBorderDecoration rbd = new RowBorderDecoration();
                rbd.BorderPen      = new Pen(Color.SeaGreen, 2);
                rbd.FillBrush      = null;
                rbd.CornerRounding = 4.0f;
                HotItemStyle hotItemStyle2 = new HotItemStyle();
                hotItemStyle2.Decoration = rbd;
                listView.HotItemStyle    = hotItemStyle2;
                break;

            case 3:
                listView.UseTranslucentHotItem = true;
                break;

            case 4:
                HotItemStyle hotItemStyle3 = new HotItemStyle();
                hotItemStyle3.Decoration = new LightBoxDecoration();
                listView.HotItemStyle    = hotItemStyle3;
                break;

            case 5:
                listView.FullRowSelect    = true;
                listView.UseHotItem       = false;
                listView.UseExplorerTheme = true;
                break;
            }
            listView.Invalidate();
        }
Ejemplo n.º 7
0
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            fastObjectListView1.UseTranslucentHotItem = false;
            fastObjectListView1.UseHotItem            = true;
            fastObjectListView1.FullRowSelect         = true;
            fastObjectListView1.UseExplorerTheme      = false;

            switch (comboBox3.SelectedIndex)
            {
            case 0:
                fastObjectListView1.UseHotItem = false;
                break;

            case 1:
                HotItemStyle hotItemStyle = new HotItemStyle();
                hotItemStyle.ForeColor           = Color.AliceBlue;
                hotItemStyle.BackColor           = Color.FromArgb(255, 64, 64, 64);
                fastObjectListView1.HotItemStyle = hotItemStyle;
                break;

            case 2:
                RowBorderDecoration rbd = new RowBorderDecoration();
                rbd.BorderPen      = new Pen(Color.Purple, 2);
                rbd.FillBrush      = null;
                rbd.CornerRounding = 4.0f;
                HotItemStyle hotItemStyle2 = new HotItemStyle();
                hotItemStyle2.Decoration         = rbd;
                fastObjectListView1.HotItemStyle = hotItemStyle2;
                break;

            case 3:
                HotItemStyle hotItemStyle3 = new HotItemStyle();
                hotItemStyle3.Decoration         = new LightBoxDecoration();
                fastObjectListView1.HotItemStyle = hotItemStyle3;
                break;

            default:
                fastObjectListView1.UseHotItem = true;
                break;
            }
            fastObjectListView1.Invalidate();
        }
Ejemplo n.º 8
0
        public MasterMDI(GlobalEnums.NmvnTaskID nmvnTaskID, Form loadedView, bool isMainView)
        {
            InitializeComponent();

            try
            {
                this.nmvnTaskID = nmvnTaskID;
                IModuleAPIRepository moduleAPIRepository = CommonNinject.Kernel.Get <IModuleAPIRepository>();
                this.moduleAPIs = new ModuleAPIs(moduleAPIRepository);

                if (GlobalEnums.NMVNOnly)
                {
                    this.panelTopRight.Visible = false;
                }

                switch (this.nmvnTaskID)
                {
                case GlobalEnums.NmvnTaskID.SmartCoding:
                    this.buttonEscape.Visible              = false;
                    this.buttonLoading.Visible             = false;
                    this.buttonNew.Visible                 = false;
                    this.buttonEdit.Visible                = false;
                    this.buttonSave.Visible                = false;
                    this.buttonDelete.Visible              = false;
                    this.buttonImport.Visible              = false;
                    this.buttonExport.Visible              = false;
                    this.toolStripSeparatorImport.Visible  = false;
                    this.buttonApprove.Visible             = false;
                    this.buttonVoid.Visible                = false;
                    this.toolStripSeparatorApprove.Visible = false;
                    this.toolStripSeparatorVoid.Visible    = false;
                    this.buttonPrint.Visible               = false;
                    this.buttonPrintPreview.Visible        = false;
                    this.toolStripSeparatorPrint.Visible   = false;
                    this.separatorInputData.Visible        = false;
                    this.labelSearchBarcode.Visible        = false;
                    this.toolStripTopHead.Visible          = false;
                    break;

                case GlobalEnums.NmvnTaskID.Batch:
                    this.Size            = new Size(1180, 732);
                    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
                    this.MinimizeBox     = false; this.MaximizeBox = false; this.WindowState = FormWindowState.Normal;

                    this.panelTopRight.Visible = false;
                    this.panelTopLeft.Dock     = DockStyle.Fill;
                    break;

                case GlobalEnums.NmvnTaskID.FillingLine:
                    this.Size            = new Size(620, 360);
                    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
                    this.MinimizeBox     = false; this.MaximizeBox = false; this.WindowState = FormWindowState.Normal;

                    this.toolStripTopHead.Visible = false;
                    this.panelTopRight.Visible    = false;
                    this.panelTopLeft.Dock        = DockStyle.Fill;
                    this.statusStrip.Visible      = false;
                    break;

                default:
                    break;
                }

                this.beginingDateBinding = this.dateTimexLowerFillterDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.LowerFillterDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.endingDateBinding   = this.dateTimexUpperFillterDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.UpperFillterDate), true, DataSourceUpdateMode.OnPropertyChanged);

                this.beginingDateBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.endingDateBinding.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.buttonNaviBarHeaderVisibleBinding         = this.buttonNaviBarHeader.DataBindings.Add("Visible", this.naviBarModuleMaster, "Collapsed", true, DataSourceUpdateMode.OnPropertyChanged);
                this.buttonNaviBarHeaderVisibleBinding.Parse  += new ConvertEventHandler(buttonNaviBarHeaderVisibleBinding_Parse);
                this.buttonNaviBarHeaderVisibleBinding.Format += new ConvertEventHandler(buttonNaviBarHeaderVisibleBinding_Format);

                #region fastNMVNTask
                this.fastNMVNTask.AboutToCreateGroups += fastNMVNTask_AboutToCreateGroups;
                this.fastNMVNTask.ShowGroups           = true;

                //this.fastNMVNTask.UseTranslucentHotItem = true; //DEFAULT HotItem
                fastNMVNTask.UseTranslucentHotItem = false;
                fastNMVNTask.UseHotItem            = true;
                fastNMVNTask.UseExplorerTheme      = false;

                RowBorderDecoration rbd = new RowBorderDecoration();
                rbd.BorderPen      = new Pen(Color.SeaGreen, 2);
                rbd.FillBrush      = null;
                rbd.CornerRounding = 4.0f;
                HotItemStyle hotItemStyle2 = new HotItemStyle();
                hotItemStyle2.Decoration  = rbd;
                fastNMVNTask.HotItemStyle = hotItemStyle2;
                #endregion fastNMVNTask


                if (loadedView != null)
                {
                    this.naviBarModuleMaster.Visible = false;
                    this.OpenView(loadedView);
                }
                else
                {
                    this.InitializeModuleMaster();
                    //this.buttonNaviBarHeader_Click(this.buttonNaviBarHeader, new EventArgs());
                }

                DateTime buildDate = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
                this.statusVersion.Text        = "Version 1.0." + GlobalVariables.ConfigVersionID(GlobalVariables.ConfigID).ToString() + ", Date: " + buildDate.ToString("dd/MM/yyyy HH:mm:ss");
                this.labelDataSource.Text      = this.moduleAPIs.DataSource;
                this.labelApplicationRole.Text = ApplicationRoles.Required && ApplicationRoles.Name != "" && ApplicationRoles.ExceptionMessage == "" ? "[Application Role]" : "[Windows Authentication]";

                this.comboSearchBarcode.Text       = this.searchPlaceHolder;
                this.toolUserReferences.Visible    = ContextAttributes.User.IsDatabaseAdmin && false; //HIDE AT CHEVRON
                this.toolUserGroupControls.Visible = ContextAttributes.User.IsDatabaseAdmin;
                this.statusUserDescription.Text    = ContextAttributes.User.FullyQualifiedUserName;

                this.panelTopRight.Width = (this.nmvnTaskID == GlobalEnums.NmvnTaskID.SmartCoding ? 10 : this.labelSearchBarcode.Width) + this.comboSearchBarcode.Width + this.buttonSearchBarcode.Width + 10;
                this.panelTop.Height     = this.nmvnTaskID == GlobalEnums.NmvnTaskID.SmartCoding ? 61 : 39;

                #region JUST DISABLE FOR CHEVRON
                int?accessLevel = moduleAPIRepository.TotalSmartCodingEntities.GetAccessLevel(ContextAttributes.User.UserID, (int)TotalBase.Enums.GlobalEnums.NmvnTaskID.MonthEnd, 0).Single();
                if (accessLevel < (int)TotalBase.Enums.GlobalEnums.AccessLevel.Readable)
                {
                    this.buttonLockedDate.Enabled = false;
                }

                this.txtLockedDate.Visible = false;
                //this.buttonLockedDate.Visible = false;
                #endregion

                this.isMainView = isMainView;
                if (this.isMainView)
                {
                    this.AddEventLogs("Log on application");
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
        public SkillListView()
        {
            // forms settings
            Dock = System.Windows.Forms.DockStyle.Fill;

            // my settings
            m_ToolTip = new SkillToolTip(this);
            Options.RegisterEvent(Options.EVENT.OPTIONS_SHOWLISTGROUPS.ToString(), delegate(object x) { this.ShowGroups = Options.ShowListGroups; });
            Options.RegisterEvent(Data.EVENT.DATA_LEARNSKILL.ToString(),
                                  delegate(object x)
            {
                if (this.SelectedItem != null)
                {
                    List <Skill> list = x as List <Skill>;
                    foreach (var sk in list)
                    {
                        if (this.SelectedItem.RowObject == sk)
                        {
                            // unselect
                            this.SelectedItem = null;
                            break;     // done obv only 1 thing can be selected (by our settings on the OLV)
                        }
                    }
                }
                UpdateFilter();
            });

            m_decorRowRed.BorderPen      = UITools.Pen_Red;
            m_decorRowRed.BoundsPadding  = new Size(1, 1);
            m_decorRowRed.CornerRounding = 4.0f;
            m_decorRowRed.FillBrush      = new SolidBrush(Color.FromArgb(32, UITools.Red));
            Constant = false; // can change skills by default thru this listview

            // olv settings
            this.AutoGenerateColumns           = false;
            this.ShowGroups                    = true;
            this.SortGroupItemsByPrimaryColumn = false;
            this.ModelFilter                   = new ModelFilter(Delegate_Filter);
            this.UseFiltering                  = true;
            this.ShowGroups                    = Options.ShowListGroups;
            this.GroupingStrategy              = new SkillListGroupingStrategy(m_pSortProperties);
            this.ModelCanDrop                 += SkillListView_OnModelCanDrop;
            SimpleDropSink sink1 = (SimpleDropSink)DropSink;

            sink1.CanDropOnItem        = false;
            sink1.CanDropOnBackground  = true;
            SmallImageList             = UITools.SmallIconImageList;
            GroupImageList             = UITools.ClasstagsImageList;
            ShowFilterMenuOnRightClick = false;
            FullRowSelect = true;
            SelectColumnsOnRightClickBehaviour = ColumnSelectBehaviour.None;
            MultiSelect = false;
            // hot item selection
            RowBorderDecoration rbd = new RowBorderDecoration();

            rbd.BorderPen      = new Pen(Color.Black, 2);
            rbd.BoundsPadding  = new Size(1, 1);
            rbd.CornerRounding = 4.0f;
            rbd.FillBrush      = new SolidBrush(Color.FromArgb(64, 128, 128, 128));
            // Put the decoration onto the hot item
            HotItemStyle            = new HotItemStyle();
            HotItemStyle.Decoration = rbd;
            this.UseHotItem         = true;
            this.ClearHotItem(); // cuz it defaults to the first item for some reason without any mouse doing
            this.HideSelection     = false;
            this.MouseMove        += SkillListView_OnMouseMove;
            this.MouseLeave       += SkillListView_OnMouseLeave;
            FormatRow             += SkillListView_OnFormatRow;
            BeforeCreatingGroups  += SkillListView_OnBeforeCreatingGroups;
            AboutToCreateGroups   += SkillListView_OnAboutToCreateGroups;
            this.MouseClick       += SkillListView_OnMouseClick;
            this.MouseDoubleClick += SkillListView_OnMouseDoubleClick;

            // columns
            List <ColumnSetting> vColumns = new List <ColumnSetting>();

            vColumns.Add(new ColumnSetting("Name", "Name", 200));
            vColumns.Add(new ColumnSetting("Class", "Class", 80));
            vColumns.Add(new ColumnSetting("Spec", "Spec", 100));
            vColumns.Add(new ColumnSetting("RequiredLevel", "Req. Level", 90));
            vColumns.Add(new ColumnSetting("AECost", "AE", 50));
            vColumns.Add(new ColumnSetting("TECost", "TE", 50));

            foreach (var col in vColumns)
            {
                OLVColumn olvCol = GenerateColumn();
                //olvCol.AspectName = col.m_szAspectName;
                // aspectgetter way faster (doesnt use reflection for property names)
                switch (col.m_szAspectName)
                {
                case "Name":
                    // do our sortprops copy
                    m_pSortProperties.SortColumn = olvCol;
                    // init the real one to sync it
                    this.PrimarySortColumn   = olvCol;
                    this.PrimarySortOrder    = SortOrder.Ascending;
                    this.SecondarySortColumn = olvCol;
                    this.SecondarySortOrder  = SortOrder.Ascending;
                    olvCol.HeaderImageKey    = "letter";
                    olvCol.AspectGetter      = delegate(object sk) { return((sk as Skill).Name); };
                    olvCol.ImageGetter       = delegate(object sk) {
                        return((sk as Skill).IconAsString);
                    };
                    break;

                case "Class":
                    olvCol.HeaderImageKey = "warrior";
                    olvCol.AspectGetter   = delegate(object sk) { return((sk as Skill).Class); };
                    olvCol.ImageGetter    = delegate(object sk) { return((sk as Skill).Class); };
                    break;

                case "Spec":
                    olvCol.HeaderImageKey = "ability_marksmanship";
                    olvCol.AspectGetter   = delegate(object sk) { return(UITools.FixSpec((sk as Skill).Spec)); };
                    olvCol.ImageGetter    = delegate(object sk)
                    {
                        Skill skill = sk as Skill;
                        switch (skill.Spec)
                        {
                        case "Balance":
                            return("spell_nature_starfall");

                        case "Feral":
                            return("ability_racial_bearform");

                        case "Restoration":
                            if (skill.Class == "Druid")
                            {
                                return("spell_nature_healingtouch");
                            }
                            else         // shaman
                            {
                                return("spell_nature_magicimmunity");
                            }

                        case "BeastMastery":
                            return("ability_hunter_beasttaming");

                        case "Marksmanship":
                            return("ability_marksmanship");

                        case "Survival":
                            return("ability_hunter_swiftstrike");

                        case "Arcane":
                            return("spell_holy_magicalsentry");

                        case "Fire":
                            return("spell_fire_flamebolt");

                        case "Frost":
                            return("spell_frost_frostbolt02");

                        case "Holy":
                            return("spell_holy_holybolt");        // they both use this (pal/priest)

                        case "Protection":
                            if (skill.Class == "Paladin")
                            {
                                return("spell_holy_devotionaura");
                            }
                            else         // warrior
                            {
                                return("ability_warrior_defensivestance");
                            }

                        case "Retribution":
                            return("spell_holy_auraoflight");

                        case "Discipline":
                            return("spell_holy_wordfortitude");

                        case "Shadow":
                            return("spell_shadow_shadowwordpain");

                        case "Assassination":
                            return("ability_rogue_eviscerate");

                        case "Combat":
                            return("ability_backstab");

                        case "Subtlety":
                            return("ability_stealth");

                        case "Elemental":
                            return("spell_nature_lightning");

                        case "Enhancement":
                            return("spell_nature_lightningshield");

                        case "Affliction":
                            return("spell_shadow_deathcoil");

                        case "Demonology":
                            return("spell_shadow_metamorphosis");

                        case "Destruction":
                            return("spell_shadow_rainoffire");

                        case "Arms":
                            return("ability_rogue_eviscerate");

                        case "Fury":
                            return("ability_warrior_innerrage");

                        case "General":
                            return("ability_dualwield");

                        default:
                            return("");
                        }
                    };
                    break;

                case "RequiredLevel":
                    olvCol.HeaderImageKey = "level";
                    olvCol.AspectGetter   = delegate(object sk) { return((sk as Skill).RequiredLevel); };
                    break;

                case "AECost":
                    olvCol.HeaderImageKey = "ae";
                    olvCol.AspectGetter   = delegate(object sk) { return((sk as Skill).AECost); };
                    break;

                case "TECost":
                    olvCol.HeaderImageKey = "te";
                    olvCol.AspectGetter   = delegate(object sk) { return((sk as Skill).TECost); };
                    break;
                }
                olvCol.Text  = col.m_szText;
                olvCol.Width = col.m_nWidth;
            }

            SetObjects(new List <Skill>(Data.AvailableList));
        }
Ejemplo n.º 10
0
        public void button1_Click(object sender, EventArgs ex)
        {
            if (txtSearch.Text == "")
            {
                MessageBox.Show("Did you miss something ?");
            }
            else
            {
                var    strRepId = "";
                string strSrch  = "";
                resultlist.Clear();
                try
                {
                    Applet Aplt  = new Applet();
                    Appl   Appl  = new Appl();
                    var    txtCN = Properties.Settings.Default.ConnectString;
                    var    txtUN = Properties.Settings.Default.Usr;
                    var    txtPW = Properties.Settings.Default.Pwd;
                    var    txtDB = Properties.Settings.Default.DBType;
                    strRepId = Properties.Settings.Default.RepId;
                    strSrch  = txtSearch.Text;
                    string strSrchType = strSearchTyp.SelectedItem.ToString();
                    string Wildsrch    = "Wildcard Search";
                    if (strSrchType == Wildsrch)
                    {
                        strSrch = "%" + strSrch + "%";
                    }
                    string connstr = "DSN=" + txtCN + ";Uid=" + txtUN + ";Pwd=" + txtPW + "";
                    conn = new OdbcConnection(connstr);
                    conn.Open();
                    if (Properties.Settings.Default.AppletSearchSpec == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Serch Spec";
                        statusStrip1.Refresh();
                        Aplt.AppletSearchSpec(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletBS == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Browser Script";
                        statusStrip1.Refresh();
                        Aplt.AppletBS(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletSS == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Server Scripts";
                        statusStrip1.Refresh();
                        Aplt.AppletSS(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletUPV == true)
                    {
                        toolStripStatusLabel1.Text = "Applet User Property Values";
                        statusStrip1.Refresh();
                        Aplt.AppletUPV(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletCUP == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Control User Property Values";
                        statusStrip1.Refresh();
                        Aplt.AppletCUP(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletDDDV == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Dynamic Drilldown Destination";
                        statusStrip1.Refresh();
                        Aplt.AppletDDDV(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletLCUP == true)
                    {
                        toolStripStatusLabel1.Text = "Applet List Column User Prop";
                        statusStrip1.Refresh();
                        Aplt.AppletLCUP(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletLCUPV == true)
                    {
                        toolStripStatusLabel1.Text = "Applet List Column User Prop Value";
                        statusStrip1.Refresh();
                        Aplt.AppletLCUPV(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.AppletWTI == true)
                    {
                        toolStripStatusLabel1.Text = "Applet Web Template Item";
                        statusStrip1.Refresh();
                        Aplt.AppletWTI(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.ApplBS == true)
                    {
                        toolStripStatusLabel1.Text = "Application Browser Script";
                        statusStrip1.Refresh();
                        Appl.ApplBS(strRepId, strSrch);
                    }
                    if (Properties.Settings.Default.ApplSS == true)
                    {
                        toolStripStatusLabel1.Text = "Application Server Script";
                        statusStrip1.Refresh();
                        Appl.ApplSS(strRepId, strSrch);
                    }
                    //Closing Events from here//
                    conn.Close();
                    toolStripStatusLabel1.Text = "Done";
                    statusStrip1.Refresh();
                    this.ResultListView.SetObjects(resultlist);
                    this.collapseGroup();

                    HotItemStyle hotItemStyle = new HotItemStyle();
                    hotItemStyle.ForeColor      = Color.White;
                    hotItemStyle.BackColor      = Color.FromArgb(255, 64, 64, 64);
                    ResultListView.HotItemStyle = hotItemStyle;
                    // HotItemChangedEventArgs HotItemChanged = new HotItemChangedEventArgs();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
                finally
                {
                    resultlist.Clear();
                    strRepId = "";
                    strSrch  = "";
                }
            }
        }