コード例 #1
0
        public CollisionCheckSystem()
        {
            TemplateFilter <CollisionCheckForwardTemplate> .Setup();

            _list = EntityController.GetTemplateList <CollisionCheckForwardTemplate>();
            _del  = RunUpdate;
        }
コード例 #2
0
        protected void LoadInfo()
        {
            ddl_SysModel.DataSource     = TemplateAction.AllSysModel;
            ddl_SysModel.DataTextField  = "ModelName";
            ddl_SysModel.DataValueField = "ID";
            ddl_SysModel.DataBind();

            int          id  = WS.RequestInt("id");
            DataEntities ent = new DataEntities();
            TemplateList tl  = (from l in ent.TemplateList where l.ID == id select l).FirstOrDefault();

            ent.Dispose();
            try
            {
                txt_TempName.Text          = tl.TempName;
                txt_CutKeywords.Text       = tl.CutKeywords.ToS();
                txt_CutTitle.Text          = tl.CutTitle.ToS();
                txt_ShowRecordCount.Text   = tl.ShowRecordCount.ToS();
                txt_TimeFormat.Text        = tl.TimeFormat;
                txt_Content.Text           = tl.Content;
                txt_Listvar.Text           = tl.ListVar;
                ddl_SysModel.SelectedValue = tl.SysModel.ToS();
            }
            catch { }
        }
コード例 #3
0
        /// <summary>
        /// 根据条件语句取得第一个实体
        /// </summary>
        /// <param name="m_where">条件语句,不包含“where”</param>
        /// <returns></returns>
        public static TemplateList Find(string m_where)
        {
            IDbHelper    Sql = GetHelper();
            TemplateList M   = new TemplateList();
            DbDataReader Rs  = Sql.ExecuteReader(CommandType.Text, "select [ID],[GroupID],[TempName],[SysModel],[CutKeywords],[CutTitle],[ShowRecordCount],[TimeFormat],[Content],[ListVar] from [TemplateList] where " + m_where, true);

            if (!Rs.Read())
            {
                M.ID = 0;
            }
            else
            {
                M.ID              = Rs["ID"].ToInt32();
                M.GroupID         = Rs["GroupID"].ToInt32();
                M.TempName        = Rs["TempName"].ToString();
                M.SysModel        = Rs["SysModel"].ToInt32();
                M.CutKeywords     = Rs["CutKeywords"].ToInt32();
                M.CutTitle        = Rs["CutTitle"].ToInt32();
                M.ShowRecordCount = Rs["ShowRecordCount"].ToInt32();
                M.TimeFormat      = Rs["TimeFormat"].ToString();
                M.Content         = Rs["Content"].ToString();
                M.ListVar         = Rs["ListVar"].ToString();
            }
            Rs.Close();
            Rs = null;
            return(M);
        }
コード例 #4
0
        public static void CreateListPage(Class c, int page, bool AutoCreateNext)
        {
            TemplateHelper h           = new TemplateHelper();
            TemplateList   temp        = h.GetListTemplate(c);
            int            recordCount = c.CountItem();
            int            pagecount   = (Convert.ToDouble(recordCount) / Convert.ToDouble(temp.ShowRecordCount)).YueShu();


            string Content = h.CreateListPage(c, page);

            string FileName = BasePage.GetClassUrl(c, page);

            Voodoo.IO.File.Write(System.Web.HttpContext.Current.Server.MapPath("~" + FileName), Content);

            ping(BasePage.SystemSetting.SiteUrl.TrimEnd('/') + FileName);

            //下一页链接
            if (pagecount > page && AutoCreateNext)
            {
                CreateListPage(c, page + 1);
            }
            if (page == 1)
            {
                CreatePagesByCrateWith(2);
            }
        }
コード例 #5
0
        private ExcelDoc openDocumentExcel(string name)
        {
            var templateList = TemplateList.getInstance();
            var template     = templateList.getItem(name);

            return(new ExcelDoc(template.File));
        }
コード例 #6
0
ファイル: EffectManager.cs プロジェクト: mliuzailin/GitGame
        /// <summary>
        /// エフェクトをスケーリング
        /// </summary>
        /// <param name="instance_game_object"></param>
        /// <param name="default_info"></param>
        /// <param name="scale"></param>
        public static void scaleEffect(GameObject instance_game_object, TemplateList <DefaultInfo> default_info, float size_scale, float speed_scale, int layer)
        {
            ParticleSystem particle_system = instance_game_object.GetComponent <ParticleSystem>();

            float wrk_scale = 1.0f;

            if (size_scale >= 0.0f)
            {
                wrk_scale = size_scale;
            }
            else
            {
                // 親階層のスケールの影響を受けないモード
                float parent_scale = 1.0f;
                if (particle_system.transform.parent != null)
                {
                    Vector3 parent_scale3 = particle_system.transform.parent.lossyScale;
                    parent_scale = (parent_scale3.x + parent_scale3.y + parent_scale3.z) / 3.0f;
                }

                wrk_scale = -size_scale / parent_scale;
            }

            int scale_info_index = 0;

            scaleEffectSub(particle_system.transform, default_info, speed_scale, layer, ref scale_info_index);

            particle_system.transform.localScale = new Vector3(wrk_scale, wrk_scale, wrk_scale);
        }
コード例 #7
0
ファイル: EffectManager.cs プロジェクト: mliuzailin/GitGame
        private static void scaleEffectSub(Transform trans, TemplateList <DefaultInfo> default_infos /*, float size_scale*/, float speed_scale, int layer, ref int scale_info_index)
        {
            trans.gameObject.layer = layer;

            ParticleSystem particle_system = trans.GetComponent <ParticleSystem>();

            if (particle_system != null)
            {
                ParticleSystem.MainModule main_module = particle_system.main;

                DefaultInfo default_info = default_infos[scale_info_index++];

                //main_module.startSizeMultiplier = size_scale * scale_info.m_SizeScale;
                main_module.scalingMode     = ParticleSystemScalingMode.Hierarchy;
                main_module.simulationSpeed = speed_scale * default_info.m_SpeedScale;
#if REPLACE_SHADER
                if (default_info.m_Materials != null)
                {
                    ParticleSystemRenderer particle_system_renderer = particle_system.GetComponent <ParticleSystemRenderer>();
                    if (particle_system_renderer != null)
                    {
                        particle_system_renderer.materials = default_info.m_Materials;
                    }
                }
#endif //REPLACE_SHADER
            }

            for (int idx = 0; idx < trans.childCount; idx++)
            {
                Transform child_trans = trans.GetChild(idx);
                scaleEffectSub(child_trans, default_infos /*, size_scale*/, speed_scale, layer, ref scale_info_index);
            }
        }
コード例 #8
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            int          id  = WS.RequestInt("id");
            DataEntities ent = new DataEntities();
            TemplateList tl;

            try
            {
                tl = (from l in ent.TemplateList where l.ID == id select l).First();
            }
            catch
            {
                tl = new TemplateList();
            }


            tl.TempName        = txt_TempName.Text;
            tl.CutKeywords     = txt_CutKeywords.Text.ToInt32();
            tl.CutTitle        = txt_CutTitle.Text.ToInt32();
            tl.ShowRecordCount = txt_ShowRecordCount.Text.ToInt32();
            tl.TimeFormat      = txt_TimeFormat.Text;
            tl.Content         = txt_Content.Text.Replace("'", "''");;
            tl.ListVar         = txt_Listvar.Text.Replace("'", "''");;
            tl.SysModel        = ddl_SysModel.SelectedValue.ToInt32();
            if (tl.ID <= 0)
            {
                tl.GroupID  = 1;
                tl.SysModel = 1;
                ent.AddToTemplateList(tl);
            }
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndGoback("保存成功!");
        }
コード例 #9
0
        protected override void OnPreRender(EventArgs e)
        {
            var userID = Convert.ToInt32(Session["SystemUser.objID"]);


            #region заполнение templatelist dropdownlist'а разрешенными на просмотр template'ами
            //            var TemplateListDataQuery = string.Format(@"SELECT p.[objID], p.[name] FROM [Permission].[IUTemplatePermission]({0}) p, model.BTables t
            //                                        where t.[name] = p.[baseTable] and t.[object_ID] = {1} and p.[typeCode] like 'TableBased' and p.[read] = 'True'
            //                                        order by p.[name]", userID, (long)EventListGridView.SelectedDataKey["tableID"]);
            var TemplateListDataQuery = string.Format(@"SELECT p.[objID], p.[name] FROM [Permission].[IUTemplatePermission]({0}) p, model.BTables t
                                        where t.[name] = p.[baseTable] and t.[object_ID] = {1} and p.[typeCode] like 'TableBased' and p.[read] = 'True'
                                        order by p.[name]", userID, SelectedEntity);
            TemplateList.DataSource = Storage.GetDataTable(TemplateListDataQuery);
            TemplateList.DataBind();

            if (!string.IsNullOrEmpty(selectedTemplateID) && TemplateList.Items.FindByValue(selectedTemplateID) != null)
            {
                TemplateList.SelectedValue = selectedTemplateID;
            }

            #endregion



            base.OnPreRender(e);
        }
コード例 #10
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            int          id = WS.RequestInt("id");
            TemplateList tl = TemplateListView.GetModelByID(id.ToS());

            tl.TempName        = txt_TempName.Text;
            tl.CutKeywords     = txt_CutKeywords.Text.ToInt32();
            tl.CutTitle        = txt_CutTitle.Text.ToInt32();
            tl.ShowRecordCount = txt_ShowRecordCount.Text.ToInt32();
            tl.TimeFormat      = txt_TimeFormat.Text;
            tl.Content         = txt_Content.Text.Replace("'", "''");;
            tl.ListVar         = txt_Listvar.Text.Replace("'", "''");;
            tl.SysModel        = ddl_SysModel.SelectedValue.ToInt32();
            if (tl.ID > 0)
            {
                TemplateListView.Update(tl);
            }
            else
            {
                tl.GroupID  = 1;
                tl.SysModel = 1;
                TemplateListView.Insert(tl);
            }
            Js.AlertAndGoback("保存成功!");
        }
コード例 #11
0
        public PlayerRaycastTargetSystem()
        {
            TemplateFilter <PlayerRaycastTargetTemplate> .Setup();

            _list = EntityController.GetTemplateList <PlayerRaycastTargetTemplate>();
            _del  = Update;
        }
コード例 #12
0
        private void FillTemplateList(string entityID)
        {
#if alexj
            var query = string.Format(@"SELECT p.[objID], p.[name] FROM [Permission].[IUTemplatePermission]({0}) p, model.BTables t
                                        where t.[name] = p.[baseTable] and t.[object_ID] = {1} and p.[typeCode] like 'crossReport' and p.[read] = 'True'
                                        order by p.[name]", Session["SystemUser.objID"].ToString(), entityID);
#else
            var query = string.Format(@"SELECT [RT].[objID], [RT].[name] FROM [model].[R$Template] [RT] 
                                          right JOIN [model].[R$TemplateType] [RTT] ON [RTT].[objID] = [RT].[typeID]
                                          WHERE [RTT].[code] like 'crossReport' AND [RT].[entityID] = '{0}'", entityID);
#endif



            var dt = Storage.GetDataTable(query);

            TemplateList.Items.Clear();

            TemplateList.Items.Add(new ListItem {
                Text = "Создать новый", Value = "-1"
            });

            foreach (DataRow item in dt.Rows)
            {
                TemplateList.Items.Add(new ListItem {
                    Value = item[0].ToString(), Text = item[1].ToString()
                });
            }

            TemplateList.DataBind();
        }
コード例 #13
0
ファイル: MapSystem.cs プロジェクト: FuzzySlipper/Framework
        public MapSystem()
        {
            TemplateFilter <UnitOccupyingCellTemplate> .Setup();

            _templateList = EntityController.GetTemplateList <UnitOccupyingCellTemplate>();
            _del          = UpdateNode;
        }
コード例 #14
0
ファイル: EmailStore.cs プロジェクト: isabella232/azure-cef
        public async Task <TemplateList> ListTemplatesAsync(string engagementAccount, DbContinuationToken continuationToken, int count)
        {
            using (var ctx = new EmailServiceDbEntities(this.connectionString))
            {
                var result    = new TemplateList();
                var templates = ctx.Templates.Where(t => t.EngagementAccount == engagementAccount).OrderBy(t => t.Created);
                result.Total = templates.Count();

                if (result.Total <= 0)
                {
                    return(result);
                }

                var taken = count >= 0 ?
                            await templates.Skip(continuationToken.Skip).Take(count).ToListAsync() :
                            await templates.Skip(continuationToken.Skip).ToListAsync();

                result.Templates = new List <Template>();
                foreach (var entity in taken)
                {
                    result.Templates.Add(entity.ToModel());
                }

                if (result.Total > continuationToken.Skip + count)
                {
                    result.NextLink = new DbContinuationToken(continuationToken.DatabaseId, continuationToken.Skip + count);
                }

                return(result);
            }
        }
コード例 #15
0
 public PhysicsMoverSystem()
 {
     _rbDel    = CheckPaused;
     _moverDel = HandleVelocityMover;
     MessageKit.addObserver(Messages.PauseChanged, CheckPause);
     _moverList = EntityController.GetTemplateList <RigidbodyMoverTemplate>();
 }
コード例 #16
0
        private WordDoc openDocumentWord(string name)
        {
            var templateList = TemplateList.getInstance();
            var template     = templateList.getItem(name);

            return(new WordDoc(template.File));
        }
コード例 #17
0
        public FlightPhysicsSystem()
        {
            TemplateFilter <FlyingTemplate> .Setup();

            _flyingList = EntityController.GetTemplateList <FlyingTemplate>();
            _del        = UpdateNode;
        }
コード例 #18
0
        //排序获取datatable
        protected void GetTemplateListByOrderBy(string orderby)
        {
            int    i, j;
            string TemplateName = (ViewState["txtTemplateName"] == null ? txtTemplateName.Text.Trim() : ViewState["txtTemplateName"].ToString());
            //string StartDate = (ViewState["TemplateName"] == null ? txtTemplateName.Text.Trim() : ViewState["TemplateName"].ToString()); txtStartDate.Text.Trim();
            //string EndDate = (ViewState["TemplateName"] == null ? txtTemplateName.Text.Trim() : ViewState["TemplateName"].ToString()); txtEndDate.Text.Trim();
            string    Author         = (ViewState["txtAuthor"] == null ? txtAuthor.Text.Trim() : ViewState["txtAuthor"].ToString());
            string    TemplateStatus = (ViewState["ddlStatus"] == null ? ddlStatus.SelectedValue : ViewState["ddlStatus"].ToString());
            int       startIndex     = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1;
            int       PageSize       = AspNetPager1.PageSize;
            string    bigcate        = (ViewState["ddlCATEGORY"] == null ? ddlCATEGORY.SelectedValue : ViewState["ddlCATEGORY"].ToString());
            string    smallcate      = (ViewState["ddlsmallcategory"] == null ? ddlsmallcategory.SelectedValue : ViewState["ddlsmallcategory"].ToString());
            DataTable dt             = tmbll.GetTemplateList(TemplateName, bigcate, smallcate, Author, TemplateStatus, orderby, AspNetPager1.CurrentPageIndex, PageSize, out i, out j);

            if (dt != null && dt.Rows.Count > 0)
            {
                dt.Columns.Add("bs_row_num", Type.GetType("System.String"));
                int pindex = (AspNetPager1.CurrentPageIndex - 1) * PageSize;
                foreach (DataRow dr in dt.Rows)
                {
                    pindex++;
                    dr["bs_row_num"] = pindex.ToString();
                }
            }
            AspNetPager1.RecordCount = i;
            TemplateList.DataSource  = dt;
            TemplateList.DataBind();
            ReCodePager();
        }
コード例 #19
0
ファイル: Class.cs プロジェクト: Creepsky/Nexus
 public override object Clone()
 {
     return(new Class(new string(Name),
                      (TemplateList)TemplateList?.CloneDeep(),
                      Variables.Select(i => (Variable)i.CloneDeep()).ToList(),
                      CppBlocks.Select(i => (CppBlockStatement)i.CloneDeep()).ToList(),
                      Includes.Select(i => (Include)i.CloneDeep()).ToList()));
 }
コード例 #20
0
 private void PopulateTemplates()
 {
     TemplateList.Items.Clear();
     TemplateList.Items.Add(new ListItem("- Not Selected -", string.Empty));
     TemplateList.AppendDataBoundItems = true;
     TemplateList.DataSource           = DnnPathHelper.GetViewNames("Category");
     TemplateList.DataBind();
 }
コード例 #21
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	リザルトコード一覧の生成
     */
    //----------------------------------------------------------------------------
    public void ResultCodeAdd(API_CODE eCode, API_CODETYPE eCodeType)
    {
        if (m_ResultCodeType == null)
        {
            m_ResultCodeType = new TemplateList <ResultCodeType>();
        }
        m_ResultCodeType.Add(new ResultCodeType(eCode, eCodeType));
    }
コード例 #22
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	イレギュラーリザルトコード一覧の生成
     */
    //----------------------------------------------------------------------------
    public void ResultCodeAddIrregular(SERVER_API eAPI, API_CODE eCode, API_CODETYPE eCodeType)
    {
        if (m_ResultCodeTypeIrregular == null)
        {
            m_ResultCodeTypeIrregular = new TemplateList <ResultCodeTypeIrregular>();
        }
        m_ResultCodeTypeIrregular.Add(new ResultCodeTypeIrregular(eAPI, eCode, eCodeType));
    }
コード例 #23
0
ファイル: Program.cs プロジェクト: AnkitaKhurana/repos_backup
 public void Display(TemplateList <T> myList)
 {
     foreach (T data in myList)
     {
         Console.Write(data + " ");
     }
     Console.WriteLine("\n");
 }
コード例 #24
0
        public static void RegisterTemplates(this PluginContainer pluginContainer, PluginTemplateRegistry registry)
        {
            TemplateList templates = new TemplateList();

            pluginContainer.ExecuteMethod("RegisterTemplates", templates);

            templates.ForEach(t => registry.Add(pluginContainer.Tag as Plugin, t.TemplateName, t.Selector, (PluginTemplateSelectorType)(int)t.SelectorType, ptc => t.PageCondition(new TemplateContext(ptc)), t.ModelTarget));
        }
コード例 #25
0
        public TurnBasedSystem()
        {
            TemplateFilter <TurnBasedCharacterTemplate> .Setup();

            _turnTemplates      = EntityController.GetTemplateList <TurnBasedCharacterTemplate>();
            _findCurrentFastest = FindCurrent;
            _setupUnitTurns     = SetupUnitTurn;
        }
コード例 #26
0
        private void LoadTemplates()
        {
            TemplateList.Clear();

            if (Directory.Exists($"{ Constants.ContentPath + (int)ProductType }\\user_templates\\"))
            {
                foreach (var path in Directory.GetFiles($"{ Constants.ContentPath + (int)ProductType }\\user_templates\\"))
                {
                    var pathfix = path.Replace("BBTEL", "BB/TEL");
                    if (!string.IsNullOrEmpty(BreakerSelected) && !pathfix.Contains(BreakerSelected))
                    {
                        continue;
                    }
                    if (!string.IsNullOrEmpty(OperatingCurrentSelected) && !pathfix.Contains(OperatingCurrentSelected))
                    {
                        continue;
                    }
                    if (SectionsAmountIndex == 1 && !Regex.IsMatch(pathfix, @".+\(\d+\).+"))
                    {
                        continue;
                    }
                    if (SectionsAmountIndex == 2 && !Regex.IsMatch(pathfix, @".+\(\d+\,\d\).+"))
                    {
                        continue;
                    }

                    _userTemplates.Add(path);
                    TemplateList.Add(Path.GetFileNameWithoutExtension(path));
                }
            }

            if (Directory.Exists($"{ Constants.ContentPath + (int)ProductType }\\templates\\"))
            {
                foreach (var path in Directory.GetFiles($"{ Constants.ContentPath + (int)ProductType }\\templates\\"))
                {
                    var pathfix = path.Replace("BBTEL", "BB/TEL");
                    if (!string.IsNullOrEmpty(BreakerSelected) && !pathfix.Contains(BreakerSelected))
                    {
                        continue;
                    }
                    if (!string.IsNullOrEmpty(OperatingCurrentSelected) && !pathfix.Contains(OperatingCurrentSelected))
                    {
                        continue;
                    }
                    if (SectionsAmountIndex == 1 && !Regex.IsMatch(pathfix, @".+\(\d+\).+"))
                    {
                        continue;
                    }
                    if (SectionsAmountIndex == 2 && !Regex.IsMatch(pathfix, @".+\(\d+\,\d\).+"))
                    {
                        continue;
                    }

                    _appTemplates.Add(path);
                    TemplateList.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
        }
コード例 #27
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	テキスト追加登録
     */
    //----------------------------------------------------------------------------
    public void AddText(string strText)
    {
        if (m_TextList == null)
        {
            m_TextList = new TemplateList <string>();
        }

        m_TextList.Add(strText);
    }
コード例 #28
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	色追加登録
     */
    //----------------------------------------------------------------------------
    public void AddColor(Color cColor)
    {
        if (m_ColorList == null)
        {
            m_ColorList = new TemplateList <Color>();
            SetColor(cColor);
        }

        m_ColorList.Add(cColor);
    }
コード例 #29
0
        public FirstPersonAnimationSystem()
        {
            TemplateFilter <FirstPersonAnimationTemplate> .Setup();

            _animTemplates = EntityController.GetTemplateList <FirstPersonAnimationTemplate>();
            EntityController.RegisterReceiver(new EventReceiverFilter(this, new [] {
                typeof(WeaponModelComponent),
                typeof(PoseAnimatorComponent)
            }));
        }
コード例 #30
0
ファイル: EffectManager.cs プロジェクト: mliuzailin/GitGame
        /// <summary>
        /// スケーリング情報を生成
        /// </summary>
        public static TemplateList <DefaultInfo> buildDefaultInfo(ParticleSystem particle_system)
        {
            TemplateList <DefaultInfo> ret_val = null;

            if (particle_system != null)
            {
                ret_val = new TemplateList <DefaultInfo>();
                buildDefaultInfoSub(particle_system.transform, ret_val);
            }
            return(ret_val);
        }
コード例 #31
0
		private async Task SaveTemplatesList(TemplateList target)
		{
			File.WriteAllText(TemplateListFile.LocalPath, target.Serialize());
			await TemplateListFile.Upload();
		}
コード例 #32
0
		private void LoadTemplates()
		{
			FormProgress.ShowProgress("Loading Schedule List...", () =>
			{
				AsyncHelper.RunSync(async () =>
				{
					_scheduleTemplateList = await BusinessObjects.Instance.ScheduleTemplatesManager.GetTemplatesList();
				});
			}, false);
			gridControlTemplates.DataSource = _scheduleTemplateList.Items;
			if (gridViewTemplates.RowCount > 0)
				gridViewTemplates.FocusedRowHandle = 0;
		}
コード例 #33
0
ファイル: Data.Designer.cs プロジェクト: kuibono/KCMS2
 public void AddToTemplateList(TemplateList templateList)
 {
     base.AddObject("TemplateList", templateList);
 }
コード例 #34
0
ファイル: Data.Designer.cs プロジェクト: kuibono/KCMS2
 public static TemplateList CreateTemplateList(int id)
 {
     TemplateList templateList = new TemplateList();
     templateList.ID = id;
     return templateList;
 }
コード例 #35
0
 internal static TemplateList getTemplateList(HttpResponseMessage responce)
 {
     var templateList = new TemplateList();
     var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result);
     if (jsonObj.ContainsKey("templates"))
     {
         var templatesArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["templates"].ToString());
         foreach(var templateObj in templatesArray)
         {
             var template = new Template();
             template = JsonConvert.DeserializeObject<Template>(templateObj.ToString());
             templateList.Add(template);
         }
     }
     return templateList;
 }