internal CommandLineAction() { overrides = new AttrOverride(GetType()); Aliases = new AliasCollection(() => { return Metadata.Metas<ArgShortcut>(); }, () => { return IgnoreCase; },stripLeadingArgInticatorsOnAttributeValues: false); PropertyInitializer.InitializeFields(this, 1); IgnoreCase = true; }
void OnMoneyChanged(object sender, ChangeEventArgs e) { AliasCollection view = this.AliasDataGrid.ItemsSource as AliasCollection; while (e != null) { if (e.Item is Payee) { payeesDirty = true; break; } else if (e.Item is Alias && e.Item != rowEdit) { if (e.ChangeType == ChangeType.Inserted && view != null && view.Contains((Alias)e.Item)) { // ignore newly inserted items } else if (!this.AliasDataGrid.IsEditing) // ignore changes if grid is being edited. { dirty = true; break; } } e = e.Next; } if (dirty || payeesDirty && this.IsVisible) { // start delayed update delayedActions.StartDelayedAction("RefreshList", RefreshList, TimeSpan.FromMilliseconds(50)); } }
internal CommandLineArgument() { overrides = new AttrOverride(); Aliases = new AliasCollection(() => { return Metadata.Metas<ArgShortcut>(); }, () => { return IgnoreCase; }); PropertyInitializer.InitializeFields(this, 1); ArgumentType = typeof(string); Position = -1; }
//移除以前版本信息 public void RemoveHistoryMenu() { try { PopMenu historyPopMenu = null; foreach (PopMenu tpm in mainCs.MenuGroup.PopMenus) { AliasCollection acs = tpm.Aliases; foreach (var ac in acs) { string acstr = ac as string; if (!string.IsNullOrEmpty(acstr) && acstr.ToUpper().StartsWith("CMCUPLUGIN")) { historyPopMenu = tpm; } if (historyPopMenu != null) { foreach (Workspace wk in mainCs.Workspaces) { WorkspacePopMenu wkPm = wk.WorkspacePopMenus.FindWorkspacePopMenu(historyPopMenu.ElementID, historyPopMenu.Parent.Name); if (wkPm != null) { wk.WorkspacePopMenus.Remove(wkPm); } } mainCs.MenuGroup.PopMenus.Remove(historyPopMenu); // Deletes the Menu from ACAD Menu Group MacroGroup deleteMacroGroup = null; MacroGroupCollection mgc = mainCs.MenuGroup.MacroGroups; List <int> indexList = new List <int>(); foreach (MacroGroup mg in mgc) { if (mg.Name.ToUpper().StartsWith("CMCUMACRO")) { deleteMacroGroup = mg; } if (deleteMacroGroup != null) { indexList.Add(mgc.IndexOf(deleteMacroGroup)); } } indexList.Reverse(); foreach (int index in indexList) { mainCs.MenuGroup.MacroGroups.Remove(index); } } } } } catch (System.Exception e) { ed.WriteMessage("\n异常:" + e.Message); } }
//取到当前PopMenu中Cmcu的菜单 private PopMenu GetCurrentTopPopMenu() { PopMenu pm = null; foreach (PopMenu tpm in mainCs.MenuGroup.PopMenus) { AliasCollection acs = tpm.Aliases; foreach (var ac in acs) { string acstr = ac as string; if (!string.IsNullOrEmpty(acstr) && acstr.ToUpper().Equals("CMCUPLUGIN" + localPluginVersion)) { pm = tpm; break; } } if (pm != null) { break; } } return(pm); }
/// <summary> /// 根据业务对象ID和业务域查询业务对象别名 /// </summary> /// <param name="boid">业务对象ID</param> /// <param name="appdomains">业务域</param> /// <returns></returns> public AliasCollection GetBOAliasByID(string boid, params string[] appdomains) { AliasCollection aliasColl = new AliasCollection(); foreach (var item in appdomains) { StringBuilder strSql = new StringBuilder(); strSql.Append(" SELECT * FROM ALIASNAME "); strSql.Append(" WHERE BOID =@BOID AND APPDOMAIN=@APPDOMAIN"); SqlParameter[] parameters = { new SqlParameter("BOID", SqlDbType.VarChar, 36), new SqlParameter("APPDOMAIN", SqlDbType.VarChar, 50) }; parameters[0].Value = boid; parameters[1].Value = item; List <Alias> list = SqlServerDBHelper.ExecuteQueryText <Alias>(strSql.ToString(), parameters); aliasColl.AddRange(list); } return(aliasColl); }
private void ValidateActionAliases() { Func<List<ArgShortcut>> shortcutEval = () => { return new List<ArgShortcut>(); }; AliasCollection aliases = new AliasCollection(shortcutEval, () => { if (Actions.Count() == 0) return true; return Actions.First().IgnoreCase; }); foreach(var action in Actions) { aliases.AddRange(action.Aliases); } }
public Person() { Aliases = new AliasCollection(); }