Set the callback function to consume on shared folder changed events.

        Callback receives a ISharedFolderChangedEvent object.

        Returns the callback_id
173981
def register_on_shared_folder_changed(self, callback):
        
        event_type = library.VBoxEventType.on_shared_folder_changed
        return self.event_source.register_callback(callback, event_type)
1286638
def register_callback_deleted(self, func, serialised=True):
        
        self.__add_callback(_CB_DELETED, func, serialised_if_crud=serialised)
232178
def register_on_vrde_server_changed(self, callback):
        
        event_type = library.VBoxEventType.on_vrde_server_changed
        return self.event_source.register_callback(callback, event_type)
19395
function guidWithCheck(callback) {
        const id = guid();
        context.getObject(id, function (err, value) {
          if (err) {
            callback(err);
            return;
          }

          // If this id is unused, use it, otherwise find another
          if (!value) {
            callback(null, id);
          } else {
            guidWithCheck(callback);
          }
        });
      }
290796
function setCallbackAsWatcherOf(callback, watchersSet) {
    if (!callback[WATCHER_IDENTIFIER]) {
        defineProperty(callback, WATCHER_IDENTIFIER, { watching: new Set() });

        defineProperty(callback, "stopWatchingAll", function(){
            callback[WATCHER_IDENTIFIER].watching.forEach(watcherList =>
                watcherList.delete(callback)
            );
            callback[WATCHER_IDENTIFIER].watching.clear();
        });
    }

    callback[WATCHER_IDENTIFIER].watching.add(watchersSet);
}
867568
def call(self, name: str, *args, **kwargs):
        ''''''
        if self._event_dispatcher is not None:
            self._event_dispatcher.notify(name, *args, **kwargs)

        if self._callbacks[name]:
            return self._callbacks[name](*args, **kwargs)
        else:
            raise HookDisconnected('No callback is connected.')
616962
def sent_folder(self):
        
        return self.folder_constructor(parent=self, name='SentItems',
                                       folder_id=OutlookWellKnowFolderNames
                                       .SENT.value)
207101
void observe(FolderObserver observer) {
    synchronized (idleMutex) {
      this.observer = observer;
      pushedData = new PushedData();
      idleAcknowledged.set(false);
    }
  }
574978
def _property_change_event_handler(self, signal, transport, *args):
        
        current_state = self.source.State
        if (self.state == 'connected' and current_state == 'playing'):
            self._acquire_media_transport(transport, 'r')
        elif (self.state == 'playing' and current_state == 'connected'):
            self._release_media_transport(transport, 'r')
        self.state = current_state
1104389
Define getSharedFunction(String functionName) {
		Define func = sharedFunctionMap.get(functionName);
		if (func == null) {
			/**
			 * 如果 func 最初未定义，但后续在共享模板文件中又被添加进来
			 * 此时在本 if 分支中无法被感知，仍然返回了 null
			 * 
			 * 但共享模板文件会在后续其它的 func 调用时被感知修改并 reload
			 * 所以本 if 分支不考虑处理模板文件中追加 #define 的情况
			 * 
			 * 如果要处理，只能是每次在 func 为 null 时，判断 sharedFunctionSourceList
			 * 中的模板是否被修改过，再重新加载，不优雅
			 */
			return null;
		}
		
		if (devMode && reloadModifiedSharedFunctionInDevMode) {
			if (func.isSourceModifiedForDevMode()) {
				synchronized (this) {
					func = sharedFunctionMap.get(functionName);
					if (func.isSourceModifiedForDevMode()) {
						reloadSharedFunctionSourceList();
						func = sharedFunctionMap.get(functionName);
					}
				}
			}
		}
		return func;
	}
880390
def share_settings(self, other, keylist=None, include_callbacks=True,
                       callback=True):
        
        if keylist is None:
            keylist = self.group.keys()
        if include_callbacks:
            for key in keylist:
                oset, mset = other.group[key], self.group[key]
                other.group[key] = mset
                oset.merge_callbacks_to(mset)
        if callback:
            # make callbacks only after all items are set in the group
            # TODO: only make callbacks for values that changed?
            for key in keylist:
                other.group[key].make_callback('set', other.group[key].value)
241646
def update_folder_name(self, name, update_folder_data=True):
        
        if self.root:
            return False
        if not name:
            return False

        url = self.build_url(
            self._endpoints.get('get_folder').format(id=self.folder_id))

        response = self.con.patch(url, data={self._cc('displayName'): name})
        if not response:
            return False

        self.name = name
        if not update_folder_data:
            return True

        folder = response.json()

        self.name = folder.get(self._cc('displayName'), '')
        self.parent_id = folder.get(self._cc('parentFolderId'), None)
        self.child_folders_count = folder.get(self._cc('childFolderCount'), 0)
        self.unread_items_count = folder.get(self._cc('unreadItemCount'), 0)
        self.total_items_count = folder.get(self._cc('totalItemCount'), 0)
        self.updated_at = dt.datetime.now()

        return True
931549
function(callback) {
		var self = this;
		var sections = [Path.join("/")];
		var paths_to_traverse = [];

		var should_exclude = function(entry) {
			return entry[0] === "." || entry[0] === "_" || entry === "shared";
		};

		var traverse_path = function() {
			var current_path = paths_to_traverse.shift() || "";
			Fs.readdir(Path.join(self.contentDir, current_path), function(err, entries) {
				if (err) {
					throw err;
				}

				var run_callbacks = function() {
					if (entries.length) {
						return next_entry();
					} else if (paths_to_traverse.length) {
						return traverse_path();
					} else {
						return callback(sections);
					}
				};

				var next_entry = function() {
					var current_entry = entries.shift();
					if (should_exclude(current_entry)) {
						return run_callbacks();
					}

					var current_entry_path = Path.join(current_path, current_entry);
					Fs.stat(Path.join(self.contentDir, current_entry_path), function(err, stat) {
						if (err) {
							return run_callbacks();
						}

						if (stat.isDirectory()) {
							sections.push(Path.join("/",current_entry_path));
							paths_to_traverse.push(current_entry_path);
						}

						return run_callbacks();
					});
				};

				return run_callbacks();
			});
		};
		return traverse_path();
	}
1211681
def _callbackPlaceFillOrders(self, d):
        
        if isinstance(d, FilledOrder):
            self.onOrderMatched(d)
        elif isinstance(d, Order):
            self.onOrderPlaced(d)
        elif isinstance(d, UpdateCallOrder):
            self.onUpdateCallOrder(d)
        else:
            pass
1198998
function (serverRelativeUrl, list, ctx) {
		var dfd = $.Deferred();

		folderExists(serverRelativeUrl, ctx, list.get_parentWeb()).done(function (folder) {
			if (folder === false) {

				var parentFolders = pathSteps(serverRelativeUrl);
				var parentFolderPath = parentFolders[1];
				var bits = serverRelativeUrl.split("/");
				var name = bits[bits.length - 1];
				ensureFolderInList(parentFolderPath, list, ctx).done(function () /*parentSpFolder*/ {
					createFolderInList(name, parentFolderPath, list, ctx).done(function (folder) {
						dfd.resolve(folder);
					});
				});
			} else {
				dfd.resolve(folder);
			}
		});
		return dfd.promise();
	}
1352086
def register_on_parallel_port_changed(self, callback):
        
        event_type = library.VBoxEventType.on_parallel_port_changed
        return self.event_source.register_callback(callback, event_type)
934773
def callback!(event, options, method, property_options) # TODO: remove args.
      context = options[:context] || self # TODO: test me.

      # TODO: Use Option::Value here. this could be created straight in the DSL with the twin being passed in.
      if context.methods.include?(method) && context.method(method).arity == 1 # TODO: remove in 0.3.
        warn "[Disposable] Callback handlers now receive two options: #{method}(twin, options)."
        return Dispatch.new(@twin).(event, method, property_options) { |twin| context.send(method, twin) }
      end

      Dispatch.new(@twin).(event, method, property_options) { |twin| context.send(method, twin, options) }
    end