当前位置: 首页>>代码示例>>C++>>正文


C++ IEnumerator类代码示例

本文整理汇总了C++中IEnumerator的典型用法代码示例。如果您正苦于以下问题:C++ IEnumerator类的具体用法?C++ IEnumerator怎么用?C++ IEnumerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IEnumerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetPaneIsVisible

	//*************************************************************************
	// Method:		SetPaneIsVisible
	// Description: sets whether or not a pane is visible
	//
	// Parameters:
	//	pane - the pane to set the visibility of
	//	isVisible - true to make the pane visible, false otherwise
	//
	// Return Value: None
	//*************************************************************************
	void DockablePaneManager::SetPaneIsVisible(DockablePane *pane, bool isVisible)
	{
		if (!pane)
			return;

		ArrayList *list;
		IEnumerator *enumerator;

		// check the pane list for the pane
		list = dynamic_cast<ArrayList *>(groupToContentListTable->get_Item(pane->Group));
		if (list && (list->Count > 0))
		{
			enumerator = list->GetEnumerator();
			while (enumerator->MoveNext())
			{
				Content *currContent = dynamic_cast<Content *>(enumerator->Current);
				if (!currContent)
					continue;

				DockablePane *currPane = dynamic_cast<DockablePane *>(currContent->Control);
				if (currPane && (currPane->Name->Equals(pane->Name)))
				{
					if (isVisible)
						dockManager->ShowContent(currContent);
					else
						dockManager->HideContent(currContent);
				}
			}
		}
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:40,代码来源:DockablePaneManager.cpp

示例2: GetIsPaneVisible

	//*************************************************************************
	// Method:		GetIsPaneVisible
	// Description: gets whether or not a pane is visible
	//
	// Parameters:
	//	pane - the pane to set the visibility of
	//
	// Return Value: true if the pane is visible, false otherwise
	//*************************************************************************
	bool DockablePaneManager::GetIsPaneVisible(DockablePane *pane)
	{
		if (!pane)
			return false;

		ArrayList *list;
		IEnumerator *enumerator;

		// check the pane list for the pane
		list = dynamic_cast<ArrayList *>(groupToContentListTable->get_Item(pane->Group));
		if (list && (list->Count > 0))
		{
			enumerator = list->GetEnumerator();
			while (enumerator->MoveNext())
			{
				Content *currContent = dynamic_cast<Content *>(enumerator->Current);
				if (!currContent)
					continue;

				DockablePane *currPane = dynamic_cast<DockablePane *>(currContent->Control);
				if (currPane && (currPane->Name->Equals(pane->Name)))
				{
					return currContent->Visible;
				}
			}
		}

		return false;
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:38,代码来源:DockablePaneManager.cpp

示例3: sqrt

void Dart::Update(int delta)
{
	float distance = sqrt(pow(movementOffset.x, 2) + pow(movementOffset.y, 2));
	position->SetPosition(Point(position->x + movementOffset.x / distance * delta * DART_SPEED,
								position->y + movementOffset.y / distance * delta * DART_SPEED));
	ArrayList* zombies = WorldManager::Instance()->GetImagesByNameN(ZOMBIE);
	IEnumerator* pEnum = zombies->GetEnumeratorN();
	Zombie* zombie = null;
	bool found = false;
	while (pEnum->MoveNext() == E_SUCCESS && !found)
	{
		zombie = (Zombie*)pEnum->GetCurrent();
		Point offset = Point(position->x + ressource->GetWidth()/2 - zombie->position->x - zombie->ressource->GetWidth()/2, position->y + ressource->GetHeight()/2 - zombie->position->y - zombie->ressource->GetHeight()/2);
		float distance = sqrt(pow(offset.x, 2) + pow(offset.y, 2));
		if(distance < 50)
		{
			Image* bitmapDecoder = new Image();
			bitmapDecoder->Construct();
			WorldManager::Instance()->AddImage(new KImage(bitmapDecoder->DecodeN(L"/Home/Res/zombie_dead.png", BITMAP_PIXEL_FORMAT_ARGB8888), new Point(*(zombie->position)), ZOMBIE_DEAD));
			WorldManager::Instance()->DeleteImage(zombie);
			WorldManager::Instance()->DeleteImage(this);
			delete bitmapDecoder;
			found = true;
		}
	}

	delete pEnum;
	delete zombies;

}
开发者ID:Azagthoth,项目名称:KawaiiZombie,代码行数:30,代码来源:Dart.cpp

示例4: while

// This internal function adds each file that matches file specification, then does this for each subdirectory if requested
void ZipFile::AddFilesToZip(String* FileSpec, String* CurrDirectory, int RootPathLength, Boolean RecurseSubdirectories, PathInclusion AddPathMethod, char* Password)
{
	IEnumerator* filesEnum = Directory::GetFiles(CurrDirectory, FileSpec)->GetEnumerator();
	String* fullFileName;
	String* adjustedFileName;

	while (filesEnum->MoveNext())
	{
		fullFileName = filesEnum->Current->ToString();

		adjustedFileName = GetAdjustedFileName(fullFileName, RootPathLength, AddPathMethod);

		if (files->Find(adjustedFileName, false)) throw new CompressionException(String::Concat(S"Failed to add file \"",  fullFileName, "\" to zip, compressed file with this same name already exists in zip file.  Try using \"Update\" instead."));

		AddFileToZip(this, NULL, fullFileName, adjustedFileName, Password, S"Add Zip File");
	}

	if (RecurseSubdirectories)
	{
		IEnumerator* dirsEnum = Directory::GetDirectories(CurrDirectory, "*")->GetEnumerator();

		while (dirsEnum->MoveNext())
			AddFilesToZip(FileSpec, dirsEnum->Current->ToString(), RootPathLength, RecurseSubdirectories, AddPathMethod, Password);
	}
}
开发者ID:avs009,项目名称:gsf,代码行数:26,代码来源:ZipFile.cpp

示例5:

	//*************************************************************************
	// Method:		GetPane
	// Description: gets a dockable pane based on group and name
	//
	// Parameters:
	//	group - the group name of the pane
	//	name - the name of the pane
	//
	// Return Value: the pane if found, NULL otherwise
	//*************************************************************************
	DockablePane *DockablePaneManager::GetPane(String *group, String *name)
	{
		if (!group || !name)
			return NULL;

		ArrayList *list;
		IEnumerator *enumerator;

		// check the pane list
		list = dynamic_cast<ArrayList *>(groupToContentListTable->get_Item(group));
		if (list && (list->Count > 0))
		{
			enumerator = list->GetEnumerator();
			while (enumerator->MoveNext())
			{
				Content *currContent = dynamic_cast<Content *>(enumerator->Current);
				if (!currContent)
					continue;

				DockablePane *currPane = dynamic_cast<DockablePane *>(currContent->Control);
				if (currPane && (currPane->Name->Equals(name)))
					return currPane;
			}
		}

		// not found, return null
		return NULL;
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:38,代码来源:DockablePaneManager.cpp

示例6: ArrayList

	//*************************************************************************
	// Method:		RefreshLayout
	// Description: refreshes the layout of the pane groups based on positions
	//
	// Parameters:
	//	None
	//
	// Return Value: None
	//*************************************************************************
	void DockablePaneManager::RefreshLayout()
	{
		lastVerticalLeftContentAdded = NULL;
		lastVerticalRightContentAdded = NULL;
		lastHorizontalTopContentAdded = NULL;
		lastHorizontalBottomContentAdded = NULL;

		ArrayList *groupNames = new ArrayList();
		IEnumerator *enumerator = groupToContentListTable->Keys->GetEnumerator();
		while (enumerator->MoveNext())
		{
			String *group = dynamic_cast<String *>(enumerator->Current);
			if (!group)
				continue;

			groupNames->Add(group);
		}

		enumerator = groupNames->GetEnumerator();
		while (enumerator->MoveNext())
		{
			String *group = dynamic_cast<String *>(enumerator->Current);
			if (!group)
				continue;

			RefreshLayoutOfGroup(group);
		}
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:37,代码来源:DockablePaneManager.cpp

示例7: Date

result
User::updateFromDictionary(HashMap *dictionary)
{
	result success = E_FAILURE;

	if (dictionary && !dictionary->ContainsKey(kHTTPParamNameError)) {
		Double *idValue = static_cast<Double *>(dictionary->GetValue(kHTTPParamNameUserID));
		if (idValue) {
			_id = idValue->ToInt();
			success = E_SUCCESS;
		}

		String *usernameValue = static_cast<String *>(dictionary->GetValue(kHTTPParamNameUsername));
		if (usernameValue) {
			_username = *usernameValue;
			success = E_SUCCESS;
		}

		String *emailValue = static_cast<String *>(dictionary->GetValue(kHTTPParamNameEmail));
		if (emailValue) {
			_email = *emailValue;
			success = E_SUCCESS;
		}

		String *avatarUrlValue = static_cast<String *>(dictionary->GetValue(kHTTPParamNameAvatarUrl));
		if (avatarUrlValue) {
			_avatarUrl = *avatarUrlValue;
			success = E_SUCCESS;
		}

		HashMap *dateDictionary = static_cast<HashMap *>(dictionary->GetValue(kHTTPParamNameDateCreated));
		if (dateDictionary) {
			_dateCreated = new Date();
			result dateSuccess = _dateCreated->updateFromDictionary(dateDictionary);
			if (IsFailed(dateSuccess)) {
				delete _dateCreated;
				_dateCreated = NULL;
			} else {
				success = E_SUCCESS;
			}
		}

		if (!IsFailed(success)) {
			if (_listeners) {
				IEnumerator *iter = _listeners->GetEnumeratorN();
				while (iter->MoveNext() == E_SUCCESS) {
					UserListener *listener = static_cast<UserListener *>(iter->GetCurrent());
					listener->onUserUpdate(this);
				}
				delete iter;
			}
		}
	}

	return success;
}
开发者ID:justinkchen,项目名称:giraffe,代码行数:56,代码来源:User.cpp

示例8: ArrayList

	//*************************************************************************
	// Method:		get_VisibleColumns
	// Description: get method of the VisibleColumns property
	//
	// Parameters:
	//	None
	//
	// Return Value: the visible column headers to get
	//*************************************************************************
	ArrayList *ScheduledTestPane::get_VisibleColumns()
	{
		ArrayList *returnValue = new ArrayList();

		IEnumerator *enumerator = listView->Columns->GetEnumerator();
		while (enumerator->MoveNext())
			returnValue->Add(enumerator->Current);

		return returnValue;
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:19,代码来源:ScheduledTestPane.cpp

示例9: TypeCollect

void CCppConfigGenerator::TypeCollect( XmlSchema* schema, TypeCollectContext& ctx)
{
	IEnumerator<XmlSchemaElement>* pEnumEle = schema->EnumGlobalElement();
	if(pEnumEle)
	{
		while(pEnumEle->MoveNext())
		{
			TypeCollect(pEnumEle->Current(), types);
		}
	}
}
开发者ID:yedaoq,项目名称:YedaoqToolSpace,代码行数:11,代码来源:CppConfigGenerator.cpp

示例10: Collect

void CTypeCollector::Collect( CXmlSchema* schema, Xsd2CppContext& ctx)
{
	IEnumerator<XmlSchemaElement>* pEnumEle = schema->EnumGlobalElement();
	if(pEnumEle)
	{
		while(pEnumEle->MoveNext())
		{
			Collect(schema->GetElement(pEnumEle->Current().Name), ctx);
		}
	}
}
开发者ID:yedaoq,项目名称:YedaoqToolSpace,代码行数:11,代码来源:TypeCollecter.cpp

示例11: set_Function

	//*************************************************************************
	// Method:		set_Function
	// Description: Set method for the Function property
	//
	// Parameters:
	//	value - the name of the function to set
	//
	// Return Value: None
	//*************************************************************************
	void TestOutParamSelectionPage::set_Function(String *value)
	{
		this->function = value;

		if (!function)
			return;

		InterceptedFunctionDB *db;
		if (function->IndexOf('.') != -1)
			db = InterceptedFunctionDB::GetInstance(DOT_NET_FUNC_DB_FILE_NAME);
		else
			db = InterceptedFunctionDB::GetInstance(FUNCTION_DB_FILE_NAME);

		if (!db)
			return;

		InterceptedFunction *f = db->GetFunctionByName(function);
		if (!f)
		{
			//may have been stripped of A/W so add it back on.
			f = db->GetFunctionByName(String::Concat(function, "A"));
			if (!f)
				return;
		}

		paramListView->Items->Clear();

		IEnumerator *enumerator = f->Parameters->GetEnumerator();
		while (enumerator->MoveNext())
		{
			InterceptedFunctionParameter *param = dynamic_cast<InterceptedFunctionParameter *>(enumerator->Current);
			if (!param)
				continue;

			// make sure this is an out or in out parameter
			if ((param->Access) && ( (param->Access->ToUpper()->IndexOf("OUT") != -1) || (param->Access->ToUpper()->IndexOf("NONE") != -1)) )
			{
				ListViewItem *newItem = new ListViewItem();
				newItem->Text = param->ID.ToString();
				newItem->SubItems->Add(param->Name);
				newItem->SubItems->Add(OUT_PARAM_NO_CHANGE_STRING);

				paramListView->Items->Add(newItem);
			}
		}

		if (paramListView->Items->Count > 0)
			paramListView->Items->get_Item(0)->Selected = true;
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:58,代码来源:TestOutParamSelectionPage.cpp

示例12: AppLogTag

v8::Handle<v8::Value> Contacts::isExistCategory(const v8::Arguments& args) {
	AppLogTag("Contacts", "Entered Contacts::isExistCategory (args: length:%d)", args.Length());

    if (args.Length() < 1 || Util::isArgumentNull(args[0])) {
        AppLog("Bad parameters");
        return v8::ThrowException(v8::String::New("Bad parameters"));
    }
    String name = null;
    v8::HandleScope scope;
    if(args[0]->IsString())
    {
    	name = UNWRAP_STRING(args[0]).c_str();
    	AppLogTag("Contacts","check Category:%ls", name.GetPointer());
    }

    if(name == null)
    {
    	AppLogTag("Contacts","category name is null");
    	return scope.Close(v8::Boolean::New(false));
    }

    AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
    Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);

    IList* pCategoryList = pAddressbook->GetAllCategoriesN();

    result r = GetLastResult();

    if (IsFailed(r)) {
        AppLog("Failed to get addressbook: %s", GetErrorMessage(r));
        return scope.Close(v8::Boolean::New(false));
    }

    if (pCategoryList != null && pCategoryList->GetCount() > 0) {
        IEnumerator* pCategoryEnum = pCategoryList->GetEnumeratorN();
        Category* pCategory = null;

        while (pCategoryEnum->MoveNext() == E_SUCCESS) {
            pCategory = static_cast<Category*>(pCategoryEnum->GetCurrent());
            if (pCategory->GetName().Equals(name)) {
            	AppLog("It is existed category");
            	return scope.Close(v8::Boolean::New(true));
            }
        }
    }

    AppLog("Non-exist category");
    return scope.Close(v8::Boolean::New(false));
}
开发者ID:bylee,项目名称:cantata-jsbind,代码行数:49,代码来源:tizenair-contact.cpp

示例13: OpenFileForUnzip

// Removes specified files from zip
void ZipFile::Remove(String* FileSpec, Boolean RecurseSubdirectories)
{
	ZipFile* tempZipFile;
	OpenFileForUnzip();

	// Just wrapping in a try/catch/finally to make sure temp zip file gets removed
	try
	{
		Regex* filePattern = GetFilePatternRegularExpression(FileSpec, caseSensitive);
		IEnumerator* filesEnum = files->GetEnumerator();
		CompressedFile* file;

		// Create temporary zip file to hold remove results
		tempZipFile = CreateTempZipFile();

		// Loop through compressed file collection
		while (filesEnum->MoveNext())
		{
			file = static_cast<CompressedFile*>(filesEnum->Current);

			// We copy all files into destination zip file except those user requested to be removed...
			if (!filePattern->IsMatch(GetSearchFileName(FileSpec, file->get_FileName(), RecurseSubdirectories)))
				CopyFileInZip(file, this, tempZipFile, S"Remove Zip File");
		}

		// Now make the temp file the new zip file
		Close();
		tempZipFile->Close();
		File::Delete(fileName);
		File::Move(tempZipFile->fileName, fileName);
	}
	catch (CompressionException* ex)		
	{
		// We just rethrow any errors back to user
		throw ex;
	}
	catch (Exception* ex)
	{
		throw ex;
	}
	__finally
	{
		// If everything went well, temp zip will no longer exist, but just in case we tidy up and delete the temp file...
		DeleteTempZipFile(tempZipFile);
	}

	// We'll reload the file list after remove if requested...
	if (autoRefresh) Refresh();
}
开发者ID:avs009,项目名称:gsf,代码行数:50,代码来源:ZipFile.cpp

示例14: StringSplice

tstring StringSplice(IEnumerator<tstring>& source, tstring connecter)
{
	tstring result;
	if(source.MoveNext())
	{
		result = source.Current();
		while(source.MoveNext())
		{
			result += connecter;
			result += source.Current();
		}
	}

	return result;
}
开发者ID:yedaoq,项目名称:YedaoqCodeSpace,代码行数:15,代码来源:Helper.cpp

示例15: set_Parameters

	//*************************************************************************
	// Method:		set_Parameters
	// Description: set method of the Parameters property
	//
	// Parameters:
	//	value - the parameters to set
	//
	// Return Value: None
	//*************************************************************************
	void TestOutParamSelectionPage::set_Parameters(ArrayList *value)
	{
		paramListView->Items->Clear();
		IEnumerator *enumerator = value->GetEnumerator();
		while (enumerator->MoveNext())
		{
			InterceptedFunctionParameter *param = dynamic_cast<InterceptedFunctionParameter *>(enumerator->Current);
			if (!param)
				continue;

			ListViewItem *item = new ListViewItem(param->ID.ToString());
			item->SubItems->Add(param->Name);
			item->SubItems->Add(param->ChangeValue);

			paramListView->Items->Add(item);
		}
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:26,代码来源:TestOutParamSelectionPage.cpp


注:本文中的IEnumerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。