Example #1
0
        void ConfigureRegistrar(IViewEngine engine, IViewProcessor processor)
        {
            var r = new ViewRegistrar(processor, engine);
            r.Add(new ReflectionViewRegistrar());

            _registrar = r;
        }
Example #2
0
        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();
        }
Example #3
0
        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();
        }
Example #4
0
        /// <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));
        }
Example #5
0
        /// <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));
        }
Example #6
0
 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;
     }
 }
Example #8
0
        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();
        }
Example #9
0
        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();
        }
Example #10
0
        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();
        }
Example #11
0
        protected override void RegisterViews(ViewRegistrar registrar)
        {
            base.RegisterViews(registrar);

            registrar.Register(typeof(Form), typeof(TestToolSettings), typeof(ToolSettingsDialog));
        }
Example #12
0
 public static void Instantiate(Canvas viewCanvas, ViewRegistrar registrar)
 {
     instance = new ViewManager(viewCanvas, registrar);
 }
Example #13
0
        protected override void RegisterViews(ViewRegistrar registrar)
        {
            base.RegisterViews(registrar);

            registrar.Register(typeof(Form), typeof(Models.PDRenderSettings), typeof(Views.PDRendererSettingsDialog));
        }
Example #14
0
        protected override void RegisterViews(ViewRegistrar registrar)
        {
            base.RegisterViews(registrar);

            registrar.Register(typeof(CustomVisualView), typeof(AttivioSearchVisual), typeof(AttivioSearchVisualView));
        }