static int GetRating(EditorFlags editor, RegistrationData candidate) { var rating = 0; if (candidate.Editor == editor) { rating += 1000; } if (candidate.Envs < EnvFlags.All) { rating += 100; } if (candidate.Providers < ProviderFlags.All) { rating += 10; } if (candidate.Platforms < PlatformFlags.All) { rating += 1; } return(rating); }
private void NewFile(EditorFlags flags) { var editor = App.EditorInfo(flags); var doc = editor.Instance.CreateDocument("untitled" + editor.FileExtension); App.GetService <IDocumentService>().AddDocument(doc); }
public virtual EditorInfo GetEditor(EditorFlags flags) { var editor = Editors.FirstOrDefault(e => e.Flags.Set(flags)); if (editor == null) throw new ElideException("No registered editor has flags '{0}'.", flags); return editor; }
internal EditorInfo(string key, Type type, Type documentType, string displayName, string fileExtension, string fileExtensionDescription, EditorFlags flags) : base(key) { Type = type; DocumentType = documentType; DisplayName = displayName; FileExtension = fileExtension; FileExtensionDescription = fileExtensionDescription; Flags = flags; }
public virtual EditorInfo GetEditor(EditorFlags flags) { var editor = Editors.FirstOrDefault(e => e.Flags.Set(flags)); if (editor == null) { throw new ElideException("No registered editor has flags '{0}'.", flags); } return(editor); }
public static bool Has(this EditorFlags flags, EditorFlags flag) { return((flags & flag) != 0); }
public static EditorInfo EditorInfo(this IApp app, EditorFlags flags) { return(app.GetService <IEditorService>().GetEditor(flags)); }
/// <summary> /// Type will be visible in the editor. /// </summary> /// <param name="inName">Name to display in the inspector dropdown.</param> /// <param name="inDescription">Description to display alongside messages.</param> /// <param name="inFlags">Optional flags to use for filtering by type.</param> public MsgTypeGenerator <T> Editor(string inName, string inDescription = null, EditorFlags inFlags = EditorFlags.None) { m_Metadata.DisplayName = string.IsNullOrEmpty(inName) ? string.Empty : inName; m_Metadata.Description = string.IsNullOrEmpty(inDescription) ? string.Empty : inDescription; m_Metadata.Flags |= (MsgFlags)inFlags; return(this); }
private void NewFile(EditorFlags flags) { var editor = App.EditorInfo(flags); var doc = editor.Instance.CreateDocument("untitled" + editor.FileExtension); App.GetService<IDocumentService>().AddDocument(doc); }
public RegistrationData In(EditorFlags flags) { Editor = flags; return(this); }