Пример #1
0
        /// <summary>
        /// Opens a new layer and automatically adds it to the specified container.
        /// </summary>
        /// <param name="fileName">A String fileName to attempt to open.</param>
        /// <param name="container">The container (usually a LayerCollection) to add to</param>
        /// <returns>The layer after it has been created and added to the container</returns>
        public static ILayer OpenFile(string fileName, ICollection <ILayer> container)
        {
            if (File.Exists(fileName) == false)
            {
                return(null);
            }
            ILayerManager dm = LayerManager.DefaultLayerManager;

            return(dm.OpenLayer(fileName, container));
        }
Пример #2
0
        /// <summary>
        /// Attempts to call the open fileName method for any ILayerProvider plugin
        /// that matches the extension on the string.
        /// </summary>
        /// <param name="fileName">A String fileName to attempt to open.</param>
        /// <param name="inRam">A boolean value that if true will attempt to force a load of the data into memory.  This value overrides the property on this LayerManager.</param>
        /// <param name="container">A container to open this layer in</param>
        /// <param name="progressHandler">Specifies the progressHandler to receive progress messages.  This value overrides the property on this LayerManager.</param>
        /// <returns>An ILayer</returns>
        public virtual ILayer OpenLayer(string fileName, bool inRam, ICollection <ILayer> container, IProgressHandler progressHandler)
        {
            if (File.Exists(fileName) == false)
            {
                return(null);
            }
            ILayerManager dm = LayerManager.DefaultLayerManager;

            return(dm.OpenLayer(fileName, inRam, container, progressHandler));
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayerManager"/> class.
 /// A data manager is more or less just a list of data providers to use. The very important
 /// LayerManager.DefaultLayerManager property controls which LayerManager will be used
 /// to load data. By default, each LayerManager sets itself as the default in its constructor.
 /// </summary>
 public LayerManager()
 {
     // InitializeComponent();
     defaultLayerManager       = this;
     _layerProviders           = new List <ILayerProvider>();
     _layerProviderDirectories = new List <string>
     {
         "\\Plugins"
     };
     _preferredProviders = new Dictionary <string, ILayerProvider>();
 }
Пример #4
0
        /// <summary>
        /// Unity Awake callback.
        /// </summary>
        protected virtual void Awake()
        {
            if (!Application.isPlaying)
            {
                return;
            }

            layerManager          = LayerManager.Instance;
            layerProjectionParams = createProjectionParams();
            StartCoroutine(lateAwake());
        }
Пример #5
0
        /// <summary>
        /// Creates a new instance of the LayerManager class.  A data manager is more or less
        /// just a list of data providers to use.  The very important
        /// LayerManager.DefaultLayerManager property controls which LayerManager will be used
        /// to load data.  By default, each LayerManager sets itself as the default in its
        /// constructor.
        /// </summary>
        public LayerManager()
        {
            // InitializeComponent();

            _defaultLayerManager = this;
            _layerProviders      = new List <ILayerProvider>();
            // _layerProviders.Add(new ShapefileLayerProvider()); // .shp files
            // _layerProviders.Add(new BinaryLayerProvider()); // .bgd files

            //string path = Application.ExecutablePath;
            _layerProviderDirectories = new List <string>();
            _layerProviderDirectories.Add("\\Plugins");
            _preferredProviders = new Dictionary <string, ILayerProvider>();
        }
        public override void Initialize()
        {
            var gameObjectManager = GameServiceManager.GetService<IGameObjectManager>();

            if (gameObjectManager != null)
            {
                gameObjectManager.OnGameObjectAdded += OnGameObjectAdded;
                gameObjectManager.OnGameObjectRemoved += OnGameObjectRemoved;
            }

            layerManager = GameServiceManager.GetService<ILayerManager>();

            Active = true;
        }
        public override void Initialize()
        {
            var gameObjectManager = GameServiceManager.GetService <IGameObjectManager>();

            if (gameObjectManager != null)
            {
                gameObjectManager.OnGameObjectAdded   += OnGameObjectAdded;
                gameObjectManager.OnGameObjectRemoved += OnGameObjectRemoved;
            }

            layerManager = GameServiceManager.GetService <ILayerManager>();

            Active = true;
        }
Пример #8
0
        public EntityListWpf(FileEntity _FileEntity)
        {
            InitializeComponent();

            FileEntity = _FileEntity;

            this.DoLoadData();

            // 新模式创建Manager
            this.ContractsManager = new ContractsManager(this.FileEntity);

            this.btnNewSubmit.IsEnabled = this.FileEntity.Contracts.IsUse;
            this.btnSubmit.IsEnabled    = !this.FileEntity.Contracts.IsUse;
        }
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(this);
                return;
            }

#if TOUCHSCRIPT_DEBUG
            pLogger = Debugging.TouchScriptDebugger.Instance.PointerLogger;
#endif

#if UNITY_5_4_OR_NEWER
            SceneManager.sceneLoaded += sceneLoadedHandler;
#endif

            gameObject.hideFlags = HideFlags.HideInHierarchy;
            DontDestroyOnLoad(gameObject);

            layerManager = LayerManager.Instance;

            UpdateResolution();

            StopAllCoroutines();
            StartCoroutine(lateAwake());

            pointerListPool.WarmUp(2);
            intListPool.WarmUp(3);

            _layerAddPointer    = layerAddPointer;
            _layerUpdatePointer = layerUpdatePointer;
            _layerRemovePointer = layerRemovePointer;
            _layerCancelPointer = layerCancelPointer;

#if UNITY_5_6_OR_NEWER
            samplerUpdateInputs    = CustomSampler.Create("[TouchScript] Update Inputs");
            samplerUpdateAdded     = CustomSampler.Create("[TouchScript] Added Pointers");
            samplerUpdatePressed   = CustomSampler.Create("[TouchScript] Press Pointers");
            samplerUpdateUpdated   = CustomSampler.Create("[TouchScript] Update Pointers");
            samplerUpdateReleased  = CustomSampler.Create("[TouchScript] Release Pointers");
            samplerUpdateRemoved   = CustomSampler.Create("[TouchScript] Remove Pointers");
            samplerUpdateCancelled = CustomSampler.Create("[TouchScript] Cancel Pointers");
#endif
        }
Пример #10
0
        /// <summary>
        /// Creates a new instance of the LayerManager class.  A data manager is more or less
        /// just a list of data providers to use.  The very important 
        /// LayerManager.DefaultLayerManager property controls which LayerManager will be used
        /// to load data.  By default, each LayerManager sets itself as the default in its
        /// constructor.
        /// </summary>
        public LayerManager()
        {
           // InitializeComponent();

            _defaultLayerManager = this;
            _layerProviders = new List<ILayerProvider>();
            _layerProviders.Add(new ShapefileLayerProvider()); // .shp files
            _layerProviders.Add(new BinaryLayerProvider()); // .bgd files
          

            string path = System.Windows.Forms.Application.ExecutablePath;
            _layerProviderDirectories = new List<string>();
            _layerProviderDirectories.Add(System.IO.Path.GetDirectoryName(path) + "\\Plugins");
            _preferredProviders = new Dictionary<string, ILayerProvider>();
            
        }