Skip to content

Commit

Permalink
Merge pull request #453 from UiPath/fix/STUD-72719_python_type_cache2
Browse files Browse the repository at this point in the history
Python: Type cache (24.12) [STUD-72719]
  • Loading branch information
viogroza authored Dec 10, 2024
2 parents d604f51 + b48126f commit 93fb81f
Show file tree
Hide file tree
Showing 16 changed files with 891 additions and 91 deletions.
6 changes: 6 additions & 0 deletions Activities/Activities.Python.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "UiPath.Shared", "Shared\UiPath.Shared\UiPath.Shared.shproj", "{2E040804-8ED9-4FB8-BB8A-4A38479E2A9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UiPath.Python.Activities.ViewModels", "Python\UiPath.Python.Activities.ViewModels\UiPath.Python.Activities.ViewModels.csproj", "{5EF1F67E-C7E0-4118-9F7F-E3FA5A1FDE1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -69,6 +71,10 @@ Global
{D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Release|Any CPU.Build.0 = Release|Any CPU
{5EF1F67E-C7E0-4118-9F7F-E3FA5A1FDE1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EF1F67E-C7E0-4118-9F7F-E3FA5A1FDE1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EF1F67E-C7E0-4118-9F7F-E3FA5A1FDE1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EF1F67E-C7E0-4118-9F7F-E3FA5A1FDE1D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public void Register()
builder.AddCustomAttributes(typeof(PythonScope), new DesignerAttribute(typeof(PythonScopeDesigner)));
builder.AddCustomAttributes(typeof(LoadScript), new DesignerAttribute(typeof(LoadScriptDesigner)));
builder.AddCustomAttributes(typeof(RunScript), new DesignerAttribute(typeof(RunScriptDesigner)));
builder.AddCustomAttributes(typeof(GetObject<>), new DesignerAttribute(typeof(GetObjectDesigner)));
builder.AddCustomAttributes(typeof(InvokeMethod), new DesignerAttribute(typeof(InvokeMethodDesigner)));

// Browsable false

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.GetObjectDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
xmlns:pa="clr-namespace:UiPath.Python.Activities.Properties;assembly=UiPath.Python.Activities"
xmlns:python="clr-namespace:UiPath.Python;assembly=UiPath.Python"
xmlns:s="clr-namespace:System;assembly=mscorlib">

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary Source="Themes/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>

<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<StackPanel Orientation="Vertical" Width="400" Margin="0 0 0 5">
<Label Padding="0 5 5 5" Content="{x:Static pa:Resources.PythonObjectNameDisplayName}" ToolTip="{x:Static pa:Resources.PythonObjectDescription}" />
<sapv:ExpressionTextBox OwnerActivity="{Binding Path=ModelItem}"
Expression="{Binding Path=ModelItem.PythonObject, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}"
HintText="{x:Static pa:Resources.PythonObjectDescription}" ExpressionType="{x:Type python:PythonObject}" MaxLines="1" VerticalScrollBarVisibility="Auto"
ToolTip="{x:Static pa:Resources.PythonObjectDescription}" />
</StackPanel>
</uip:ActivityDecoratorControl>
</sap:ActivityDesigner>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UiPath.Python.Activities.Design
{
// Interaction logic for GetObjectDesigner.xaml
public partial class GetObjectDesigner
{
public GetObjectDesigner()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.InvokeMethodDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
xmlns:pa="clr-namespace:UiPath.Python.Activities.Properties;assembly=UiPath.Python.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib">

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary Source="Themes/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>

<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<StackPanel Orientation="Vertical" Width="400" Margin="0 0 0 5">
<Label Padding="0 5 5 5" Content="{x:Static pa:Resources.NameDisplayName}" ToolTip="{x:Static pa:Resources.MethodNameDescription}" />
<sapv:ExpressionTextBox OwnerActivity="{Binding Path=ModelItem}"
Expression="{Binding Path=ModelItem.Name, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}"
HintText="{x:Static pa:Resources.MethodNameDescription}" ExpressionType="{x:Type s:String}" MaxLines="1" VerticalScrollBarVisibility="Auto"
ToolTip="{x:Static pa:Resources.MethodNameDescription}" />
</StackPanel>
</uip:ActivityDecoratorControl>
</sap:ActivityDesigner>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UiPath.Python.Activities.Design
{
// Interaction logic for InvokeMethodDesigner.xaml
public partial class InvokeMethodDesigner
{
public InvokeMethodDesigner()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.LoadScriptDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
>

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>


<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<DockPanel Width="300">
<uip:FilePathControl PropertyName="ScriptFile" Title="{x:Static p:Resources.PythonFileSelectTitle}" Filter="{Binding Path=PythonScriptFilter}"
ModelItem="{Binding Path=ModelItem}" HintText="{x:Static p:Resources.PythonScriptHint}"
Expression="{Binding Path=ModelItem.ScriptFile, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}" />
</DockPanel>
</uip:ActivityDecoratorControl>
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.LoadScriptDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters">

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary Source="Themes/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>


<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<DockPanel Width="300">
<uip:FilePathControl PropertyName="ScriptFile" Title="{x:Static p:Resources.PythonFileSelectTitle}" Filter="{Binding Path=PythonScriptFilter}"
ModelItem="{Binding Path=ModelItem}" HintText="{x:Static p:Resources.PythonScriptHint}"
Expression="{Binding Path=ModelItem.ScriptFile, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}" />
</DockPanel>
</uip:ActivityDecoratorControl>
</sap:ActivityDesigner>
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.PythonScopeDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
>

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>

<uip:ActivityDecoratorControl Style="{StaticResource ActivityDecoratorStyle}">
<StackPanel>
<sap:WorkflowItemPresenter x:Uid="sap:WorkflowItemPresenter_2" Name="BodyHandlerContainer" HintText="{x:Static p:Resources.DropActivityHere}"
Item="{Binding Path=ModelItem.Body.Handler, Mode=TwoWay}"/>
</StackPanel>
</uip:ActivityDecoratorControl>
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.PythonScopeDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
>

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary Source="Themes/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>

<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl Style="{StaticResource ActivityDecoratorStyle}">
<StackPanel>
<sap:WorkflowItemPresenter x:Uid="sap:WorkflowItemPresenter_2" Name="BodyHandlerContainer" HintText="{x:Static p:Resources.DropActivityHere}"
Item="{Binding Path=ModelItem.Body.Handler, Mode=TwoWay}"/>
</StackPanel>
</uip:ActivityDecoratorControl>
</sap:ActivityDesigner>
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.RunScriptDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters"
>

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>


<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<DockPanel Width="300">
<uip:FilePathControl PropertyName="ScriptFile" Title="{x:Static p:Resources.PythonFileSelectTitle}" Filter="{Binding Path=PythonScriptFilter}"
ModelItem="{Binding Path=ModelItem}" HintText="{x:Static p:Resources.PythonScriptHint}"
Expression="{Binding Path=ModelItem.ScriptFile, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}" />
</DockPanel>
</uip:ActivityDecoratorControl>
<sap:ActivityDesigner x:Class="UiPath.Python.Activities.Design.RunScriptDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:UiPath.Python.Activities.Design.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
xmlns:uip="clr-namespace:UiPath.Activities.Presentation"
xmlns:uipc="clr-namespace:UiPath.Activities.Presentation.Converters">

<sap:ActivityDesigner.Resources>
<ResourceDictionary>
<uipc:ActivityIconConverter x:Key="ActivityIconConverter" />
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary Source="Themes/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</sap:ActivityDesigner.Resources>

<sap:ActivityDesigner.Icon>
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}}" />
</sap:ActivityDesigner.Icon>

<uip:ActivityDecoratorControl HorizontalAlignment="Center" Style="{StaticResource ActivityDecoratorStyle}">
<DockPanel Width="300">
<uip:FilePathControl PropertyName="ScriptFile" Title="{x:Static p:Resources.PythonFileSelectTitle}" Filter="{Binding Path=PythonScriptFilter}"
ModelItem="{Binding Path=ModelItem}" HintText="{x:Static p:Resources.PythonScriptHint}"
Expression="{Binding Path=ModelItem.ScriptFile, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In, Mode=TwoWay}" />
</DockPanel>
</uip:ActivityDecoratorControl>
</sap:ActivityDesigner>
Loading

0 comments on commit 93fb81f

Please sign in to comment.