private Guid GetId(IPluginExecutionContext context, string entityName) { switch (context.MessageName) { case MessageName.Create: if (context.OutputParameters.Contains(ParameterName.Id)) { return((Guid)context.OutputParameters[ParameterName.Id]); } break; case MessageName.Update: if (context.InputParameters[ParameterName.Target] is DynamicEntity) { Key key = (Key)((DynamicEntity)context.InputParameters[ParameterName.Target]).Properties[entityName + "id"]; return(key.Value); } break; case MessageName.Delete: if (context.InputParameters[ParameterName.Target] is Moniker) { Moniker monikerId = (Moniker)context.InputParameters[ParameterName.Target]; return(monikerId.Id); } break; } return(Guid.Empty); }
private void SetVersionWindowsStore() { if (Moniker.StartsWith("netcore [", true, CultureInfo.InvariantCulture)) { // netcore [netcore45] var startIndex = Moniker.IndexOf("[netcore", StringComparison.Ordinal); var endIndex = Moniker.IndexOf("]", StringComparison.Ordinal); if (endIndex > 0) { var ver = Moniker.Substring(startIndex + 8, endIndex - startIndex - 8); Version = VersionNumberFormatter.Format(ver); } } else { // netcore451 [win81] // netcore451 var startIndex = Moniker.IndexOf("[", StringComparison.Ordinal); if (startIndex < 1) { Version = VersionNumberFormatter.Format(Moniker.Substring(7)); } else { Version = VersionNumberFormatter.Format(Moniker.Substring(7, startIndex - 7)); } } }
private void SetVersionUniversalWindowsPlatform() { if (Moniker.StartsWith("uap [", true, CultureInfo.InvariantCulture)) { // uap [uap10.0] var startIndex = Moniker.IndexOf("[uap", StringComparison.Ordinal); var endIndex = Moniker.IndexOf("]", StringComparison.Ordinal); if (endIndex > 0) { var ver = Moniker.Substring(startIndex + 4, endIndex - startIndex - 4); Version = VersionNumberFormatter.Format(ver); } } else { // uap10.0 [win10] [netcore50] var startIndex = Moniker.IndexOf("[", StringComparison.Ordinal); if (startIndex < 1) { Version = VersionNumberFormatter.Format(Moniker.Substring(3)); } else { Version = VersionNumberFormatter.Format(Moniker.Substring(3, startIndex - 3)); } } }
/// <summary> /// Get a specific PropertyBag value from a moniker /// </summary> /// <param name="sPropName">The name of the value to retrieve</param> /// <returns>String or null on error</returns> public string GetPropBagValue(string sPropName) { string ret; object bagObj = null; try { var bagId = typeof(IPropertyBag).GUID; Moniker.BindToStorage(null, null, ref bagId, out bagObj); var bag = (IPropertyBag)bagObj; var hr = bag.Read(sPropName, out object val, null); DsError.ThrowExceptionForHR(hr); ret = val as string; } catch { ret = null; } finally { if (bagObj != null) { Marshal.ReleaseComObject(bagObj); } } return(ret); }
private void SetVersionWindowsPhone() { if (Moniker.StartsWith("wpa", true, CultureInfo.InvariantCulture)) { // wpa81 Version = VersionNumberFormatter.Format(Moniker.Substring(3)); } else if (Moniker.StartsWith("wp [", true, CultureInfo.InvariantCulture)) { // wp [wp71] var startIndex = Moniker.IndexOf("[wp", StringComparison.Ordinal); var endIndex = Moniker.IndexOf("]", StringComparison.Ordinal); if (endIndex < 1) { Version = string.Empty; } else { var ver = Moniker.Substring(startIndex + 3, endIndex - startIndex - 3); Version = VersionNumberFormatter.Format(ver); } } else { Version = VersionNumberFormatter.Format(Moniker.Substring(2)); } }
public static void SetHtmlContent(this System.Windows.Forms.WebBrowser webBrowser, string html, string baseUrl) { webBrowser.Navigate("about:blank"); var browser = (IWebBrowser2)webBrowser.ActiveXInstance; var result = CreateStreamOnHGlobal(Marshal.StringToHGlobalAuto(html), true, out IStream stream); if ((result != 0) || (stream == null)) { return; } var persistentMoniker = browser.Document as IPersistMoniker; if (persistentMoniker == null) { return; } IBindCtx bindContext = null; CreateBindCtx((uint)0, out bindContext); if (bindContext == null) { return; } var loader = new Moniker(baseUrl, html); persistentMoniker.Load(1, loader, bindContext, (uint)0); stream = null; }
private void btnOK_Click(object sender, EventArgs e) { try { IBindCtx bind_context = COMUtilities.CreateBindCtx(0); if (checkBoxParseComposite.Checked) { foreach (string m in textBoxMoniker.Text.Split('!')) { IMoniker moniker = ParseMoniker(bind_context, m); if (Moniker != null) { Moniker.ComposeWith(moniker, false, out moniker); } Moniker = moniker; } } else { Moniker = ParseMoniker(bind_context, textBoxMoniker.Text); } MonikerString = textBoxMoniker.Text; BindContext = bind_context; DialogResult = DialogResult.OK; Close(); } catch (Exception ex) { Program.ShowError(this, ex); } }
protected override void OnUnresolvedMoniker(SerializationResult serializationResult, Moniker moniker) { /* if (moniker.Link is SerializationClassReferencesChildren || moniker.Link is SerializationClassReferencesAttributes || moniker.Link is DomainClassReferencesBaseClass || moniker.Link is DomainRelationshipReferencesBaseRelationship || moniker.Link is TreeNodeReferencesInheritanceNodes || moniker.Link is TreeNodeReferencesEmbeddingRSNodes || moniker.Link is TreeNodeReferencesReferenceRSNodes || moniker.Link is TreeNodeReferencesShapeClassNodes) {*/ if( moniker.Link != null ) { // TODO string name = moniker.Link.ToString() + " - " + moniker.MonikerName; moniker.DeleteLink(); SerializationUtilities.AddMessage(serializationResult, moniker.Location, SerializationMessageKind.Warning, "Moniker could not be resolved; The link was deleted from the model. " + name, moniker.Line, moniker.Column); } else base.OnUnresolvedMoniker(serializationResult, moniker); }
public static bool IsMonikerHero(Moniker moniker) { return(moniker == Moniker.Warrior || moniker == Moniker.WarriorChakra || moniker == Moniker.Cleric || moniker == Moniker.ClericChakra || moniker == Moniker.Wizard || moniker == Moniker.WizardChakra); }
public bool Equals(ITargetFramework obj) { if (obj != null) { return(Moniker.Equals(obj.Moniker, StringComparison.OrdinalIgnoreCase)); } return(false); }
private BtlCtrlCharacter MakeTutCharacter(Moniker moniker, int id, int level, bool isActive) { BtlCtrlCharacter character = _dataFiller.FillCharacterData(moniker, level, BattleControllerType.Tutorial_Zahak); character.id = id; character.isActive = isActive; return(character); }
private void SetTypeAndVersion() { FrameworkType = TargetFrameworkType.Unknown; Version = string.Empty; if (Moniker.StartsWith("net6", true, CultureInfo.InvariantCulture) || Moniker.StartsWith("net5", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Core; SetVersionDotNet5Plus(); } else if (Moniker.StartsWith("netcoreapp", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Core; Version = Moniker.Substring(10); } else if (Moniker.StartsWith("netstandard", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Standard; Version = Moniker.Substring(11); } else if (Moniker.StartsWith("netmf", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.MicroFramework; } else if (Moniker.StartsWith("v", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Framework; Version = Moniker.Substring(1); } else if (Moniker.StartsWith("sl", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Silverlight; Version = Moniker.Substring(2); } else if (Moniker.StartsWith("wp", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.WindowsPhone; SetVersionWindowsPhone(); } else if (Moniker.StartsWith("uap", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.UniversalWindowsPlatform; SetVersionUniversalWindowsPlatform(); } else if (Moniker.StartsWith("netcore", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.WindowsStore; SetVersionWindowsStore(); } else if (Moniker.StartsWith("net", true, CultureInfo.InvariantCulture)) { FrameworkType = TargetFrameworkType.Framework; Version = VersionNumberFormatter.Format(Moniker.Substring(3)); } }
public static bool IsCharNewAndUnseen(Moniker moniker) { if (!DoesAnyUnseenNewCharExists()) { return(false); } string key = KEY__NEW_CHAR + moniker; return(DataAccessManager.HasKey(key)); }
/// <summary> /// Need to override this to ensure it can be hashed correctly /// </summary> public override int GetHashCode() { if (Moniker == null) { return(string.Empty.GetHashCode()); } else { return(Moniker.ToLowerInvariant().GetHashCode()); } }
private void SetVersionDotNet5Plus() { var segments = Moniker.Split('-'); Version = segments[0].Substring(3); // net5.0 if (segments.Length > 1) { // net5.0-windows OperatingSystem = segments[1]; } }
public static List <Record> CreateRecords(this DbFactory f, int userId, DateTime from, DateTime until, int count, Action <Record> overrides = null) { var storage = f.CreateStorage(userId); var category = f.Create <Category>(_ => _.UserId = userId); var result = new List <Record>(); // create boundary values if (count >= 2) { result.Add(f.Create <Record>(item => { item.CategoryId = category.Id; item.StorageId = storage.Id; item.CurrencyId = storage.CurrencyId; item.Date = from; item.UserId = userId; overrides?.Invoke(item); })); result.Add(f.Create <Record>(item => { item.CategoryId = category.Id; item.StorageId = storage.Id; item.CurrencyId = storage.CurrencyId; item.Date = until; item.UserId = userId; overrides?.Invoke(item); })); count -= 2; } while (count-- > 0) { result.Add(f.Create <Record>(item => { item.CategoryId = category.Id; item.StorageId = storage.Id; item.CurrencyId = storage.CurrencyId; item.Date = Moniker.DateTimeBetween(from, until); item.UserId = userId; overrides?.Invoke(item); })); } return(result); }
public static void TrySetCharAsNew(Moniker moniker) { string key = KEY__NEW_CHAR + moniker; if (DataAccessManager.HasKey(key)) { return; } DataAccessManager.SaveStringToDisk(key, moniker.ToString()); NumOfUnseenNewChars++; if (Event_CharIsNewStateChanged != null) { Event_CharIsNewStateChanged(moniker, true); } }
public static void TryDeleteCharAsNew(Moniker moniker) { string key = KEY__NEW_CHAR + moniker; if (!DataAccessManager.HasKey(key)) { return; } DataAccessManager.DeleteStringFromDisk(key); NumOfUnseenNewChars--; if (Event_CharIsNewStateChanged != null) { Event_CharIsNewStateChanged(moniker, false); } }
// /// <summary> /// Make a record inactive /// </summary> /// <param name="dynamicEntityObject">Entity</param> /// <param name="service">CrmService Proxy</param> public static void SetInactive(this DynamicEntity dynamicEntityObject, CrmService crmServiceProxy) { try { SetStateDynamicEntityRequest setInactiveRequest = new SetStateDynamicEntityRequest(); Key recordGuid = (Key)dynamicEntityObject[dynamicEntityObject.Name + "id"]; Moniker entityMoniker = new Moniker(dynamicEntityObject.Name, recordGuid.Value); //HACK: Might not work always since the status are different for quite a few entities setInactiveRequest.Entity = entityMoniker; setInactiveRequest.Status = -1; setInactiveRequest.State = "Inactive"; SetStateDynamicEntityResponse setInactiveResponse = (SetStateDynamicEntityResponse)crmServiceProxy.Execute(setInactiveRequest); } catch (System.Web.Services.Protocols.SoapException) { throw; } }
private void CameraResolutionComboBox_SelectedIndexChanged(object sender, EventArgs e) { DisposeCamera(); if (Moniker != null && Resolution != null) { try { NetCamera = new NetCameraProxy(Moniker, Resolution); Settings.Get <Settings>().Write(Settings.LAST_USED, Settings.CAMERA_RESOLUTION, Resolution.ToString()); Guid id; Moniker.GetClassID(out id); Settings.Get <Settings>().Write(Settings.LAST_USED, Settings.CAMERA_DEVICE, id.ToString()); Proxy = NetCamera; this.CameraControl.Proxy = Proxy; } catch { } } }
/// <summary> /// Sets the state for the record /// </summary> /// <param name="dynamicEntityObject"></param> /// <param name="service">CrmService</param> /// <param name="status">status code</param> /// <param name="state">Status text</param> public static void SetState(this DynamicEntity dynamicEntityObject, ICrmService service, int status, String state) { try { SetStateDynamicEntityRequest setInactiveRequest = new SetStateDynamicEntityRequest(); Key recordGuid = (Key)dynamicEntityObject[dynamicEntityObject.Name + "id"]; Moniker entityMoniker = new Moniker(dynamicEntityObject.Name, recordGuid.Value); setInactiveRequest.Entity = entityMoniker; setInactiveRequest.Status = status; setInactiveRequest.State = state; SetStateDynamicEntityResponse setInactiveResponse = (SetStateDynamicEntityResponse)service.Execute(setInactiveRequest); } catch (System.Web.Services.Protocols.SoapException) { throw; } }
private bool VisitRolePlayers(ElementLink link) { bool keepVisiting = true; DomainRelationshipInfo domainRelInfo = link.GetDomainRelationship(); IList <DomainRoleInfo> domainRoles = domainRelInfo.DomainRoles; for (int i = 0; i < domainRoles.Count && keepVisiting; i++) { DomainRoleInfo role = domainRoles[i]; // Since GetRolePlayer will do demand-loading, we first need to test here whether // role supports demand loading and if it is, don't load if not asked to. if (this.BypassDemandLoading) { Moniker rolePlayerMoniker = role.GetRolePlayerMoniker(link); if (rolePlayerMoniker != null && rolePlayerMoniker.ModelElement == null) { // skip this role if it's not resolved yet continue; } } ModelElement rolePlayer = role.GetRolePlayer(link); // Find each roleplayer and add them to the queue list // RolePlayer might be null if it is an unresolved moniker if ((rolePlayer != link) && (rolePlayer != null) && !Visited(rolePlayer) && (Filter.ShouldVisitRolePlayer(this, link, link, role, rolePlayer) == VisitorFilterResult.Yes)) { keepVisiting = DoVisitElement(rolePlayer); } } return(keepVisiting); }
/// <nodoc/> public override int GetHashCode() { return(Moniker.GetHashCode()); }
public override int GetHashCode() { return(HashHelpers.CombineHashes(Moniker.GetHashCode(), Attributes.GetHashCode())); }
/// <summary> /// Retrieves EntityId from the Context /// Create,Update,Delete,SetState,Assign,DeliverIncoming /// </summary> /// <param name="context"></param> /// <returns></returns> public static Guid GetEntityId(IPluginExecutionContext context) { switch (context.MessageName) { case MessageName.Create: case MessageName.DeliverIncoming: if (context.Stage == MessageProcessingStage.BeforeMainOperationOutsideTransaction) { //throw new InvalidPluginExecutionException("EntityId is not available in PreCreate"); return(Guid.Empty); } else { //CreateResponse r; //r.id; if (context.OutputParameters.Contains(ParameterName.Id)) { return((Guid)context.OutputParameters[ParameterName.Id]); } //DeliverIncomingEmailResponse r; //r.EmailId; if (context.OutputParameters.Contains(ParameterName.EmailId)) { return((Guid)context.OutputParameters[ParameterName.EmailId]); } } break; case MessageName.Update: //context.InputParameters.Contains(ParameterName.Target) IMetadataService metadataService = context.CreateMetadataService(false); RetrieveEntityRequest rar = new RetrieveEntityRequest(); rar.LogicalName = context.PrimaryEntityName; rar.EntityItems = EntityItems.IncludeAttributes; RetrieveEntityResponse resp = (RetrieveEntityResponse)metadataService.Execute(rar); string keyName = resp.EntityMetadata.PrimaryKey; //UpdateRequest u; //TargetUpdateAccount a; //a.Account; // This s Dynamic entity //u.Target = a; // Update if (context.InputParameters[ParameterName.Target] is DynamicEntity) { Key key = (Key)((DynamicEntity)context.InputParameters[ParameterName.Target]).Properties[keyName]; return(key.Value); } break; case MessageName.Delete: case MessageName.Assign: case MessageName.GrantAccess: case MessageName.Handle: if (context.InputParameters[ParameterName.Target] is Moniker) { Moniker monikerId = (Moniker)context.InputParameters[ParameterName.Target]; return(monikerId.Id); } break; case MessageName.SetState: case MessageName.SetStateDynamicEntity: //SetStateAccountRequest r; //r.EntityId; // Guid === Moniker //r.AccountState; // State //r.AccountStatus; // Status return(((Moniker)context.InputParameters.Properties[ParameterName.EntityMoniker]).Id);; default: if (context.InputParameters.Contains(ParameterName.Target) && (context.InputParameters[ParameterName.Target] is Moniker)) { Moniker monikerId = (Moniker)context.InputParameters[ParameterName.Target]; return(monikerId.Id); } //Try by best route else fail //throw new InvalidPluginExecutionException("GetEntityId could not extract the Guid from Context"); return(Guid.Empty); } //throw new InvalidPluginExecutionException("GetEntityId could not extract the Guid from Context"); return(Guid.Empty); }
private static void DefineModels(DbFactory f) { f.Define <UserModel>(e => { e.Name = Moniker.UserName; e.Password = Moniker.UserPassword; }); f.Define <CategoryModel>(e => { e.Name = Moniker.Category; }); f.Define <CurrencyModel>(e => { e.Name = Moniker.Currency; e.Code = Moniker.CurrencyCode; e.Symbol = Moniker.CurrencySymbol; e.IsActive = true; e.IsMain = false; }); f.Define <StorageGroupModel>(e => { e.Name = Moniker.StorageGroup; }); f.Define <StorageModel>(e => { e.Name = "Storage"; e.Value = Moniker.Digit; }); f.Define <CurrencyExchangeRateModel>(e => { e.Rate = Moniker.LimitedDigit(30); }); f.Define <DebtModel>(e => { e.Description = "Take Debt"; e.DebtType = DebtType.TakeBorrow; e.TakingDate = DateTime.Today; e.Value = Moniker.Digit; }); f.Define <RecordModel>(e => { e.Description = "Record"; e.RecordType = RecordType.Expense; e.Date = DateTime.Now; e.Value = Moniker.Digit; }); f.Define <LimitModel>(e => { e.Value = Moniker.Digit; }); f.Define <MoneyTransferEventModel>(e => { e.Description = "MoneyTransferEvent"; e.Value = Moniker.Digit; e.EventState = EventState.Active; e.AutoExecution = false; e.ConfirmBeforeExecute = false; }); f.Define <RepayDebtEventModel>(e => { e.Description = "RepayDebtEvent"; e.Value = Moniker.Digit; e.EventState = EventState.Active; e.AutoExecution = false; e.ConfirmBeforeExecute = false; }); f.Define <SimpleEventModel>(e => { e.Description = "RepayDebtEvent"; e.Value = Moniker.Digit; e.EventState = EventState.Active; e.AutoExecution = false; e.ConfirmBeforeExecute = false; e.RecordType = RecordType.Expense; }); }
public override ModelElement ResolveMoniker(Moniker moniker) { Microsoft.VisualStudio.Modeling.ModelElement modelElement; #region PropertyGridEditor if (moniker.DomainRelationshipInfo.Id == DomainTypeReferencesPropertyGridEditor.DomainClassId) { propertyGridEditorTypeLookup.TryGetValue(moniker.MonikerName, out modelElement); if (modelElement == null) { string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); if (name.Length > 1) { string modelName = name[0]; string editorName = name[1]; MetaModel model = FindMetaModel(moniker.Store, modelName); if (model != null) { foreach (PropertyGridEditor editor in model.PropertyGridEditors) if (editor.Name == editorName) { modelElement = editor; propertyGridEditorTypeLookup[moniker.MonikerName] = editor; break; } } } return modelElement; } else return modelElement; } #endregion #region DomainEnumeration and ExternalType if (moniker.DomainRelationshipInfo.Id == DomainPropertyReferencesType.DomainClassId) { typeLookup.TryGetValue(moniker.MonikerName, out modelElement); if (modelElement == null) { string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); if (name.Length > 2) { string modelName = name[0]; string namespaceStr = name[1]; string editorName = name[2]; MetaModel model = FindMetaModel(moniker.Store, modelName); if (model != null) { foreach (DomainType t in model.DomainTypes) if (t.Name == editorName && t.Namespace == namespaceStr) { modelElement = t; typeLookup[moniker.MonikerName] = t; break; } } } return modelElement; } else return modelElement; } #endregion ModelElement m = base.ResolveMoniker(moniker); if (m == null) { try { Guid guid = new Guid(moniker.MonikerName); m = moniker.Store.ElementDirectory.FindElement(guid); } catch { } } if (m == null) { } return m; }
private static void DefineEntities(DbFactory f) { f.Define <User>(e => { e.Name = Moniker.UserName; e.Password = Moniker.UserPassword; e.LastUsageDate = DateTime.Now; }); f.Define <Category>(e => { e.Name = Moniker.Category; e.IsActive = true; }); f.Define <Currency>(e => { e.Name = Moniker.Currency; e.Code = Moniker.CurrencyCode; e.Symbol = Moniker.CurrencySymbol; e.IsActive = true; e.IsMain = false; e.CurrencySymbolAlignment = CurrencySymbolAlignment.Right; }); f.Define <CurrencyExchangeRate>(e => { e.Rate = Moniker.LimitedDigit(30); }); f.Define <StorageGroup>(e => { e.Name = Moniker.StorageGroup; }); f.Define <Storage>(e => { e.Name = "Storage"; e.Value = Moniker.Digit; e.IsVisible = true; }); f.Define <Debt>(e => { e.Description = "Take Debt"; e.DebtType = DebtType.TakeBorrow; e.TakingDate = DateTime.Today; e.Value = Moniker.Digit; e.IsRepaid = false; }); f.Define <Record>(e => { e.Description = "Record"; e.RecordType = RecordType.Expense; e.Date = DateTime.Now; e.Value = Moniker.Digit; }); f.Define <MoneyTransfer>(e => { e.Date = DateTime.Now; e.Description = "MoneyTransfer"; e.Value = Moniker.Digit; e.CurrencyExchangeRate = 1; e.TakeCommissionFromReceiver = false; e.CommissionType = CommissionType.Currency; }); f.Define <Limit>(e => { e.Value = Moniker.Digit; e.Description = "Limit"; e.DateFrom = DateTime.Today.AddDays(1); e.DateUntil = e.DateFrom.Date; }); DefineEventEntities(f); DefineSettingsEntities(f); }
public RewardCardData(int count, Moniker moniker) { this.count = count; this.moniker = moniker; }
protected override void OnUnresolvedMoniker(SerializationResult serializationResult, Moniker moniker) { /* * if (moniker.Link is SerializationClassReferencesChildren || * moniker.Link is SerializationClassReferencesAttributes || * moniker.Link is DomainClassReferencesBaseClass || * moniker.Link is DomainRelationshipReferencesBaseRelationship || * moniker.Link is TreeNodeReferencesInheritanceNodes || * moniker.Link is TreeNodeReferencesEmbeddingRSNodes || * moniker.Link is TreeNodeReferencesReferenceRSNodes || * moniker.Link is TreeNodeReferencesShapeClassNodes) * {*/ if (moniker.Link != null) { // TODO string name = moniker.Link.ToString() + " - " + moniker.MonikerName; moniker.DeleteLink(); SerializationUtilities.AddMessage(serializationResult, moniker.Location, SerializationMessageKind.Warning, "Moniker could not be resolved; The link was deleted from the model. " + name, moniker.Line, moniker.Column); } else { base.OnUnresolvedMoniker(serializationResult, moniker); } }
public override ModelElement ResolveMoniker(Moniker moniker) { Microsoft.VisualStudio.Modeling.ModelElement modelElement; #region PropertyGridEditor if (moniker.DomainRelationshipInfo.Id == DomainTypeReferencesPropertyGridEditor.DomainClassId) { propertyGridEditorTypeLookup.TryGetValue(moniker.MonikerName, out modelElement); if (modelElement == null) { string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); if (name.Length > 1) { string modelName = name[0]; string editorName = name[1]; MetaModel model = FindMetaModel(moniker.Store, modelName); if (model != null) { foreach (PropertyGridEditor editor in model.PropertyGridEditors) { if (editor.Name == editorName) { modelElement = editor; propertyGridEditorTypeLookup[moniker.MonikerName] = editor; break; } } } } return(modelElement); } else { return(modelElement); } } #endregion #region DomainEnumeration and ExternalType if (moniker.DomainRelationshipInfo.Id == DomainPropertyReferencesType.DomainClassId) { typeLookup.TryGetValue(moniker.MonikerName, out modelElement); if (modelElement == null) { string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); if (name.Length > 2) { string modelName = name[0]; string namespaceStr = name[1]; string editorName = name[2]; MetaModel model = FindMetaModel(moniker.Store, modelName); if (model != null) { foreach (DomainType t in model.DomainTypes) { if (t.Name == editorName && t.Namespace == namespaceStr) { modelElement = t; typeLookup[moniker.MonikerName] = t; break; } } } } return(modelElement); } else { return(modelElement); } } #endregion ModelElement m = base.ResolveMoniker(moniker); if (m == null) { try { Guid guid = new Guid(moniker.MonikerName); m = moniker.Store.ElementDirectory.FindElement(guid); } catch { } } if (m == null) { } return(m); }
public static List <Record> CreateRecords(this DbFactory f, int userId, DateTime from, DateTime until, Action <Record> overrides = null) { return(CreateRecords(f, userId, from, until, Moniker.LimitedDigit(2, 5), overrides)); }