예제 #1
0
        public bool GenerateNew()
        {
            try
            {
                string   appPath    = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                Assembly uiAssembly = Assembly.LoadFrom(appPath + @"\gView.Interoperability.ArcXML.UI.dll");

                IModalDialog dlg = uiAssembly.CreateInstance("gView.Interoperability.ArcXML.UI.FormSelectService") as IModalDialog;
                if (dlg is IConnectionString)
                {
                    if (dlg.OpenModal())
                    {
                        string connectionString = ((IConnectionString)dlg).ConnectionString;

                        _dataset = new ArcIMSDataset();
                        _dataset.ConnectionString = connectionString;
                        return(true);
                    }
                }
            }
            catch
            {
            }
            return(false);
        }
예제 #2
0
 public ArcIMSClass(ArcIMSDataset dataset)
 {
     _dataset = dataset;
     if (_dataset != null)
     {
         _name = _dataset._name;
     }
 }
예제 #3
0
        public void Load(gView.Framework.IO.IPersistStream stream)
        {
            _dataset = null;
            string connectionString = (string)stream.Load("ConnectionString", String.Empty);

            if (connectionString != String.Empty)
            {
                _dataset = new ArcIMSDataset();
                _dataset.ConnectionString = connectionString;
            }
        }
예제 #4
0
        async public Task <object> GetInstanceAsync()
        {
            if (_class == null)
            {
                ArcIMSDataset dataset = new ArcIMSDataset(_connectionString, _name);
                await dataset.Open(); // kein open, weil sonst ein GET_SERVICE_INFO durchgeführt wird...

                var elements = await dataset.Elements();

                if (elements.Count == 0)
                {
                    dataset.Dispose();
                    return(null);
                }

                _class = elements[0].Class as ArcIMSClass;
            }

            return(_class);
        }