private void AddNewRec_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.extension.Text)) { base.RegisterStartupScript("", "<script>alert('要添加的附件扩展名不能为空');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } if (String.IsNullOrEmpty(this.maxsize.Text) || this.maxsize.Text.ToInt() <= 0) { base.RegisterStartupScript("", "<script>alert('要添加的附件最大尺寸不能为空且要大于0');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } foreach (var at in AttachType.FindAllWithCache()) { if (at.Extension.EqualIgnoreCase(this.extension.Text)) { base.RegisterStartupScript("", "<script>alert('数据库中已存在相同的附件扩展名');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加附件类型", "添加附件类型,扩展名为:" + this.extension.Text); try { //Attachments.AddAttchType(this.extension.Text, this.maxsize.Text); AttachType.Add(extension.Text, maxsize.Text.ToInt()); base.RegisterStartupScript("PAGE", "window.location.href='forum_attachtypesgrid.aspx';"); } catch { base.RegisterStartupScript("", "<script>alert('无法更新数据库.');window.location.href='forum_attachtypesgrid.aspx';</script>"); } }
// 播放光效 public void CreateParticle(string effectName, AttachType attachType, Vector3 pos, float delay = 0, float duration = 0) { try { GameObject prefab = Resources.Load <GameObject>(effectName); GameObject go = Instantiate(prefab); if (attachType != AttachType.WORLDPOINT) { go.transform.parent = gameObject.transform; go.transform.localPosition = pos; // TODO:这里仅是王子冲锋特效偏移的处理,需要进行改动 go.transform.Rotate(transform.rotation.eulerAngles); } else { go.transform.position = pos; } if (duration > 0) { Destroy(go, duration); } else { _effectDictionary[effectName] = go; } } catch { } }
private void SaveOrAdd(Attach Attach, AttachType AType, int AgentId, int SLogId) { var entity = Entity.Attach.FirstOrDefault(o => o.Id == Attach.Id); if (entity == null) { entity = new Attach() { AFile = Attach.AFile, AddTime = DateTime.Now, AType = (byte)AType, AgentId = AgentId, SAId = this.AdminUser.Id, State = 1, SLogId = SLogId, UpLoadFile = Attach.UpLoadFile }; Entity.Attach.AddObject(entity); } else { entity = Request.ConvertRequestToModel <Attach>(entity, Attach); entity.SAId = this.AdminUser.Id; } }
private AttachResult Attach(AttachType attachType) { string engine = _attachTypesMap[attachType]; if (IsBeingDebugged()) { return(AttachResult.BeingDebugged); } var dbg = _dte.Debugger as Debugger2; var trans = dbg.Transports.Item("Default"); var eng = trans.Engines.Item(engine); Process2 proc = null; try { proc = dbg.GetProcesses(trans, "").Item(_processName) as Process2; } catch (Exception) { return(AttachResult.NotRunning); } proc.Attach2(eng); return(AttachResult.Attached); }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } this.score1 = ((decimal)this.user.ExtCredits1).ToString(); this.score2 = ((decimal)this.user.ExtCredits2).ToString(); this.score3 = ((decimal)this.user.ExtCredits3).ToString(); this.score4 = ((decimal)this.user.ExtCredits4).ToString(); this.score5 = ((decimal)this.user.ExtCredits5).ToString(); this.score6 = ((decimal)this.user.ExtCredits6).ToString(); this.score7 = ((decimal)this.user.ExtCredits7).ToString(); this.score8 = ((decimal)this.user.ExtCredits8).ToString(); if (!base.IsErr() && this.useradminid > 0) { this.admingroupinfo = AdminGroup.FindByID(this.usergroupid); } //var stringBuilder = new StringBuilder(); //if (!this.usergroupinfo.AttachExtensions.IsNullOrEmpty()) //{ // stringBuilder.AppendFormat("[id] in ({0})", this.usergroupinfo.AttachExtensions); //} //this.usergroupattachtype = Attachments.GetAttachmentTypeString(stringBuilder.ToString()); this.usergroupattachtype = AttachType.GetAttachmentTypeString(usergroupinfo, null); this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
protected void Page_Load(object sender, EventArgs e) { this.att.Columns.Add("typeid"); this.att.Columns.Add("typename"); this.att.Columns.Add("extname"); XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender(); xmlDocumentExtender.Load(base.Server.MapPath(BaseConfigs.GetForumPath + "config/myattachment.config")); XmlNodeList xmlNodeList = xmlDocumentExtender.SelectNodes("/MyAttachmentsTypeConfigInfo/attachtypes/AttachmentType"); foreach (XmlNode xmlNode in xmlNodeList) { DataRow dataRow = this.att.NewRow(); dataRow["typeid"] = xmlNode["TypeId"].InnerText; dataRow["typename"] = xmlNode["TypeName"].InnerText; dataRow["extname"] = ((xmlNode["ExtName"].InnerText != "") ? xmlNode["ExtName"].InnerText : "无绑定类型"); this.att.Rows.Add(dataRow); } //this.dt = Attachments.GetAttachmentType(); //Request["typeid"]; if (!this.Page.IsPostBack) { this.BindData(); string text = ""; if (this.att != null) { foreach (DataRow dataRow2 in this.att.Rows) { text = text + dataRow2["extname"].ToString() + ","; } text = text.TrimEnd(','); } this.attachextensions.AddTableData(AttachType.FindAllWithCache()); string[] array = text.Split(','); for (int i = 0; i < array.Length; i++) { string a = array[i]; for (int j = 0; j < this.attachextensions.Items.Count; j++) { if (a == this.attachextensions.Items[j].Text) { this.attachextensions.Items[j].Enabled = false; break; } } } string text2 = "var atttype = \r\n{"; if (this.att != null) { foreach (DataRow dataRow3 in this.att.Rows) { string text3 = text2; text2 = text3 + "\r\n\ttype" + dataRow3["typeid"].ToString() + ":{typename:'" + dataRow3["typename"].ToString() + "',extname:'" + dataRow3["extname"].ToString() + "'},"; } text2 = text2.TrimEnd(','); } text2 += "\r\n};"; base.RegisterStartupScript("", "<script type='text/javascript'>\r\n" + text2 + "\r\n</script>"); } }
private void radminid_SelectedIndexChanged(object sender, EventArgs e) { UserGroup userGroupInfo = UserGroup.FindByID(int.Parse(this.radminid.SelectedValue)); if (userGroupInfo != null) { this.creditshigher.Text = userGroupInfo.Creditslower.ToString(); this.creditslower.Text = userGroupInfo.Creditslower.ToString(); this.stars.Text = userGroupInfo.Stars.ToString(); this.color.Text = userGroupInfo.Color; this.groupavatar.Text = userGroupInfo.Groupavatar; this.readaccess.Text = userGroupInfo.Readaccess.ToString(); this.maxprice.Text = userGroupInfo.MaxPrice.ToString(); this.maxpmnum.Text = userGroupInfo.MaxPmNum.ToString(); this.maxsigsize.Text = userGroupInfo.MaxSigSize.ToString(); this.maxattachsize.Text = userGroupInfo.MaxAttachSize.ToString(); this.maxsizeperday.Text = userGroupInfo.MaxSizeperday.ToString(); DataTable attachmentType = AttachType.FindAllWithCache().ToDataTable(false); this.attachextensions.AddTableData(attachmentType, userGroupInfo.AttachExtensions); } AdminGroup adminGroupInfo = AdminGroup.FindByID(int.Parse(this.radminid.SelectedValue)); if (adminGroupInfo != null) { //admingroupright.SelectedIndex = -1; //admingroupright.Items[0].Selected = adminGroupInfo.AllowEditPost; //admingroupright.Items[1].Selected = adminGroupInfo.AllowEditpoll; //admingroupright.Items[2].Selected = adminGroupInfo.AllowDelPost; //admingroupright.Items[3].Selected = adminGroupInfo.AllowMassprune; //admingroupright.Items[4].Selected = adminGroupInfo.AllowViewIP; //admingroupright.Items[5].Selected = adminGroupInfo.AllowEditUser; //admingroupright.Items[6].Selected = adminGroupInfo.AllowViewLog; //admingroupright.Items[7].Selected = adminGroupInfo.DisablePostctrl; } }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.AddUserGroupInf.Click += new EventHandler(this.AddUserGroupInf_Click); //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); }
// Token: 0x06000014 RID: 20 RVA: 0x0000307C File Offset: 0x0000127C protected override void View() { if (this.ispost) { if (this.action == "delete") { DbHelper.ExecuteDelete <AttachType>(FPRequest.GetString("chkdel")); FPCache.Remove("FP_ATTACHTYPE", "image,flash,media,file"); } else if (this.action == "add") { AttachType attachType = FPRequest.GetModel <AttachType>(); DbHelper.ExecuteInsert <AttachType>(attachType); FPCache.Remove("FP_ATTACHTYPE" + attachType.type); } else if (this.action == "edit") { AttachType attachType = DbHelper.ExecuteModel <AttachType>(this.id); attachType = FPRequest.GetModel <AttachType>(attachType, "edit_"); DbHelper.ExecuteUpdate <AttachType>(attachType); FPCache.Remove("FP_ATTACHTYPE" + attachType.type); } base.Response.Redirect(this.pagename); } OrderByParam orderby = DbHelper.MakeOrderBy("type", OrderBy.ASC); this.attachlist = DbHelper.ExecuteList <AttachType>(orderby, new SqlParam[0]); base.SaveRightURL(); }
private AttachResult Attach(AttachType attachType) { string engine = _attachTypesMap[attachType]; if (IsBeingDebugged()) { return AttachResult.BeingDebugged; } var dbg = _dte.Debugger as Debugger2; var trans = dbg.Transports.Item("Default"); var eng = trans.Engines.Item(engine); Process2 proc = null; try { proc = dbg.GetProcesses(trans, "").Item(_processName) as Process2; } catch (Exception) { return AttachResult.NotRunning; } proc.Attach2(eng); return AttachResult.Attached; }
private AttachResult Attach(AttachType attachType) { string engine = _attachTypesMap[attachType]; if (IsBeingDebugged()) { return AttachResult.BeingDebugged; } var dbg = _dte.Debugger as Debugger2; var trans = dbg.Transports.Item("Default"); var eng = trans.Engines.Item(engine); EnvDTE80.Process2 proc = null; try { proc = dbg.GetProcesses(trans, "").Item(_processName) as EnvDTE80.Process2; } catch (Exception ex) { if (ex.Message.Contains("Invalid index.")) { return AttachResult.NotRunning; } } proc.Attach2(eng); return AttachResult.Attached; }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tonumber(L, 1); AttachType o = (AttachType)arg0; ToLua.Push(L, o); return(1); }
public void Detach(AttachType attachType) { KAS_Shared.DebugLog("Detach(Base) Attach type is : " + attachMode); // Docked if (attachType == AttachType.Docked) { if (dockedAttachModule.part.parent == this.part) { KAS_Shared.DebugLog("Detach(Base) Undocking " + dockedAttachModule.part.partInfo.title + " from " + dockedAttachModule.vessel.vesselName); dockedAttachModule.part.Undock(dockedAttachModule.vesselInfo); } if (this.part.parent == dockedAttachModule.part) { KAS_Shared.DebugLog("Detach(Base) Undocking " + this.part.partInfo.title + " from " + this.vessel.vesselName); this.part.Undock(this.vesselInfo); } dockedAttachModule.dockedAttachModule = null; this.dockedAttachModule = null; attachMode.Docked = false; } // Coupled if (attachType == AttachType.Coupled) { // Todo attachMode.Coupled = false; } // FixedJoint if (attachType == AttachType.FixedJoint) { KAS_Shared.DebugLog("Detach(Base) Removing fixed joint on " + this.part.partInfo.title); if (FixedAttach.fixedJoint) { Destroy(FixedAttach.fixedJoint); } FixedAttach.fixedJoint = null; FixedAttach.connectedPart = null; attachMode.FixedJoint = false; } // StaticJoint if (attachType == AttachType.StaticJoint) { KAS_Shared.DebugLog("Detach(Base) Removing static rigidbody and fixed joint on " + this.part.partInfo.title); if (StaticAttach.fixedJoint) { Destroy(StaticAttach.fixedJoint); } if (StaticAttach.connectedGameObject) { Destroy(StaticAttach.connectedGameObject); } StaticAttach.fixedJoint = null; StaticAttach.connectedGameObject = null; attachMode.StaticJoint = false; } }
// 播放光效 public void CreateParticle(string effectName, AttachType attachType, Vector3 pos, float delay = 0, float duration = 0) { GameObject prefab = Resources.Load <GameObject>(effectName); GameObject go = Instantiate(prefab); go.transform.position = pos; if (duration > 0) { // TODO:这里的销毁时间是Unity时间,需要改为服务器时间控制 Destroy(go, duration + 5); } }
private AttachResult PessimisticAttach(AttachType attachType) { var res = Attach(attachType); var timeout = DateTime.Now.AddSeconds(_waitTimeout); while (res == AttachResult.NotRunning && timeout > DateTime.Now) { res = Attach(attachType); Thread.Sleep(100); } return(res); }
private AttachResult PessimisticAttach(AttachType attachType) { AttachResult res = Attach(attachType); DateTime timeout = DateTime.Now.AddSeconds(_waitTimeout); while (res == AttachResult.NotRunning && timeout > DateTime.Now) { res = Attach(attachType); System.Threading.Thread.Sleep(100); } return res; }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.DeleteUserGroupInf.Click += new EventHandler(this.DeleteUserGroupInf_Click); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); if (Request["groupid"] != "") { this.LoadUserGroupInf(DNTRequest.GetInt("groupid", -1)); return; } base.Response.Redirect("usergroupgrid.aspx"); }
public void SetGroupRights(string groupid) { var userGroupInfo = UserGroup.FindByID(groupid.ToInt()); this.creditshigher.Text = userGroupInfo.Creditshigher.ToString(); this.creditslower.Text = userGroupInfo.Creditslower.ToString(); this.stars.Text = userGroupInfo.Stars.ToString(); this.color.Text = userGroupInfo.Color; this.groupavatar.Text = userGroupInfo.Groupavatar; this.readaccess.Text = userGroupInfo.Readaccess.ToString(); this.maxprice.Text = userGroupInfo.MaxPrice.ToString(); this.maxpmnum.Text = userGroupInfo.MaxPmNum.ToString(); this.maxsigsize.Text = userGroupInfo.MaxSigSize.ToString(); this.maxattachsize.Text = userGroupInfo.MaxAttachSize.ToString(); this.maxsizeperday.Text = userGroupInfo.MaxSizeperday.ToString(); this.radminid.SelectedValue = userGroupInfo.RadminID.ToString(); var attachmentType = AttachType.FindAllWithCache().ToDataTable(false); this.attachextensions.AddTableData(attachmentType, userGroupInfo.AttachExtensions); this.usergrouppowersetting.Bind(userGroupInfo); var adminGroupInfo = AdminGroup.FindByID(groupid.ToInt()); if (adminGroupInfo != null) { this.admingroupright.Items[0].Selected = adminGroupInfo.AllowEditPost; this.admingroupright.Items[1].Selected = adminGroupInfo.AllowEditpoll; this.admingroupright.Items[2].Selected = adminGroupInfo.AllowDelPost; this.admingroupright.Items[3].Selected = adminGroupInfo.AllowMassprune; this.admingroupright.Items[4].Selected = adminGroupInfo.AllowViewIP; this.admingroupright.Items[5].Selected = adminGroupInfo.AllowEditUser; this.admingroupright.Items[6].Selected = adminGroupInfo.AllowViewLog; this.admingroupright.Items[7].Selected = adminGroupInfo.DisablePostctrl; this.admingroupright.Items[8].Selected = adminGroupInfo.AllowViewrealName; this.admingroupright.Items[9].Selected = adminGroupInfo.AllowBanUser; this.admingroupright.Items[10].Selected = adminGroupInfo.AllowBanIP; this.admingroupright.Items[11].Selected = adminGroupInfo.AllowModPost; this.admingroupright.Items[12].Selected = adminGroupInfo.AllowPostannounce; var config = GeneralConfigInfo.Current; this.admingroupright.Items[13].Selected = (("," + config.Reportusergroup + ",").IndexOf("," + groupid + ",") != -1); this.admingroupright.Items[14].Selected = (("," + config.Photomangegroups + ",").IndexOf("," + groupid + ",") != -1); } if (this.radminid.SelectedValue == "1") { this.allowstickthread.Enabled = false; this.allowstickthread.SelectedValue = "3"; return; } this.allowstickthread.Enabled = true; }
private void InitializeComponent() { this.SubmitBatchSet.Click += new EventHandler(this.SubmitBatchSet_Click); //DataTable userGroupForDataTable = UserGroups.GetUserGroupForDataTable(); var userGroupForDataTable = UserGroup.GetAll(); this.viewperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.postperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.replyperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.getattachperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.postattachperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); this.LoadCurrentForumInfo(DNTRequest.GetInt("fid", -1)); }
private void DelRec_Click(object sender, EventArgs e) { if (base.CheckCookie()) { if (Request["id"] != "") { //Attachments.DeleteAttchType(Request["id"]); AttachType.FindAllByIDs(Request["id"]).Delete(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除附件类型", "删除附件类型,ID为:" + Request["id"].Replace("0 ", "")); base.Response.Redirect("forum_attachtypesgrid.aspx"); return; } base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='forum_attachtypesgrid.aspx';</script>"); } }
public void Attach(string processName, EngineType attachEngineType, AttachType attachType) { if (processName == String.Empty) { return; } bool found = false; Transport transport = _dbg.Transports.Item("default"); Engine[] engines = { transport.Engines.Item(attachEngineType.GetEngineName()) }; var outputWindow = GetOutputWindow(); foreach (Process2 process in _dbg.LocalProcesses) { string fileName = Path.GetFileName(process.Name); bool? validProcess = fileName?.Equals(processName, StringComparison.InvariantCultureIgnoreCase); if (validProcess == null || validProcess == false) { continue; } try { process.Attach2(engines); found = true; outputWindow?.OutputString($"Attach Toolbar: Attached to {processName}[{process.ProcessID}].{Environment.NewLine}"); if (attachType == AttachType.First) { break; } } catch { outputWindow?.OutputString($"Attach Toolbar: Failed to attach to {processName}[{process.ProcessID}].{Environment.NewLine}"); } } if (!found) { MessageBox.Show($"No processes with name {processName} are found.", "Attach Toolbar", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.radminid.SelectedIndexChanged += new EventHandler(this.radminid_SelectedIndexChanged); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.DeleteUserGroupInf.Click += new EventHandler(this.DeleteUserGroupInf_Click); this.radminid.Items.Add(new ListItem("请选择 ", "0")); foreach (UserGroup current in UserGroup.FindAll管理组()) { if (current.ID > 0 && current.ID <= 3) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); }
public void InitInfo() { this.targetforumid.BuildTree(XForum.Root, "name", "fid"); this.templateid.AddTableData(Template.GetValids(), "name", "id"); //DataTable dataTable = UserGroups.GetUserGroupForDataTable(); int num = 1; foreach (var ug in UserGroup.GetAll()) { HtmlTableRow htmlTableRow = new HtmlTableRow(); HtmlTableCell htmlTableCell = new HtmlTableCell("td"); if (num % 2 == 1) { htmlTableCell.Attributes.Add("class", "td_alternating_item1"); } else { htmlTableCell.Attributes.Add("class", "td_alternating_item2"); } htmlTableCell.Controls.Add(new LiteralControl("<input type='checkbox' id='r" + num + "' onclick='selectRow(" + num + ",this.checked)'><label for='r" + num + "'>" + ug.GroupTitle + "</lable>")); htmlTableRow.Cells.Add(htmlTableCell); htmlTableRow.Cells.Add(this.GetTD("viewperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("postperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("replyperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("getattachperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("postattachperm", ug.ID, num)); this.powerset.Rows.Add(htmlTableRow); num++; } //var dataTable = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); if (Request["fid"] != "") { this.targetforumid.SelectedValue = Request["fid"]; this.addtype.SelectedValue = "1"; this.targetforumid.Visible = true; } this.showcolnum.Attributes.Add("style", "display:none"); this.colcount.SelectedIndex = 0; this.colcount.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showcolnum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_colcount_0').checked ? 'none' : 'block');"); this.showclose.Attributes.Add("style", "display:none"); this.autocloseoption.SelectedIndex = 0; this.showtargetforum.Attributes.Add("style", "display:block"); this.addtype.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showtargetforum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_addtype_0').checked ? 'none' : 'block');setColDisplayer(document.getElementById('TabControl1_tabPage51_addtype_0').checked);"); this.autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage22_autocloseoption_0').checked ? 'none' : 'block');"); }
static int CreateParticle(IntPtr L) { try { ToLua.CheckArgsCount(L, 6); BattleController obj = (BattleController)ToLua.CheckObject(L, 1, typeof(BattleController)); string arg0 = ToLua.CheckString(L, 2); AttachType arg1 = (AttachType)ToLua.CheckObject(L, 3, typeof(AttachType)); UnityEngine.Vector3 arg2 = ToLua.ToVector3(L, 4); float arg3 = (float)LuaDLL.luaL_checknumber(L, 5); float arg4 = (float)LuaDLL.luaL_checknumber(L, 6); obj.CreateParticle(arg0, arg1, arg2, arg3, arg4); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.radminid.Items.Add(new ListItem("请选择 ", "0")); foreach (UserGroup current in UserGroup.FindAll管理组()) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); string @string = Request["groupid"]; if (@string != "") { this.LoadUserGroupInf(DNTRequest.GetInt("groupid", -1)); return; } base.Response.Redirect("sysglobal_sysadminusergroupgrid.aspx"); }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.TabControl1.SelectedIndex = DNTRequest.GetInt("tabindex", 0); this.SpecialUserList.PageIndexChanged += new DataGridPageChangedEventHandler(this.DataGrid_PageIndexChanged); this.TopicTypeDataGrid.ItemDataBound += new DataGridItemEventHandler(this.TopicTypeDataGrid_ItemDataBound); this.TopicTypeDataGrid.SortCommand += new DataGridSortCommandEventHandler(this.Sort_Grid); this.TopicTypeDataGrid.PageIndexChanged += new DataGridPageChangedEventHandler(this.TopicTypeDataGrid_PageIndexChanged); this.TopicTypeDataGrid.AllowCustomPaging = false; this.TopicTypeDataGrid.DataKeyField = "id"; this.TopicTypeDataGrid.ColumnSpan = 6; this.SubmitInfo.Click += new EventHandler(this.SubmitInfo_Click); this.RunForumStatic.Click += new EventHandler(this.RunForumStatic_Click); this.BindPower.Click += new EventHandler(this.BindPower_Click); this.DelButton.Click += new EventHandler(this.DelButton_Click); this.templateid.AddTableData(Template.GetValids(), "name", "id"); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); this.LoadCurrentForumInfo(DNTRequest.GetInt("fid", -1)); this.SpecialUserList.AllowPaging = true; this.SpecialUserList.DataKeyField = "id"; }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.AddUserGroupInf.Click += new EventHandler(this.AddUserGroupInf_Click); this.radminid.SelectedIndexChanged += new EventHandler(this.radminid_SelectedIndexChanged); //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); this.radminid.Items.Add(new ListItem("请选择", "0")); var adminUserGroup = UserGroup.FindAll管理组(); foreach (var current in adminUserGroup) { if (current.ID > 0 && current.ID <= 3) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } if (Request["groupid"] != "") { this.SetGroupRights(Request["groupid"]); } }
public void Attach(String path, AttachType type) { if (type == AttachType.Main) { try { this.mainCtx = new MainContext(this.BuildConnection(path)); this.ValidateDbSchema(this.mainCtx.Database, this.mainDbSchema); } catch { if (this.mainCtx != null) { this.mainCtx.Dispose(); this.mainCtx = null; } throw; } } else if (type == AttachType.Levels) { try { this.levelsCtx = new LevelsContext(this.BuildConnection(path)); this.ValidateDbSchema(this.levelsCtx.Database, this.levelDbSchema); } catch { if (this.levelsCtx != null) { this.levelsCtx.Dispose(); this.levelsCtx = null; } throw; } } }
internal static IEntity GetEntityByAttach(long entity, AttachType type) { switch (type) { case AttachType.None: return(null); case AttachType.Player: return(Server.PlayerPool.GetEntity(entity)); case AttachType.Vehicle: return(null); //TODO case AttachType.Object: return(Server.ObjectPool.GetEntity(entity)); case AttachType.NPC: return(Server.NPCPool.GetEntity(entity)); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
private void SaveAttachType_Click(object sender, EventArgs e) { int num = 0; bool flag = false; foreach (object current in this.DataGrid1.GetKeyIDArray()) { string text = this.DataGrid1.GetControlValue(num, "extension").Trim(); string text2 = this.DataGrid1.GetControlValue(num, "maxsize").Trim(); int num2; if (String.IsNullOrEmpty(text) || String.IsNullOrEmpty(text2) || !int.TryParse(text2, out num2)) { flag = true; } else { //Attachments.UpdateAttchType(text, text2, int.Parse(current.ToString())); var at = AttachType.FindByID(current.ToInt()); if (at != null) { at.Extension = text; at.MaxSize = text2.ToInt(); at.Save(); } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "编辑附件类型", "编辑附件类型,扩展名为:" + text); num++; } } //XCache.Remove(CacheKeys.FORUM_FORUM_SETTING_ATTACHMENT_TYPE); if (flag) { base.RegisterStartupScript("", "<script>alert('某些记录取值不正确,未能被更新!');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } base.RegisterStartupScript("PAGE", "window.location.href='forum_attachtypesgrid.aspx';"); }
public void Detach(AttachType attachType) { KAS_Shared.DebugLog(string.Format( "Detach(Base) Attach mode is Docked:{0},Coupled:{1},FixedJoint:{2},StaticJoint:{3}", attachMode.Docked, attachMode.Coupled, attachMode.FixedJoint, attachMode.StaticJoint)); KAS_Shared.DebugLog(string.Format("Detach(Base) Attach type is : {0}", attachType)); // Docked if (attachType == AttachType.Docked) { if (dockedAttachModule.part.parent == this.part) { KAS_Shared.DebugLog(string.Format("Detach(Base) Undocking {0} from {1}", dockedAttachModule.part.partInfo.title, dockedAttachModule.vessel.vesselName)); dockedAttachModule.UndockVessel(); } if (this.part.parent == dockedAttachModule.part) { KAS_Shared.DebugLog(string.Format( "Detach(Base) Undocking {0} from {1}", part.partInfo.title, vessel.vesselName)); this.UndockVessel(); } if (dockedAttachModule.dockedAttachModule == this) { dockedAttachModule.dockedAttachModule = null; dockedAttachModule.dockedPartID = null; dockedAttachModule.attachMode.Docked = false; } dockedAttachModule = null; dockedPartID = null; attachMode.Docked = false; } // Coupled if (attachType == AttachType.Coupled) { // TODO??? attachMode.Coupled = false; } // FixedJoint if (attachType == AttachType.FixedJoint) { KAS_Shared.DebugLog(string.Format( "Detach(Base) Removing fixed joint on {0}", FixedAttach.srcPart.partInfo.title)); if (FixedAttach.fixedJoint) { Destroy(FixedAttach.fixedJoint); } SetCreateJointOnUnpack(false); FixedAttach.fixedJoint = null; FixedAttach.tgtPart = null; attachMode.FixedJoint = false; } // StaticJoint if (attachType == AttachType.StaticJoint) { KAS_Shared.DebugLog(string.Format( "Detach(Base) Removing static rigidbody and fixed joint on {0}", part.partInfo.title)); if (StaticAttach.fixedJoint) { Destroy(StaticAttach.fixedJoint); } if (StaticAttach.connectedGameObject) { Destroy(StaticAttach.connectedGameObject); } StaticAttach.fixedJoint = null; StaticAttach.connectedGameObject = null; attachMode.StaticJoint = false; } }
/// <summary> /// 批量上传 /// </summary> /// <param name="paramList"></param> /// <returns></returns> public List <Sys_AttachFilesResult> UploadAttach(List <Sys_AttachFilesResult> list) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); try { #region 判断 if (list.Count <= 0) { throw new WarnException("没有需要操作的对象!"); } if (list.Exists(a => a.AttachType == null)) { throw new WarnException("没有设置上传的附件类型!"); } #endregion AttachType type = list[0].AttachType; string attachType = string.Empty; switch (type) { case AttachType.Bill: attachType = "Bill"; break; case AttachType.Pic: attachType = "Pic"; break; } Sys_RootDirMappingBLL mBLL = new Sys_RootDirMappingBLL(); mBLL.SessionInfo = this.SessionInfo; //获取根目录 Sys_RootDirMappingResult mRst = mBLL.GetInfo(new Sys_RootDirMappingParam() { AttachType = attachType, IsEffect = true }); if (mRst == null) { throw new WarnException("根目录映射表没有有效的设置信息!"); } mRst.PhysicalRootPath = mRst.PhysicalRootPath.Replace("{Company}", this.SessionInfo.CompanyID.ToStringHasNull()); //设置文件目录 string folderPath = mRst.PhysicalRootPath + @"\" + DateTime.Now.Year + @"\" + DateTime.Now.ToString("yyyyMMdd"); string thumbnailFolderPath = string.Empty; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } ////如果有图片才形成压缩图片的存放目录 //if (list.Exists(a => ".bmp.png.jpg.gif.jpeg.BMP.PNG.JPG.GIF.JPEG".Contains(a.FileSuffix))) //{ // //设置压缩图片的存放目录 // thumbnailFolderPath= folderPath + @"\Thumbnail"; // if (!Directory.Exists(thumbnailFolderPath)) // { // Directory.CreateDirectory(thumbnailFolderPath); // } //} foreach (Sys_AttachFilesResult rst in list) { rst.FileName = DateTime.Now.ToString("yyyyMMddHHmmssms") + new Random().Next(10000, 99999); rst.FilePath = folderPath + @"\" + rst.FileName + rst.FileSuffix; using (FileStream fs = new FileStream(rst.FilePath, FileMode.CreateNew)) { fs.Write(rst.File, 0, rst.FileSize.ToInt32()); fs.Close(); } if (rst.TBNFile != null) { rst.TBNFileName = rst.FileName + "_TBN" + ".JPG";; rst.TBNFilePath = folderPath + @"\" + rst.TBNFileName; using (FileStream fs = new FileStream(rst.TBNFilePath, FileMode.CreateNew)) { fs.Write(rst.TBNFile, 0, rst.TBNFile.Length.ToInt32()); fs.Close(); } } } } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(list); }
public void Detach(AttachType attachType) { KAS_Shared.DebugLog("Detach(Base) Attach type is : " + attachMode); // Docked if (attachType == AttachType.Docked) { if (dockedAttachModule.part.parent == this.part) { KAS_Shared.DebugLog("Detach(Base) Undocking " + dockedAttachModule.part.partInfo.title + " from " + dockedAttachModule.vessel.vesselName); dockedAttachModule.part.Undock(dockedAttachModule.vesselInfo); } if (this.part.parent == dockedAttachModule.part) { KAS_Shared.DebugLog("Detach(Base) Undocking " + this.part.partInfo.title + " from " + this.vessel.vesselName); this.part.Undock(this.vesselInfo); } if (dockedAttachModule.dockedAttachModule == this) { dockedAttachModule.dockedAttachModule = null; dockedAttachModule.dockedPartID = null; dockedAttachModule.attachMode.Docked = false; } this.dockedAttachModule = null; this.dockedPartID = null; attachMode.Docked = false; } // Coupled if (attachType == AttachType.Coupled) { // Todo attachMode.Coupled = false; } // FixedJoint if (attachType == AttachType.FixedJoint) { KAS_Shared.DebugLog("Detach(Base) Removing fixed joint on " + this.part.partInfo.title); if (FixedAttach.fixedJoint) Destroy(FixedAttach.fixedJoint); SetCreateJointOnUnpack(false); FixedAttach.fixedJoint = null; FixedAttach.connectedPart = null; attachMode.FixedJoint = false; } // StaticJoint if (attachType == AttachType.StaticJoint) { KAS_Shared.DebugLog("Detach(Base) Removing static rigidbody and fixed joint on " + this.part.partInfo.title); if (StaticAttach.fixedJoint) Destroy(StaticAttach.fixedJoint); if (StaticAttach.connectedGameObject) Destroy(StaticAttach.connectedGameObject); StaticAttach.fixedJoint = null; StaticAttach.connectedGameObject = null; attachMode.StaticJoint = false; } }
internal AttachmentInfo(AttachType type, Entity target) { Type = type; Target = target; }
private AttachResult PessimisticAttach(AttachType attachType) { var res = Attach(attachType); var timeout = DateTime.Now.AddSeconds(_waitTimeout); while (res == AttachResult.NotRunning && timeout > DateTime.Now) { res = Attach(attachType); Thread.Sleep(100); } return res; }