您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AsShared函数代码示例

51自学网 2021-06-01 19:47:36
  C++
这篇教程C++ AsShared函数代码示例写得很实用,希望能帮到您。

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

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

示例1: AsShared

void FMessageBridge::Enable(){	if (Enabled || !Bus.IsValid() || !Transport.IsValid())	{		return;	}	// enable subscription & transport	if (!Transport->StartTransport())	{		return;	}	Bus->Register(Address, AsShared());	if (MessageSubscription.IsValid())	{		MessageSubscription->Enable();	}	else	{		MessageSubscription = Bus->Subscribe(AsShared(), NAME_All, FMessageScopeRange::AtLeast(EMessageScope::Network));	}	Enabled = true;}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:26,


示例2: TagMeta

TSharedRef< ITableRow > FDetailItemNode::GenerateNodeWidget( const TSharedRef<STableViewBase>& OwnerTable, const FDetailColumnSizeData& ColumnSizeData, const TSharedRef<IPropertyUtilities>& PropertyUtilities, bool bAllowFavoriteSystem){	FTagMetaData TagMeta(TEXT("DetailRowItem"));	if (ParentCategory.IsValid())	{		if (Customization.IsValidCustomization() && Customization.GetPropertyNode().IsValid())		{			TagMeta.Tag = *FString::Printf(TEXT("DetailRowItem.%s"), *Customization.GetPropertyNode()->GetDisplayName().ToString());		}		else if (Customization.HasCustomWidget() )		{			TagMeta.Tag = Customization.GetWidgetRow().RowTagName;		}	}	if( Customization.HasPropertyNode() && Customization.GetPropertyNode()->AsCategoryNode() )	{		return			SNew(SDetailCategoryTableRow, AsShared(), OwnerTable)			.DisplayName(Customization.GetPropertyNode()->GetDisplayName())			.AddMetaData<FTagMetaData>(TagMeta)			.InnerCategory( true );	}	else	{		return			SNew(SDetailSingleItemRow, &Customization, HasMultiColumnWidget(), AsShared(), OwnerTable )			.AddMetaData<FTagMetaData>(TagMeta)			.ColumnSizeData(ColumnSizeData)			.AllowFavoriteSystem(bAllowFavoriteSystem);	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,


示例3: MakeShareable

void FSessionInfo::UpdateFromMessage( const FSessionServicePong& Message, const IMessageContextRef& Context ){	if (Message.SessionId != SessionId)	{		return;	}	// update session info	Standalone = Message.Standalone;	SessionOwner = Message.SessionOwner;	SessionName = Message.SessionName;	// update instance	TSharedPtr<FSessionInstanceInfo>& Instance = Instances.FindOrAdd(Context->GetSender());	if (Instance.IsValid())	{		Instance->UpdateFromMessage(Message, Context);	}	else	{		IMessageBusPtr MessageBus = MessageBusPtr.Pin();		if (MessageBus.IsValid())		{			Instance = MakeShareable(new FSessionInstanceInfo(Message.InstanceId, AsShared(), MessageBus.ToSharedRef()));			Instance->OnLogReceived().AddSP(this, &FSessionInfo::HandleLogReceived);			Instance->UpdateFromMessage(Message, Context);			InstanceDiscoveredEvent.Broadcast(AsShared(), Instance.ToSharedRef());		}	}	LastUpdateTime = FDateTime::UtcNow();}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:35,


示例4: GetKeyUnderMouse

FReply SSection::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ){	DistanceDragged = 0;	DragOperation.Reset();	bDragging = false;	if( MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton || MouseEvent.GetEffectingButton() == EKeys::RightMouseButton )	{		// Check for clicking on a key and mark it as the pressed key for drag detection (if necessary) later		PressedKey = GetKeyUnderMouse( MouseEvent.GetScreenSpacePosition(), MyGeometry );		if( !PressedKey.IsValid() && MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton )		{			CheckForEdgeInteraction( MouseEvent, MyGeometry );		}		return FReply::Handled().CaptureMouse( AsShared() );	}	else if( MouseEvent.GetEffectingButton() == EKeys::RightMouseButton )	{		return FReply::Handled().CaptureMouse(AsShared());	}	return FReply::Handled();}
开发者ID:colwalder,项目名称:unrealengine,代码行数:27,


示例5: Invalidate

void FSCSEditorViewportClient::ProcessClick(class FSceneView& View, class HHitProxy* HitProxy, FKey Key, EInputEvent Event, uint32 HitX, uint32 HitY){	if(HitProxy)	{		if(HitProxy->IsA(HInstancedStaticMeshInstance::StaticGetType()))		{			HInstancedStaticMeshInstance* InstancedStaticMeshInstanceProxy = ( ( HInstancedStaticMeshInstance* )HitProxy );			TSharedPtr<ISCSEditorCustomization> Customization = BlueprintEditorPtr.Pin()->CustomizeSCSEditor(InstancedStaticMeshInstanceProxy->Component);			if(Customization.IsValid() && Customization->HandleViewportClick(AsShared(), View, HitProxy, Key, Event, HitX, HitY))			{				Invalidate();			}		}		else if(HitProxy->IsA(HActor::StaticGetType()))		{			HActor* ActorProxy = (HActor*)HitProxy;			AActor* PreviewActor = GetPreviewActor();			if(ActorProxy && ActorProxy->Actor && ActorProxy->Actor == PreviewActor && ActorProxy->PrimComponent != NULL)			{				TInlineComponentArray<USceneComponent*> SceneComponents;				ActorProxy->Actor->GetComponents(SceneComponents);					for(auto CompIt = SceneComponents.CreateConstIterator(); CompIt; ++CompIt)				{					USceneComponent* CompInstance = *CompIt;					TSharedPtr<ISCSEditorCustomization> Customization = BlueprintEditorPtr.Pin()->CustomizeSCSEditor(CompInstance);					if (Customization.IsValid() && Customization->HandleViewportClick(AsShared(), View, HitProxy, Key, Event, HitX, HitY))					{						break;					}					if (CompInstance == ActorProxy->PrimComponent)					{						const bool bIsCtrlKeyDown = Viewport->KeyState(EKeys::LeftControl) || Viewport->KeyState(EKeys::RightControl);						if (BlueprintEditorPtr.IsValid())						{							// Note: This will find and select any node associated with the component instance that's attached to the proxy (including visualizers)							BlueprintEditorPtr.Pin()->FindAndSelectSCSEditorTreeNode(CompInstance, bIsCtrlKeyDown);						}						break;					}				}			}			Invalidate();		}		// Pass to component vis manager		//GUnrealEd->ComponentVisManager.HandleProxyForComponentVis(HitProxy);	}}
开发者ID:Codermay,项目名称:Unreal4,代码行数:52,


示例6: FWidgetPath

FReply SAnimationOutlinerTreeNode::OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ){	if( MouseEvent.GetEffectingButton() == EKeys::RightMouseButton )	{		TSharedPtr<SWidget> MenuContent = DisplayNode->OnSummonContextMenu(MyGeometry, MouseEvent);		if (MenuContent.IsValid())		{			FWidgetPath WidgetPath = MouseEvent.GetEventPath() != nullptr ? *MouseEvent.GetEventPath() : FWidgetPath();			FSlateApplication::Get().PushMenu(				AsShared(),				WidgetPath,				MenuContent.ToSharedRef(),				MouseEvent.GetScreenSpacePosition(),				FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu )				);						return FReply::Handled().SetUserFocus(MenuContent.ToSharedRef(), EFocusCause::SetDirectly);		}		return FReply::Handled();	}	return FReply::Unhandled();}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:25,


示例7: Press

FReply SButton::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ){	FReply Reply = FReply::Unhandled();	if (IsEnabled() && (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton || MouseEvent.IsTouchEvent()))	{		Press();				if( ClickMethod == EButtonClickMethod::MouseDown )		{			//get the reply from the execute function			Reply = OnClicked.IsBound() ? OnClicked.Execute() : FReply::Handled();			//You should ALWAYS handle the OnClicked event.			ensure(Reply.IsEventHandled() == true);		}		else if ( IsPreciseTapOrClick(MouseEvent) )		{			// do not capture the pointer for precise taps or clicks			// 		}		else		{			//we need to capture the mouse for MouseUp events			Reply =  FReply::Handled().CaptureMouse( AsShared() );		}	}	Invalidate(EInvalidateWidget::Layout);	//return the constructed reply	return Reply;}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:32,


示例8: FLauncherProfile

ILauncherProfilePtr FLauncherProfileManager::LoadJSONProfile(FString ProfileFile){	FLauncherProfile* Profile = new FLauncherProfile(AsShared());	FString FileContents;	if (!FFileHelper::LoadFileToString(FileContents, *ProfileFile))	{		return nullptr;	}	TSharedPtr<FJsonObject> Object;	TSharedRef<TJsonReader<> > Reader = TJsonReaderFactory<>::Create(FileContents);	if (!FJsonSerializer::Deserialize(Reader, Object) || !Object.IsValid())	{		return nullptr;	}	if (Profile->Load(*(Object.Get())))	{		ILauncherDeviceGroupPtr DeviceGroup = GetDeviceGroup(Profile->GetDeployedDeviceGroupId());		if (!DeviceGroup.IsValid())		{			DeviceGroup = AddNewDeviceGroup();		}		Profile->SetDeployedDeviceGroup(DeviceGroup);		return MakeShareable(Profile);	}	return nullptr;}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,


示例9: GetColor

FReply SGraphPinColor::OnColorBoxClicked(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent){	if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton)	{		SelectedColor = GetColor();		TArray<FLinearColor*> LinearColorArray;		LinearColorArray.Add(&SelectedColor);		FColorPickerArgs PickerArgs;		PickerArgs.bIsModal = true;		PickerArgs.ParentWidget = AsShared();		PickerArgs.DisplayGamma = TAttribute<float>::Create(TAttribute<float>::FGetter::CreateUObject(GEngine, &UEngine::GetDisplayGamma));		PickerArgs.LinearColorArray = &LinearColorArray;		PickerArgs.OnColorCommitted = FOnLinearColorValueChanged::CreateSP(this, &SGraphPinColor::OnColorCommitted);		PickerArgs.bUseAlpha = true;		OpenColorPicker(PickerArgs);		return FReply::Handled();	}	else	{		return FReply::Unhandled();	}}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:25,


示例10: MakeShareable

void FMessageBridge::HandleTransportMessageReceived( FArchive& MessageData, const IMessageAttachmentPtr& Attachment, const FGuid& NodeId ){	if (!Enabled || !Bus.IsValid())	{		return;	}	IMutableMessageContextRef MessageContext = MakeShareable(new FMessageContext());	if (Serializer->DeserializeMessage(MessageData, MessageContext))	{		if (MessageContext->GetExpiration() >= FDateTime::UtcNow())		{			// register newly discovered endpoints			if (!AddressBook.Contains(MessageContext->GetSender()))			{				AddressBook.Add(MessageContext->GetSender(), NodeId);				Bus->Register(MessageContext->GetSender(), AsShared());			}			// forward the message to the internal bus			MessageContext->SetAttachment(Attachment);			Bus->Forward(MessageContext, MessageContext->GetRecipients(), EMessageScope::Process, FTimespan::Zero(), AsShared());		}	}}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:28,


示例11: UE_LOG

void FNavigationPath::SetGoalActorObservation(const AActor& ActorToObserve, float TetherDistance){	if (NavigationDataUsed.IsValid() == false)	{		// this mechanism is available only for navigation-generated paths		UE_LOG(LogNavigation, Warning, TEXT("Updating navigation path on goal actor's location change is available only for navigation-generated paths. Called for %s")			, *GetNameSafe(&ActorToObserve));		return;	}	else if (IsValid() == false)	{		UE_LOG(LogNavigation, Log, TEXT("FNavigationPath::SetGoalActorObservation called for an invalid path. Skipping."));		return;	}	// register for path observing only if we weren't registered already	const bool RegisterForPathUpdates = GoalActor.IsValid() == false;		GoalActor = &ActorToObserve;	checkSlow(GoalActor.IsValid());	GoalActorAsNavAgent = Cast<INavAgentInterface>(&ActorToObserve);	GoalActorLocationTetherDistanceSq = FMath::Square(TetherDistance);	UpdateLastRepathGoalLocation();	NavigationDataUsed->RegisterObservedPath(AsShared());}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:25,


示例12: RegisterActiveTimer

FReply STableViewBase::OnTouchMoved( const FGeometry& MyGeometry, const FPointerEvent& InTouchEvent ){	if (bStartedTouchInteraction)	{		const float ScrollByAmount = InTouchEvent.GetCursorDelta().Y / MyGeometry.Scale;		AmountScrolledWhileRightMouseDown += FMath::Abs( ScrollByAmount );		TickScrollDelta -= ScrollByAmount;		if (AmountScrolledWhileRightMouseDown > FSlateApplication::Get().GetDragTriggerDistance())		{			// Make sure the active timer is registered to update the inertial scroll			if ( !bIsScrollingActiveTimerRegistered )			{				bIsScrollingActiveTimerRegistered = true;				RegisterActiveTimer(0.f, FWidgetActiveTimerDelegate::CreateSP(this, &STableViewBase::UpdateInertialScroll));			}			const float AmountScrolled = this->ScrollBy( MyGeometry, -ScrollByAmount, EAllowOverscroll::Yes );			// The user has moved the list some amount; they are probably			// trying to scroll. From now on, the list assumes the user is scrolling			// until they lift their finger.			return FReply::Handled().CaptureMouse( AsShared() );		}		return FReply::Handled();	}	else	{		return FReply::Handled();	}}
开发者ID:colwalder,项目名称:unrealengine,代码行数:31,


示例13: GetLinearExecutionPath

void FScriptExecutionNode::GetLinearExecutionPath(TArray<FLinearExecPath>& LinearExecutionNodes, const FTracePath& TracePath, const bool bIncludeChildren){	LinearExecutionNodes.Add(FLinearExecPath(AsShared(), TracePath));	if (bIncludeChildren)	{		for (auto Child : ChildNodes)		{			FTracePath ChildTracePath(TracePath);			Child->GetLinearExecutionPath(LinearExecutionNodes, ChildTracePath, bIncludeChildren);		}	}	if (bIncludeChildren || GetNumLinkedNodes() == 1)	{		for (auto NodeIter : LinkedNodes)		{			if (HasFlags(EScriptExecutionNodeFlags::PureStats))			{				continue;			}			else			{				FTracePath NewTracePath(TracePath);				if (NodeIter.Value->HasFlags(EScriptExecutionNodeFlags::EventPin))				{					NewTracePath.ResetPath();				}				if (NodeIter.Key != INDEX_NONE && !HasFlags(EScriptExecutionNodeFlags::InvalidTrace))				{					NewTracePath.AddExitPin(NodeIter.Key);				}				NodeIter.Value->GetLinearExecutionPath(LinearExecutionNodes, NewTracePath, bIncludeChildren);			}		}	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:35,


示例14: AsShared

TSharedPtr<SWidget> SGraphPanel::SummonContextMenu(const FVector2D& WhereToSummon, const FVector2D& WhereToAddNode, UEdGraphNode* ForNode, UEdGraphPin* ForPin, const TArray<UEdGraphPin*>& DragFromPins, bool bShiftOperation){	if (OnGetContextMenuFor.IsBound())	{		FGraphContextMenuArguments SpawnInfo;		SpawnInfo.NodeAddPosition = WhereToAddNode;		SpawnInfo.GraphNode = ForNode;		SpawnInfo.GraphPin = ForPin;		SpawnInfo.DragFromPins = DragFromPins;		SpawnInfo.bShiftOperation = bShiftOperation;		FActionMenuContent FocusedContent = OnGetContextMenuFor.Execute(SpawnInfo);		TSharedRef<SWidget> MenuContent = FocusedContent.Content;				FSlateApplication::Get().PushMenu(			AsShared(),			MenuContent,			WhereToSummon,			FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu )			);		return FocusedContent.WidgetToFocus;	}	return TSharedPtr<SWidget>();}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:27,


示例15: GetTarget

FReply SLocalizationDashboardTargetRow::ExportAll(){	ULocalizationTarget* const LocalizationTarget = GetTarget();	IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();	if (LocalizationTarget && DesktopPlatform)	{		void* ParentWindowWindowHandle = NULL;		const TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(AsShared());		if (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid())		{			ParentWindowWindowHandle = ParentWindow->GetNativeWindow()->GetOSWindowHandle();		}		const FString DefaultPath = FPaths::ConvertRelativePathToFull(LocalizationConfigurationScript::GetDataDirectory(LocalizationTarget->Settings));		FText DialogTitle;		{			FFormatNamedArguments FormatArguments;			FormatArguments.Add(TEXT("TargetName"), FText::FromString(LocalizationTarget->Settings.Name));			DialogTitle = FText::Format(LOCTEXT("ExportAllTranslationsForTargetDialogTitleFormat", "Export All Translations for {TargetName} to Directory"), FormatArguments);		}		// Prompt the user for the directory		FString OutputDirectory;		if (DesktopPlatform->OpenDirectoryDialog(ParentWindowWindowHandle, DialogTitle.ToString(), DefaultPath, OutputDirectory))		{			LocalizationCommandletTasks::ExportTarget(ParentWindow.ToSharedRef(), LocalizationTarget->Settings, TOptional<FString>(OutputDirectory));		}	}	return FReply::Handled();}
开发者ID:Codermay,项目名称:Unreal4,代码行数:32,


示例16: SNew

TSharedRef< ITableRow > FDetailCategoryGroupNode::GenerateNodeWidget( const TSharedRef<STableViewBase>& OwnerTable, const FDetailColumnSizeData& ColumnSizeData, const TSharedRef<IPropertyUtilities>& PropertyUtilities, bool bAllowFavoriteSystem){	return		SNew( SDetailCategoryTableRow, AsShared(), OwnerTable )		.DisplayName( FText::FromName(GroupName) )		.InnerCategory( true );}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,


示例17: OnGoBackInHistory

void FTabInfo::JumpToNearestValidHistoryData(){	if(!History[CurrentHistoryIndex]->IsHistoryValid())	{		if(History.Num() == 1)		{			Tab.Pin()->RequestCloseTab();		}		else		{			OnGoBackInHistory();			if(!History[CurrentHistoryIndex]->IsHistoryValid())			{				OnGoForwardInHistory();				if(!History[CurrentHistoryIndex]->IsHistoryValid())				{					// There are no valid history nodes to switch to, delete the tab					Tab.Pin()->RequestCloseTab();					return;				}			}			History[CurrentHistoryIndex]->EvokeHistory(AsShared());			History[CurrentHistoryIndex]->RestoreHistory();			History[CurrentHistoryIndex]->GetFactory().Pin()->OnTabActivated(Tab.Pin());			FGlobalTabmanager::Get()->SetActiveTab(nullptr);			FSlateApplication::Get().ClearKeyboardFocus(EFocusCause::SetDirectly);		}	}}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:32,


示例18: MakeShareable

ILauncherProfileRef FLauncherProfileManager::AddNewProfile(){	// find a unique name for the profile.	int32 ProfileIndex = SavedProfiles.Num();	FString ProfileName = FString::Printf(TEXT("New Profile %d"), ProfileIndex);	for (int32 Index = 0; Index < SavedProfiles.Num(); ++Index)	{		if (SavedProfiles[Index]->GetName() == ProfileName)		{			ProfileName = FString::Printf(TEXT("New Profile %d"), ++ProfileIndex);			Index = -1;			continue;		}	}	// create and add the profile	ILauncherProfileRef NewProfile = MakeShareable(new FLauncherProfile(AsShared(), FGuid::NewGuid(), ProfileName));	AddProfile(NewProfile);	SaveProfile(NewProfile);	return NewProfile;}
开发者ID:Codermay,项目名称:Unreal4,代码行数:26,


示例19: AddTabHistory

void FTabInfo::AddTabHistory(TSharedPtr< struct FGenericTabHistory > InHistoryNode, bool bInSaveHistory/* = true*/){	// If the tab is not new, save the current history.	if(CurrentHistoryIndex >= 0 && bInSaveHistory)	{		History[CurrentHistoryIndex]->SaveHistory();	}	if (CurrentHistoryIndex == History.Num() - 1)	{		// History added to the end		if (History.Num() == WorkflowTabManagerHelpers::MaxHistoryEntries)		{			// If max history entries has been reached			// remove the oldest history			History.RemoveAt(0);		}	}	else	{		// Clear out any history that is in front of the current location in the history list		History.RemoveAt(CurrentHistoryIndex + 1, History.Num() - (CurrentHistoryIndex + 1), true);	}	History.Add(InHistoryNode);	CurrentHistoryIndex = History.Num() - 1;	// Evoke the history	InHistoryNode->EvokeHistory(AsShared());	InHistoryNode->GetFactory().Pin()->OnTabActivated(Tab.Pin());}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:31,


示例20: MakeShareable

void FDetailCategoryImpl::AddPropertyNode( TSharedRef<FPropertyNode> PropertyNode, FName InstanceName ){	FDetailLayoutCustomization NewCustomization;	NewCustomization.PropertyRow = MakeShareable( new FDetailPropertyRow( PropertyNode, AsShared() ) );	AddDefaultLayout( NewCustomization, IsAdvancedLayout( NewCustomization ), InstanceName );}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:7,


示例21: SNew

TSharedRef<ITableRow> FDetailCategoryImpl::GenerateNodeWidget( const TSharedRef<STableViewBase>& OwnerTable, const FDetailColumnSizeData& ColumnSizeData, const TSharedRef<IPropertyUtilities>& PropertyUtilities ) {	return		SNew( SDetailCategoryTableRow, AsShared(), OwnerTable )		.DisplayName( GetDisplayName() )		.HeaderContent( HeaderContentWidget );}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:7,


示例22: GetParentLayoutImpl

IDetailPropertyRow& FDetailCategoryImpl::AddProperty( TSharedPtr<IPropertyHandle> PropertyHandle,  EPropertyLocation::Type Location){	FDetailLayoutCustomization NewCustomization;	TSharedPtr<FPropertyNode> PropertyNode = GetParentLayoutImpl().GetPropertyNode( PropertyHandle );	if( PropertyNode.IsValid() )	{		GetParentLayoutImpl().SetCustomProperty( PropertyNode );	}	NewCustomization.PropertyRow = MakeShareable( new FDetailPropertyRow( PropertyNode, AsShared() ) );	bool bForAdvanced = false;		if( Location == EPropertyLocation::Default )	{		// Get the default location of this property		bForAdvanced = IsAdvancedLayout( NewCustomization );	}	else if( Location == EPropertyLocation::Advanced )	{		// Force advanced		bForAdvanced = true;	}	AddCustomLayout( NewCustomization, bForAdvanced );	return *NewCustomization.PropertyRow;}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:31,


示例23: HandleBrowseButtonClicked

FReply SProjectLauncherDeployRepositorySettings::HandleBrowseButtonClicked( ){	IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();	if ( DesktopPlatform )	{		TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(AsShared());		void* ParentWindowHandle = (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid()) ? ParentWindow->GetNativeWindow()->GetOSWindowHandle() : nullptr;		FString FolderName;		const bool bFolderSelected = DesktopPlatform->OpenDirectoryDialog(			ParentWindowHandle,			LOCTEXT("RepositoryBrowseTitle", "Choose a repository location").ToString(),			RepositoryPathTextBox->GetText().ToString(),			FolderName			);		if ( bFolderSelected )		{			if ( !FolderName.EndsWith(TEXT("/")) )			{				FolderName += TEXT("/");			}			RepositoryPathTextBox->SetText(FText::FromString(FolderName));			ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();			if(SelectedProfile.IsValid())			{				SelectedProfile->SetPackageDirectory(FolderName);			}		}	}	return FReply::Handled();}
开发者ID:Codermay,项目名称:Unreal4,代码行数:35,


示例24: ToggleCheckedState

/** * See SWidget::OnMouseButtonDown. * * @param MyGeometry The Geometry of the widget receiving the event * @param MouseEvent Information about the input event * * @return Whether the event was handled along with possible requests for the system to take action. */FReply SCheckBox::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ){	if ( MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton )	{		bIsPressed = true;		if( ClickMethod == EButtonClickMethod::MouseDown )		{			ToggleCheckedState();			const ECheckBoxState State = IsCheckboxChecked.Get();			if(State == ECheckBoxState::Checked)			{				PlayCheckedSound();			}			else if(State == ECheckBoxState::Unchecked)			{				PlayUncheckedSound();			}			// Set focus to this button, but don't capture the mouse			return FReply::Handled().SetUserFocus(AsShared(), EFocusCause::Mouse);		}		else		{			// Capture the mouse, and also set focus to this button			return FReply::Handled().CaptureMouse(AsShared()).SetUserFocus(AsShared(), EFocusCause::Mouse);		}	}	else if ( MouseEvent.GetEffectingButton() == EKeys::RightMouseButton && OnGetMenuContent.IsBound() )	{		FWidgetPath WidgetPath = MouseEvent.GetEventPath() != nullptr ? *MouseEvent.GetEventPath() : FWidgetPath();		FSlateApplication::Get().PushMenu(			AsShared(),			WidgetPath,			OnGetMenuContent.Execute(),			MouseEvent.GetScreenSpacePosition(),			FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu )			);		return FReply::Handled();	}	else	{		return FReply::Unhandled();	}}
开发者ID:colwalder,项目名称:unrealengine,代码行数:55,


示例25: Dismiss

void FMenuInPopup::Dismiss(){	if (!bDismissing)	{		bDismissing = true;		OnMenuDismissed.Broadcast(AsShared());	}}
开发者ID:colwalder,项目名称:unrealengine,代码行数:8,


示例26:

bool FHttpRetrySystem::FRequest::ProcessRequest(){ 	TSharedRef<FRequest> RetryRequest = StaticCastSharedRef<FRequest>(AsShared());	HttpRequest->OnRequestProgress().BindSP(RetryRequest, &FHttpRetrySystem::FRequest::HttpOnRequestProgress);	return RetryManager.ProcessRequest(RetryRequest);}
开发者ID:dineshone,项目名称:UnrealGameEngine,代码行数:8,


示例27: AsShared

bool FAssetEditorToolkit::CloseWindow(){	if (OnRequestClose())	{		// Close this toolkit		FToolkitManager::Get().CloseToolkit( AsShared() );	}	return true;}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:9,



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


C++ AsString函数代码示例
C++ AsArray函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。