void ConfigureRegistrar(IViewEngine engine, IViewProcessor processor) { var r = new ViewRegistrar(processor, engine); r.Add(new ReflectionViewRegistrar()); _registrar = r; }
public static void GenerateConstants(ViewRegistrar registrar, string outputPath) { outputPath = Path.Combine(new[] { outputPath, "LayerStatics.cs" }); LayerConstantsGenerator generator = new LayerConstantsGenerator { Session = new Dictionary <string, object> { ["className"] = "Layer" } }; SetLayerIDs(generator, registrar); generator.Initialize(); string classDef = generator.TransformText(); File.WriteAllText(outputPath, classDef); AssetDatabase.Refresh(); }
public static void GenerateConstants(ViewRegistrar registrar, string outputPath) { //string outputPath = EditorUtility.SaveFilePanelInProject("Save Location", "ViewStatics", "cs", "Where do you want to save this constants file?", string.Format("{0}/Core/Modules/ViewManager/Scripts/Constants", Application.dataPath)); outputPath = Path.Combine(new[] { outputPath, "ViewStatics.cs" }); ViewConstantsGenerator generator = new ViewConstantsGenerator { Session = new Dictionary <string, object> { ["className"] = "View" } }; SetViewIDs(generator, registrar); generator.Initialize(); string classDef = generator.TransformText(); File.WriteAllText(outputPath, classDef); AssetDatabase.Refresh(); }
/// <summary>Register the mapping between the prompt model and the dialog to show. /// </summary> /// <param name="registrar">The view registrar.</param> protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); // This tells the framework to show the HttpDataSourceDialog when // the system is asked to prompt on the HttpDataSourcePromptModel. registrar.Register(typeof(Form), typeof(LmiDataSourcePromptModel), typeof(LmiDataSourceDialog)); }
/// <summary>Register the mapping between the prompt model and the dialog to show. /// </summary> /// <param name="registrar">The view registrar.</param> protected override void RegisterViews(ViewRegistrar registrar) { //System.Diagnostics.Debugger.Launch(); base.RegisterViews(registrar); // This tells the framework to show the HttpDataSourceDialog when // the system is asked to prompt on the HttpDataSourcePromptModel. registrar.Register(typeof(PromptControl), typeof(LmiDataSourcePromptModel), typeof(MyCustomPanelView)); }
protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); try { registrar.Register(typeof(Form), typeof(JSVisualizationModel), typeof(JSVisulizationPropertyDialog)); } catch (Exception) { ; //throw; } }
protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); try { registrar.Register(typeof(Form), typeof(JSVisualizationModel), typeof(JSVisualizationPropertyDialog)); } catch (Exception) { //Ignore this if it is already registered //throw; } }
private static void SetLayerIDs(LayerConstantsGenerator generator, ViewRegistrar registrar) { List <string> layerIDs = new List <string>(); foreach (LayerRecord layerRecord in registrar.LayerRecords) { // If any of the layerRecords in the registrar do not have a name defined we will not create an entry for them. // Additionally if there are duplicates they will be ignored. if (layerRecord.HasName && !layerIDs.Contains(layerRecord.LayerName)) { layerIDs.Add(layerRecord.LayerName); } } generator.Session["layerIDs"] = layerIDs.ToArray(); }
private static void SetViewIDs(ViewConstantsGenerator generator, ViewRegistrar registrar) { List <string> viewIDs = new List <string>(); foreach (ViewInfo viewRecord in registrar.ViewRecords) { // If any of the ViewRecords in the registrar do not have a name defined we will not create an entry for them. // Additionally if there are duplicates they will be ignored. if (viewRecord.HasName && !viewIDs.Contains(viewRecord.Name)) { viewIDs.Add(viewRecord.Name); } } generator.Session["viewIDs"] = viewIDs.ToArray(); }
private ViewManager(Canvas viewCanvas, ViewRegistrar registrar) { mainThread = Thread.CurrentThread; if (UI_LAYER == -1) { Debug.LogError("Could not find UI layer."); } LinkCanvas(viewCanvas); layerCollection = new LayerCollection(CreateViewContainer("Views")); CreateDialogContainer(); viewLoaderFactory = new ViewLoaderFactory(); RegisterLayers(registrar.LayerRecords); RegisterViews(registrar.ViewRecords); CreateLayers(); }
protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); registrar.Register(typeof(Form), typeof(TestToolSettings), typeof(ToolSettingsDialog)); }
public static void Instantiate(Canvas viewCanvas, ViewRegistrar registrar) { instance = new ViewManager(viewCanvas, registrar); }
protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); registrar.Register(typeof(Form), typeof(Models.PDRenderSettings), typeof(Views.PDRendererSettingsDialog)); }
protected override void RegisterViews(ViewRegistrar registrar) { base.RegisterViews(registrar); registrar.Register(typeof(CustomVisualView), typeof(AttivioSearchVisual), typeof(AttivioSearchVisualView)); }