//
        // CONSTRUCTOR
        //
        public GeometricNetworkLoader(byte[] bytes)
        {
            // Cast byte to object
            object obj = (object)bytes;

            // Unpack dropped object to Esri name enumerator
            INameFactory nameFactory = new NameFactoryClass();
            IEnumName enumName = nameFactory.UnpackageNames(ref obj);
            this._name = enumName.Next();
        }
        public static string ExportXml(DragEventArgs e)
        {
            // Get dropped object
            if (!e.Data.GetDataPresent("ESRI Names"))
            {
                return(null);
            }
            object drop = e.Data.GetData("ESRI Names");

            // Convert to byte array
            MemoryStream memoryStream = (MemoryStream)drop;

            byte[] bytes     = memoryStream.ToArray();
            object byteArray = (object)bytes;

            // Get First WorkpaceName
            INameFactory   nameFactory   = new NameFactoryClass();
            IEnumName      enumName      = nameFactory.UnpackageNames(ref byteArray);
            IName          name          = enumName.Next();
            IWorkspaceName workspaceName = name as IWorkspaceName;

            if (workspaceName != null)
            {
                return(GeodatabaseUtility.ExportWorkspaceXml(workspaceName));
            }
            ;

            MessageBox.Show(
                Resources.TEXT_DROPPED_OBJECT_NOT_VALID_GEODATABASE,
                Resources.TEXT_APPLICATION,
                MessageBoxButtons.OK,
                MessageBoxIcon.Error,
                MessageBoxDefaultButton.Button1,
                MessageBoxOptions.DefaultDesktopOnly);
            return(null);
        }
        public static string ExportXml(DragEventArgs e) {
            // Get dropped object
            if (!e.Data.GetDataPresent("ESRI Names")) { return null; }
            object drop = e.Data.GetData("ESRI Names");

            // Convert to byte array
            MemoryStream memoryStream = (MemoryStream)drop;
            byte[] bytes = memoryStream.ToArray();
            object byteArray = (object)bytes;

            // Get First WorkpaceName
            INameFactory nameFactory = new NameFactoryClass();
            IEnumName enumName = nameFactory.UnpackageNames(ref byteArray);
            IName name = enumName.Next();
            IWorkspaceName workspaceName = name as IWorkspaceName;
            if (workspaceName != null){
                return GeodatabaseUtility.ExportWorkspaceXml(workspaceName);
            };

            MessageBox.Show(
                Resources.TEXT_DROPPED_OBJECT_NOT_VALID_GEODATABASE,
                Resources.TEXT_APPLICATION,
                MessageBoxButtons.OK,
                MessageBoxIcon.Error,
                MessageBoxDefaultButton.Button1,
                MessageBoxOptions.DefaultDesktopOnly);
            return null;
        }