void InternalSubscription::PublishResults(const boost::system::error_code& error)
    {
      if ( error )
      {
        if (Debug) std::cout << "InternalSubscription | Stopping subscription timer" << std::endl;
        return; 
      }
      if ( HasExpired() )
      {
        if (Debug) { std::cout << "InternalSubscription | Subscription has expired" << std::endl; }
        return; 
      }

      if ( HasPublishResult() && Service.PopPublishRequest(CurrentSession) ) //Check we received a publishrequest before sening respomse
      {

        std::vector<PublishResult> results = PopPublishResult();
        if (results.size() > 0 )
        {
          if (Debug) { std::cout << "InternalSubscription | Subscription has " << results.size() << " results, calling callback" << std::endl; }
          if ( Callback )
          {
            Callback(results[0]);
          }
          else
          {
            if (Debug) std::cout << "InternalSubcsription | No callback defined for this subscription" << std::endl;
          }
         }
      }
      TimerStopped = false;
      Timer.expires_at(Timer.expires_at() + boost::posix_time::milliseconds(Data.RevisedPublishingInterval));
      std::shared_ptr<InternalSubscription> self = shared_from_this();
      Timer.async_wait([self](const boost::system::error_code& error){ self->PublishResults(error); });
    }
示例#2
0
void CExpiredDlg::OnWwreEntercode()
{
	if (HasExpired())
		return;

	CEnterRegDlg dlg;
	dlg.DoModal();
	if (dlg.m_gotCode)
		OnOK();
}
示例#3
0
bool CreateWFOControls(
		CDialog* dlgParent, UINT dlgID,
		CComboBoxEx*& editCtrl, CListCtrl*& listCtrl,
		WWhizFileList** fileList, WArray<int>* foundFiles )
{
	s_ffID = dlgID;

	s_WFOTitleWnd.HookWindow(dlgParent);

	// Make the list control.
	s_ffListCtrl = WNEW CFindFileListCtrl;
	s_ffListCtrl->SubclassDlgItem( IDC_FF_FILES, dlgParent );
	s_ffListCtrl->m_foundFiles = foundFiles;
	s_ffListCtrl->m_fileList = fileList;

	DWORD dwStyle;
	dwStyle = s_ffListCtrl->SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0 ,0);
	dwStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES ;
	s_ffListCtrl->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle );

	CRect rect;
	s_ffListCtrl->GetClientRect(&rect);
	int listWidth = rect.Width() - GetSystemMetrics(SM_CXVSCROLL);

	// Get any saved column widths.
	CString windowProfile = "WindowPositions\\" + MakeWindowID(s_ffID);
	s_sub1Width = AfxGetApp()->GetProfileInt(windowProfile, "Sub1", (int)(listWidth * 0.33));
	s_sub2Width = AfxGetApp()->GetProfileInt(windowProfile, "Sub2", (int)(listWidth * 0.67));
	if (s_sub1Width <= 0)
		s_sub1Width = (int)(s_sub1Width * 0.33);
	if (s_sub2Width <= 0)
		s_sub2Width = (int)(s_sub2Width * 0.67);

	// Set the column names of the list control.
	s_ffListCtrl->InsertColumn(0, "Filename",	LVCFMT_LEFT, s_sub1Width);
	s_ffListCtrl->InsertColumn(1, "Path",		LVCFMT_LEFT, s_sub2Width);

	// Make the edit field.
	s_ffEditCtrl = WNEW CFindFileEdit;
	s_ffEditCtrl->SubclassDlgItem( IDC_FF_FILENAME, dlgParent );
	s_ffEditCtrl->m_buddyList = s_ffListCtrl;

	for (int i = 0; i < m_filenameEditStringArray.GetSize(); ++i)
		s_ffEditCtrl->CComboBox::AddString(m_filenameEditStringArray[i]);

	listCtrl = s_ffListCtrl;
	editCtrl = s_ffEditCtrl;

	if (HasExpired())
		return true;

	return true;
}
示例#4
0
bool GotoTag(const WWhizTag* tag)
{
	if (HasExpired())
		return false;

	if (!tag)
	{
		s_lastMatchedTag = NULL;
		return false;
	}

	if (!ObjModelHelper::VStudioExists())
		return false;

	ObjModelHelper objModel;
	if (!objModel.OpenDocument(tag->GetFilename(), "Auto"))
	{
		s_lastMatchedTag = NULL;
		return false;
	}

//	HWND mdiActiveWnd = (HWND)SendMessage(g_mdiWnd, WM_MDIGETACTIVE, 0, NULL);
//	SetActiveWindow(g_mdiWnd);
//	SetFocus(g_mdiWnd);

//	SendMessage(g_devStudioWnd, WM_KEYUP, VK_ESCAPE, 0);

	// Yes, only a line number exists.  Highlight the line.
	long line = tag->GetLineNumber();
/*	objModel.MoveTo(tag->GetLineNumber(), 1, false);
*/
	// Is it a define?
	if (line != -1)
	{
		// Yes, only a line number exists.  Highlight the line.
		long line = tag->GetLineNumber();
		objModel.MoveTo(line, 1, false);
//		objModel.MoveTo(line, 1, true);
	}
	else
	{
		// Match it via regular expression.
		objModel.MoveTo(1, 1, false);

		CStringArray flagsArray;
		flagsArray.Add("matchcase");

		CString searchString = tag->GetSearchString() + 1;
#ifdef WWHIZ_VC6
		searchString.TrimRight('$');
#endif WWHIZ_VC6
#ifdef WWHIZ_VSNET
		searchString = searchString.TrimRight('$');
#endif WWHIZ_VSNET
		if (!objModel.FindText(searchString, flagsArray))
		{
			AfxMessageBox(CString("Unable to find ") + tag->GetIdent() + CString(".  Please save all files and refresh the tags.\n"));
			return false;
		}
	}
	objModel.ScrollToCenter();
	objModel.SelectLine();

	s_lastMatchedTag = tag;

	return true;
}
示例#5
0
bool CreateTagControls(
		CDialog* dlgParent, UINT dlgID,
		CComboBoxEx*& editParentCtrl, CComboBoxEx*& editTagCtrl, CListCtrl*& listCtrl,
		TagArray* tagArray )
{
	s_ftID = dlgID;

	s_TagTitleWnd.HookWindow(dlgParent);

	// Make the list control.
	s_ftListCtrl = WNEW CFindTagListCtrl;
	s_ftListCtrl->SubclassDlgItem( IDC_FT_TAGS, dlgParent );
	s_ftListCtrl->m_tagArray = tagArray;

	DWORD dwStyle = s_ftListCtrl->SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0 ,0);
	dwStyle |= LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES ;
	s_ftListCtrl->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0,dwStyle );

	CRect rect;
	s_ftListCtrl->GetClientRect(&rect);
	int listWidth = rect.Width() - GetSystemMetrics(SM_CXVSCROLL);

	// Get any saved column widths.
	CString windowProfile = "WindowPositions\\" + MakeWindowID(s_ftID);
	s_sub1Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub1", TYPE_WIDTH);
	s_sub1_5Width	= AfxGetApp()->GetProfileInt(windowProfile, "Sub1_5", (int)((listWidth - s_sub1Width) * 0.25));
	s_sub2Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub2", (int)((listWidth - s_sub1Width) * 0.25));
	s_sub3Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub3", (int)((listWidth - s_sub1Width) * 0.50));
	s_sub4Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub4", 100);
	s_sub5Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub5", 400);
//	s_sub6Width		= AfxGetApp()->GetProfileInt(windowProfile, "Sub6", 400);
	if (s_sub1Width <= 0)
		s_sub1Width = TYPE_WIDTH;
	if (s_sub1_5Width <= 0)
		s_sub1_5Width = (int)((listWidth - s_sub1Width) * 0.25);
	if (s_sub2Width <= 0)
		s_sub2Width = (int)((listWidth - s_sub1Width) * 0.25);
	if (s_sub3Width <= 0)
		s_sub3Width = (int)((listWidth - s_sub1Width) * 0.50);
	if (s_sub4Width <= 0)
		s_sub4Width = 100;
	if (s_sub5Width <= 0)
		s_sub5Width = 400;
//	if (s_sub6Width <= 0)
//		s_sub6Width = 400;

	// Set the column names of the list control.
	s_ftListCtrl->InsertColumn(0, "Type",		LVCFMT_LEFT, s_sub1Width);
	s_ftListCtrl->InsertColumn(1, "Namespace",	LVCFMT_LEFT, s_sub1_5Width);
	s_ftListCtrl->InsertColumn(2, "Parent",		LVCFMT_LEFT, s_sub2Width);
	s_ftListCtrl->InsertColumn(3, "Tag",		LVCFMT_LEFT, s_sub3Width);
	s_ftListCtrl->InsertColumn(4, "Filename",	LVCFMT_LEFT, s_sub4Width);
//	s_ftListCtrl->InsertColumn(5, "Path",		LVCFMT_LEFT, s_sub5Width);
	s_ftListCtrl->InsertColumn(5, "Line",		LVCFMT_LEFT, s_sub5Width);

	// Make the parent edit field.
	s_ftEditParentCtrl = WNEW CFindTagEdit;
	s_ftEditParentCtrl->SubclassDlgItem( IDC_FT_PARENT, dlgParent );
	s_ftEditParentCtrl->m_buddyList = s_ftListCtrl;

	int i;
	for (i = 0; i < m_tagParentEditStringArray.GetSize(); ++i)
		s_ftEditParentCtrl->CComboBox::AddString(m_tagParentEditStringArray[i]);

	// Make the tag edit field.
	s_ftEditTagCtrl = WNEW CFindTagEdit;
	s_ftEditTagCtrl->SubclassDlgItem( IDC_FT_NAME, dlgParent );
	s_ftEditTagCtrl->m_buddyList = s_ftListCtrl;

	for (i = 0; i < m_tagEditStringArray.GetSize(); ++i)
		s_ftEditTagCtrl->CComboBox::AddString(m_tagEditStringArray[i]);

	listCtrl = s_ftListCtrl;
	editParentCtrl = s_ftEditParentCtrl;
	editTagCtrl = s_ftEditTagCtrl;

	if (HasExpired())
		return true;

	return true;
}