FileFind.Meshwork.GtkClient.Windows.PreferencesDialog.OnSharedFoldersListDragDataReceived C# (CSharp) Method

OnSharedFoldersListDragDataReceived() private method

private OnSharedFoldersListDragDataReceived ( object o, Gtk.DragDataReceivedArgs args ) : void
o object
args Gtk.DragDataReceivedArgs
return void
        private void OnSharedFoldersListDragDataReceived(object o, DragDataReceivedArgs args)
        {
            bool success = false;
            string allPaths = System.Text.Encoding.UTF8.GetString (args.SelectionData.Data);

            string[] paths = allPaths.Split ('\n');

            foreach (string path in paths) {
                string cleanPath = path.Trim ();
                if (cleanPath != "") {
                    LoggingService.LogDebug(cleanPath);

                    Uri uri = new Uri (cleanPath);

                    if (uri.IsFile) {
                        if (System.IO.Directory.Exists (uri.LocalPath) == true) {
                            sharedFoldersListStore.AppendValues(new object[] { uri.LocalPath });
                            success = true;
                        }
                    }
                }
            }
            Gtk.Drag.Finish (args.Context, success, false, args.Time);
        }