コード例 #1
0
        public Task <bool> RenameExplorerObject(string newName)
        {
            bool             ret    = false;
            ConfigTextStream stream = new ConfigTextStream("MsSql2008SpatialGeography_connections", true, true);

            ret = stream.ReplaceHoleLine(ConfigTextStream.BuildLine(_server, _connectionString), ConfigTextStream.BuildLine(newName, _connectionString));
            stream.Close();

            if (ret == true)
            {
                _server = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(Task.FromResult(ret));
        }