public void InitializeConfig()
        {
            ConfigManager cm = GlobalInstance <ConfigManager> .GetInstance();

            if (string.IsNullOrEmpty(cm.ApiEndpoint))
            {
                cm.ApiEndpoint = "https://example.com/api/v1/omnireader";
            }

            if (string.IsNullOrEmpty(cm.ApiUser))
            {
                cm.ApiUser = "******";
            }

            if (string.IsNullOrEmpty(cm.ApiPassword))
            {
                cm.ApiPassword = "******";
            }

            if (string.IsNullOrEmpty(cm.DeviceId))
            {
                cm.DeviceId = "1";
            }

            if (string.IsNullOrEmpty(cm.UniqueParcles))
            {
                cm.UniqueParcles = "1";
            }
        }
Exemple #2
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            string connectionString = Configuration.GetConnectionString("DefaultConnection");

            GlobalInstance.Initialize(connectionString);
        }
Exemple #3
0
        public void Global()
        {
            var store    = new Store();
            var instance = new GlobalInstance();
            var index    = store.AddGlobal(instance);

            Assert.That(store.Global(index), Is.SameAs(instance));
        }
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            string contentRoot      = configuration.GetValue <string>(WebHostDefaults.ContentRootKey);
            string connectionString = Configuration.GetConnectionString("DefaultConnection");

            GlobalInstance.Initialize(contentRoot, connectionString);
        }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        Log.SetLogOpen(_isOpenLog);

        //这里是为了避免懒加载获取其中的某些对象时出现“场景内GameObject过多”导致的查找消耗问题
        GlobalInstance.Init();

        //frame init
        FrameController.I.EnsureInit();

        DontDestroyOnLoad(gameObject);
    }
Exemple #6
0
    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(gameObject);
        Log.SetLogOpen(_isOpenLog);

        //这里是为了避免懒加载获取其中的某些对象时出现“场景内GameObject过多”导致的查找消耗问题
        GlobalInstance.Init();
        FrameController.I.EnsureInit();
        ObjectPoolMgr.I.Init();

        TestPool pool = ObjectPoolMgr.I.CreateDefaultObjectPoolTest <TestPool>();

        pool.Do();
    }
Exemple #7
0
        public MyDocumentViewer(System.Windows.Forms.Integration.WindowsFormsHost host, SelectElementHandler selector)
        {
            //创建三维控件
            mRenderCtrl       = new RenderControl();
            host.Child        = mRenderCtrl;
            mRenderCtrl.Load += InitializeRenderControlOnLoad;

            //用于选择的回调方法
            mSelectionCallback = selector;

            //注册命令
            UICommandManager.LoadCommands(Assembly.GetExecutingAssembly());
            //注册图元模板
            GlobalInstance.RegisterElementSchema(Assembly.GetExecutingAssembly());
        }
        static void Main(string[] args)
        {
            GlobalInstance.Initialize();

            WindowCanvas canvas = new WindowCanvas("AnyCAD", false);

            canvas.Initialize(0, 600, 400);


            var box   = ShapeBuilder.MakeBox(GP.XOY(), 10, 20, 30);
            var node  = BrepSceneNode.Create(box, null, null, 0.01);
            var scene = canvas.GetContext().GetScene();

            scene.AddNode(node);
            //canvas.Run();
            scene.UpdateWorld();
            canvas.ZoomToExtend();
            canvas.Redraw(0);
            canvas.CaptureScreenShot("image.bmp");
            canvas.Destroy();

            GlobalInstance.Destroy();
        }
Exemple #9
0
        public DocumentView(System.Windows.Forms.Integration.WindowsFormsHost host, SelectElementHandler selector)
        {
            mSelectionCallback = selector;
            mRenderCtrl        = new RenderControl();
            host.Child         = mRenderCtrl;
            mRenderCtrl.Load  += MRenderCtrl_Load;

            var types = Assembly.GetExecutingAssembly().GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(UICommand)))
                {
                    var command = Activator.CreateInstance(type) as UICommand;
                    if (command.Name.Length == 0)
                    {
                        continue;
                    }
                    mCommands[command.Name] = command;
                }
            }

            GlobalInstance.RegisterElementSchema(Assembly.GetExecutingAssembly());
        }
Exemple #10
0
 public static int GlobalGenerate(object trackedObject) => GlobalInstance.Generate(trackedObject);
        public void InitalizeGlobalObjects()
        {
            GlobalInstance <SessionManager> .GetInstance();

            GlobalInstance <ConfigManager> .GetInstance();
        }
Exemple #12
0
 /// <summary>Creates a new progress object implementing the <see cref="IProgress" /> interface.</summary>
 /// <remarks>
 /// This function does not call the <see cref="Updated" /> event for the newly created <see cref="IProgress" /> instance. The
 /// <see cref="Updated" /> event will be fired upon the first <see cref="IProgress.Update(float, string)" /> call.
 /// </remarks>
 /// <param name="source">Source object for the progress.</param>
 /// <returns>Returns a new instance implementing the <see cref="IProgress" /> interface.</returns>
 public static IProgress CreateProgress(object source) => GlobalInstance.CreateProgress(source);
Exemple #13
0
 public int AddGlobal(GlobalInstance global)
 {
     _globals.Add(global);
     return(_globals.Count - 1);
 }