예제 #1
0
 public CategoryNode(CategoryInfo ctg)
 {
     base.NodeType = NodeType.Category;
     _category = ctg;
     this.Text = ctg.CategoryName;
     //this.ToolTipText = ctg.CategoryName;
     this.ImageIndex = DataConvert.GetInt32(ImageType.Books);
     this.SelectedImageIndex = DataConvert.GetInt32(ImageType.Books);
 }
예제 #2
0
        public static Collection<CategoryInfo> GetCategoryMasterData()
        {
            try
            {
                XmlDocument objXmlDoc = GetMasterDataFile(Constants.FILE_CATEGORYMASTERDATA);
                if (objXmlDoc == null)
                    return null;

                DataView dv = GetData(objXmlDoc, "data/category");

                Collection<CategoryInfo> categories = new Collection<CategoryInfo>();

                for (int ix = 0; ix < dv.Table.Rows.Count; ix++)
                {
                    CategoryInfo category = new CategoryInfo();
                    category.CategoryId = DataConvert.GetInt32(dv.Table.Rows[ix][0]);
                    category.CategoryName = DataConvert.GetString(dv.Table.Rows[ix][1]);
                    category.CategoryUrl = DataConvert.GetString(dv.Table.Rows[ix][2]);
                    //category.CategoryUrl = string.Format(category.CategoryUrl, 1);
                    categories.Add(category);
                }
                return categories;
            }
            catch (Exception ex)
            {
                LogHelper.Write("ConfigCtrl.GetCategoryMasterData()", ex);
                return null;
            }
        }
예제 #3
0
 void mailTree_OpenCategoryEvent(object sender, Johnny.Novel.Controls.MailTree.MailEventArgs e)
 {
     try
     {
         StartLoading();
         _currentCategory = e.Category;
         _requestHandler.GetNovelListByThread(GetTheNovelListUrl(1));
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("MainForm.mailTree_OpenCategoryEvent", ex);
         StopLoading();
     }
 }
예제 #4
0
 private void OnOpenCategoryClick(object sender, EventArgs e)
 {
     try
     {                
         CategoryNode cn = this.SelectedNode as CategoryNode;               
         if (cn != null)
         {
             MailEventArgs te = new MailEventArgs();
             GroupNode gn = cn.Parent as GroupNode;
             te.Group = gn.Group.GroupName;
             te.Category = cn.Category;
             _currentCategory = cn.Category;
             OnOpenCategory(te);
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }