private void OnCssDownloadComplete_(object sender, EventArgs args) { CssTreeNode cssTreeNode = (CssTreeNode)sender; string css = cssTreeNode.CalcCss(); string escapedCss = StringUtils.CleanForJSON(css); string href = cssTreeNode.Href; cssData_[href] = escapedCss; if (waitHandles_.TryGetValue(cssTreeNode, out AutoResetEvent waitHandle)) { waitHandle.Set(); lock (lockObject_) { waitHandles_.Remove(cssTreeNode); } } }
private void OnCssDownloadComplete_(object sender, EventArgs args) { logger_.Verbose("enter"); CssTreeNode cssTreeNode = (CssTreeNode)sender; string css = cssTreeNode.CalcCss(); string escapedCss = StringUtils.CleanForJSON(css); string href = cssTreeNode.Href; cssData_[href] = escapedCss; if (waitHandles_.TryGetValue(cssTreeNode, out AutoResetEvent waitHandle)) { logger_.Verbose("calling 'set' on waithandle {0}", waitHandle.GetHashCode()); waitHandle.Set(); lock (lockObject_) { waitHandles_.Remove(cssTreeNode); } } logger_.Verbose("exit"); }