コード例 #1
0
        /// <summary>
        /// 载入模块名称
        /// </summary>
        private void LoadModuleNameAndData()
        {
            cbxDataName.Items.Clear();
            cbxModuleType.Items.Clear();
            cbxDataType.Items.Clear();
            listModule.Items.Clear();


            if (this.DesignMode)
            {
                //ide设计模式下的处理
                if (_modules == null)
                {
                    _modules = new CoordinationBizModules();
                }
                List <Control> ctls = DesignHelper.GetDesignControls(_designParent);

                foreach (Control ctl in ctls)
                {
                    ISysDesign dc = ctl as ISysDesign;
                    if (dc != null)
                    {
                        if (_modules.ContainsKey(dc.ModuleName) == false)
                        {
                            _modules.Add(dc.ModuleName, dc);
                        }
                        else
                        {
                            MessageBox.Show("模块 [" + dc.ModuleName + "] 实例已经存在,不能重复添加", "提示");
                        }
                    }
                }
            }
            else
            {
                _modules = _instance.RelateModules;
            }

            if (_modules == null)
            {
                return;
            }
            if (_modules.Count <= 0 && _modules.ParentWindowBizModules == null)
            {
                return;
            }

            cbxModuleType.Items.Add("当前窗体模块");
            cbxDataType.Items.Add("当前窗体模块");


            if (_modules.ParentWindowBizModules != null)
            {
                cbxModuleType.Items.Add("父级窗体模块");
                cbxDataType.Items.Add("父级窗体模块");
            }

            cbxModuleType.SelectedIndex = 0;
            cbxDataType.SelectedIndex   = 0;
        }
コード例 #2
0
ファイル: FlightPlanModel.cs プロジェクト: em7/PlgToFp
        /// <summary>
        /// Creates an empty flight plan
        /// </summary>
        public FlightPlanModel()
        {
#if DEBUG
            if (DesignHelper.IsInDesignMode())
            {
                Waypoints = new ObservableCollection <WaypointModel>(new List <WaypointModel>
                {
                    new WaypointModel()
                    {
                        Identifier = "ID1", Latitude = 6.66, Longitude = 12.89
                    },
                    new WaypointModel()
                    {
                        Identifier = "ID2", Latitude = -6.66, Longitude = 12.89
                    },
                    new WaypointModel()
                    {
                        Identifier = "ID3", Latitude = 6.66, Longitude = -12.89
                    },
                    new WaypointModel()
                    {
                        Identifier = "ID4", Latitude = -6.66, Longitude = -12.89
                    },
                });
            }
#endif
        }
コード例 #3
0
 public Task <List <Presentation> > GetPresentationsAsync()
 {
     return(TaskEx.Run <List <Presentation> >(() =>
     {
         return DesignHelper.Get_Session1();
     }));
 }
コード例 #4
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Links = new List <Link>();
            LinkHelper LinkHelper = HelperFactory.GetHelper <LinkHelper>();

            if (tag.Contains(","))
            {
                tag = tag.Substring(0, tag.IndexOf(","));
            }
            if (DesignHelper.IsDesigning)
            {
                List <Link> links;
                DesignHelper.FillItems <Link>(out links, PageSize);
                foreach (Link link in links)
                {
                    link.Thumbnail = DesignHelper.GetTagThumbnail("small");
                }
                Links = links;
            }
            else
            {
                Links = LinkHelper.GetPagedAllLinks(0, PageSize, "", tag);
            }
            if (ColumnCount <= 0)
            {
                columnCount = PageSize;
            }
        }
コード例 #5
0
        /// <summary>
        /// 取得当前的文章
        /// </summary>
        /// <returns>文章实体</returns>
        protected virtual Article GetThisArticle()
        {
            Article article = null;

            Attachments = new List <Attachment>();
            if (DesignHelper.IsDesigning)
            {
                DesignHelper.FillItems <Article>(out article, PageSize);
                Attachments.Add(new Attachment()
                {
                    ArticleID = article.ID, FilePath = DesignHelper.GetAttachment()
                });
                Attachments.Add(new Attachment()
                {
                    ArticleID = article.ID, FilePath = DesignHelper.GetAttachment()
                });
                Attachments.Add(new Attachment()
                {
                    ArticleID = article.ID, FilePath = DesignHelper.GetAttachment()
                });
                Attachments.Add(new Attachment()
                {
                    ArticleID = article.ID, FilePath = DesignHelper.GetAttachment()
                });
            }
            else
            {
                if (We7Helper.IsEmptyID(BindColumnID) && !We7Helper.IsEmptyID(ArticleID))
                {
                    article = ArticleHelper.GetArticle(ArticleID, null);
                }
                else
                {
                    List <Article> articles = GetArticleListFromDB();
                    if (articles.Count > 0)
                    {
                        article = articles[0];
                    }
                }
            }

            if (article != null)
            {
                List <Article> list = new List <Article>();
                list.Add(article);
                FormatArticlesData(list);
                article = list[0];
                if (AttachmentNum > 0)
                {
                    Attachments = AttachmentHelper.GetAttachments(article.ID);
                }
            }
            else
            {
                article = new Article();
            }

            return(article);
        }
コード例 #6
0
 public List <Presenter> GetPresenters()
 {
     return(new List <Presenter>()
     {
         DesignHelper.Get_Hector_Correa(),
         DesignHelper.Get_Constantine_Aaron_Cois()
     });
 }
コード例 #7
0
 public List <Session> GetSessions()
 {
     return(new List <Session>()
     {
         DesignHelper.Get_Session_37(),
         DesignHelper.Get_Session_38()
     });
 }
コード例 #8
0
 public BaseWebControl()
     : base()
 {
     DesignHelper = new DesignHelper(this);
     //默认设计状态来自Request["design"]
     string design = Context.Request["state"];
     //VisualDesign = design != null;
 }
コード例 #9
0
        public ActionResult Preview(int id)
        {
            var widget = FindWidget(id);

            DesignHelper.SetPreview(CurrentSite, new Page());

            return(PartialView(widget));
        }
コード例 #10
0
        private static void ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (DesignHelper.IsInDesignMode())
            {
                return;
            }

            bool value = (bool)e.NewValue;

            if (!value)
            {
                return;
            }

            FrameworkElement fe = d as FrameworkElement;

            if (fe == null)
            {
                return;
            }

            Type type = FindViewModel(fe);

            if (type == null)
            {
                return;
            }

            Type   interfaceType = typeof(INavigationBase);
            object vm            = null;

            //没有继承INavigationAware,默认SaveViewModel=false

            if (interfaceType.IsAssignableFrom(type))
            {
                //查下这个type是否被缓存了
                object tmp = ViewModelResposity.Get(type);
                if (tmp == null)
                {
                    tmp = Activator.CreateInstance(type);
                }

                INavigationBase @base  = tmp as INavigationBase;
                bool            isSave = @base.SaveViewModel();
                if (isSave)
                {
                    vm = tmp;
                }
            }

            if (vm == null)
            {
                vm = Activator.CreateInstance(type);
            }

            ViewModelResposity.Save(vm);
            fe.DataContext = vm;
        }
コード例 #11
0
        public JsonResult Left()
        {
            object ans  = DesignHelper.ReadSheetLeft();
            var    data = new JsonResult();

            data.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            data.Data = ans;
            return(data);
        }
コード例 #12
0
        private void frmQueryFilter_Load(object sender, EventArgs e)
        {
            queryLayout1.DBHelper = _dbHelper;
            queryLayout1.LoadSchemeFromString(_queryScheme);

            this.Height = queryLayout1.Height + panel1.Height;

            DesignHelper.RestoreWindowPostion(this);
        }
コード例 #13
0
        public JsonResult Index(Int32 tid)
        {
            tid = 2;//从后台获取
            String strColumns = DesignHelper.ReadColumnsByTid(tid);
            var    res        = new JsonResult();
            var    columns    = strColumns;

            res.Data = new object[] { new { columns } };
            return(res);
        }
コード例 #14
0
 private void frmQueryFilter_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         DesignHelper.SaveWindowPostion(this);
     }
     catch (Exception ex)
     {
         MsgBox.ShowException(ex, this);
     }
 }
コード例 #15
0
 public string GetBanner()
 {
     if (DesignHelper.IsDesigning)
     {
         return(DesignHelper.GetTagThumbnail("banner"));
     }
     else
     {
         return("/_data/Channels/banners/banner_" + GetChannelName(Level) + ".jpg");
     }
 }
コード例 #16
0
 /// <summary>
 /// 根据栏目名称取Banner
 /// </summary>
 /// <returns></returns>
 protected string GetBannerByName()
 {
     if (DesignHelper.IsDesigning)
     {
         return(DesignHelper.GetTagThumbnail("class"));
     }
     else
     {
         return("/_data/Channels/banners/banner_" + GetChannelName(Level) + ".jpg");
     }
 }
コード例 #17
0
 private void fileListBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         pictureBox1.Image = DesignHelper.LoadFile(Dir.GetAppResourceDir() + @"\" + fileListBox1.Text);
     }
     catch (Exception ex)
     {
         MsgBox.ShowException(ex, this);
     }
 }
コード例 #18
0
 public Task <List <Session> > GetSessionsAsync()
 {
     return(TaskEx.Run <List <Session> >(() =>
     {
         return new List <Session>()
         {
             DesignHelper.Get_Session_37(),
             DesignHelper.Get_Session_38()
         };
     }));
 }
コード例 #19
0
 public Task <List <Presenter> > GetPresentersAsync()
 {
     return(TaskEx.Run <List <Presenter> >(() =>
     {
         return new List <Presenter>()
         {
             DesignHelper.Get_Hector_Correa(),
             DesignHelper.Get_Constantine_Aaron_Cois()
         };
     }));
 }
コード例 #20
0
 public PlanPointsPartViewModelDesign(bool createParent) : base(null, null, null, null)
 {
     if (createParent && DesignHelper.IsInDesignMode())
     {
         var fpvm = new FlightPlanViewModelDesign(this)
         {
             FlightPlan = new Model.FlightPlanModel()
         };
         ParentFlightPlan = fpvm;
     }
 }
コード例 #21
0
        ///


        #endregion

        #region Contructor
        public Phanquyen()
        {
            InitializeComponent();
            chucvuSql    = new ChucvuSql();
            phanQuyenSql = new PhanQuyenSql();
            AddChucVuVaoCombobox();
            gridViewMain.OptionsView.ColumnHeaderAutoHeight   = DevExpress.Utils.DefaultBoolean.True;
            gridViewDetail.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
            DesignHelper.AlignControlLocationX(sidePanelQuanLy);
            DesignHelper.AlignControlLocationX(labelTieuDe);
        }
コード例 #22
0
        public ActionResult Index()
        {
            String ans = DesignHelper.ReadAllTable();
            var    res = new JsonResult();

            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            var tables = ans;

            res.Data         = new object[] { new { tables } };
            ViewData["data"] = res;
            return(View());
        }
コード例 #23
0
        public ActionResult Preview(int id)
        {
            var page = FindPage(id);

            if (page == null)
            {
                return(HttpNotFound());
            }

            DesignHelper.SetPreview(CurrentSite, page);

            return(View(FrontContext.Current.TemplatePath, page));
        }
コード例 #24
0
        public ActionResult Design(int id)
        {
            var page = FindPage(id);

            if (page == null)
            {
                return(HttpNotFound());
            }

            DesignHelper.SetPreview(CurrentSite, page);

            return(View(page));
        }
コード例 #25
0
        /// <summary>
        /// 取得小图路径
        /// </summary>
        /// <param name="urlSource">大图的路径字符串</param>
        /// <returns>小图地址</returns>
        public string GetSmallPhoto(string urlSource)
        {
            string photoName = null;

            if (DesignHelper.IsDesigning)
            {
                photoName = DesignHelper.GetTagThumbnail(ThumbnailTagSmall);
            }
            else
            {
                photoName = ThisArticle.GetTagThumbnail(ThumbnailTagSmall);
            }
            return(photoName);
        }
コード例 #26
0
ファイル: RssDataProvider.cs プロジェクト: jiaping/JPCMS
 protected override void OnLoad(EventArgs e)
 {
     //0为显示全部
     base.OnLoad(e);
     Articles = new List <Article>();
     if (DesignHelper.IsDesigning)
     {
         List <Article> result;
         RecordCount = DesignHelper.FillItems(out result, PageSize);
         Articles    = result;
     } //if (DesignHelper.IsDesigning) true
     else
     {
         if (!string.IsNullOrEmpty(RssUrl))
         {
             Articles = ProcessRSSItem(RssUrl);
         }
     } //if (DesignHelper.IsDesigning) false
 }
コード例 #27
0
        public JsonResult AddClassify([ModelBinder(typeof(JsonBinder <ClassifyData>))] ClassifyData cfy)
        {
            var data = new JsonResult();

            try
            {
                String name = cfy.name;
                if (name != "")
                {
                    object ans = DesignHelper.MaintainClassify(name: name);
                    data.Data = ans;
                }
                else
                {
                    data.Data = new { status = "0x03", msg = "数据不能为空" };
                }
            }
            catch
            {
                data.Data = new { status = "0x02", msg = "传入数据的格式不正确" };
            }
            return(data);
        }
コード例 #28
0
        /// <summary>
        /// 取得数据列表
        /// </summary>
        /// <returns>文章列表</returns>
        List <Article> GetArticleList(Channel ch)
        {
            ArticleQuery   query = new ArticleQuery();
            List <Article> list  = new List <Article>();

            if (DesignHelper.IsDesigning)
            {
                RecordCount = DesignHelper.FillItems(out list, PageSize);
            }
            else
            {
                query.ChannelID      = ch.ID;
                query.ChannelFullUrl = ch.FullUrl;
                query.IncludeAllSons = true;

                query.State      = ArticleStates.Started;
                query.IsShowHome = ShowAtHome ? "1" : "";

                if (!String.IsNullOrEmpty(ArticleOrderFields))
                {
                    query.OrderKeys = ArticleOrderFields;
                }
                else
                {
                    query.OrderKeys = "Updated|Desc";
                }

                query.Overdue = true;
                if (ArticleTag != null && ArticleTag.Length > 0)
                {
                    query.Tag = ArticleTag;
                }

                list = ArticleHelper.QueryArtilcesByAll(query, 0, PageSize, null);
            }
            return(list);
        }
コード例 #29
0
ファイル: clsForm.cs プロジェクト: routd1/ProjectHurricane
        protected override void OnLoad(EventArgs e)
        {
            this.Text = GetStringOnID(strMsgID);
            this.TabText = GetStringOnID(strMsgID);
            if (clsProfile.DoEnableProfiling)
            {
                using (DesignHelper helper = new DesignHelper())
                {
                    helper.DoProfileBasedDesign(this);
                }
            }

            RecursivelyFindControl(this);

            base.OnLoad (e);
        }
コード例 #30
0
 public List <Presentation> GetPresentations()
 {
     return(DesignHelper.Get_Session1());
 }
コード例 #31
0
 public QuanLyNhanVien()
 {
     InitializeComponent();
     DesignHelper.CenterControl(sidePanelThongTin);
 }