aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
blob: a3b02afd51f16d6fe385f0f7519dca1728a94b92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{CAEDAE94-11ED-473C-888A-268A6D38CD20}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Tango.CodeGeneration</RootNamespace>
    <AssemblyName>Tango.CodeGeneration</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\Build\Core\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\Build\Core\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup>
    <SignAssembly>false</SignAssembly>
  </PropertyGroup>
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="RazorEngine, Version=3.10.0.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
      <HintPath>..\packages\RazorEngine.3.10.0\lib\net45\RazorEngine.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\Versioning\GlobalVersionInfo.cs">
      <Link>GlobalVersionInfo.cs</Link>
    </Compile>
    <Compile Include="Class.cs" />
    <Compile Include="CodeFile.cs" />
    <Compile Include="CodeObject.cs" />
    <Compile Include="CustomResolver.cs" />
    <Compile Include="DpProperty.cs" />
    <Compile Include="EntityInheritedDTOCodeFile.cs" />
    <Compile Include="EntityDTOCodeFile.cs" />
    <Compile Include="EntityCodeFileJavaExtension.cs" />
    <Compile Include="EntityCodeFileJava.cs" />
    <Compile Include="EntityCodeFile.cs" />
    <Compile Include="EntityInheritedCodeFile.cs" />
    <Compile Include="EnumerationField.cs" />
    <Compile Include="ObservablesContextCodeFile.cs" />
    <Compile Include="ObservablesStaticCollectionsFile.cs" />
    <Compile Include="ProtoEnumFile.cs" />
    <Compile Include="ProtoMessageFile.cs" />
    <Compile Include="ProtoProperty.cs" />
    <Compile Include="TangoDAOJavaFile.cs" />
    <Compile Include="EnumerationFileJava.cs" />
    <Compile Include="EnumerationFile.cs" />
    <Compile Include="Helper.cs" />
    <Compile Include="ICodeObject.cs" />
    <Compile Include="Method.cs" />
    <Compile Include="CodeObjectModifier.cs" />
    <Compile Include="MethodModifier.cs" />
    <Compile Include="Namespace.cs" />
    <Compile Include="ObservablesAdapterFile.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Property.cs" />
    <Compile Include="TangoWebClientCodeFile.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\CodeFile.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Property.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\DpProperty.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Method.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Class.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="packages.config" />
    <EmbeddedResource Include="Templates\Namespace.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EnumerationFile.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesAdapterFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFileJava.cshtml" />
    <EmbeddedResource Include="Templates\EnumerationFileJava.cshtml" />
    <EmbeddedResource Include="Templates\TangoDAOJavaFile.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesContextCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\ProtoMessageFile.cshtml" />
    <EmbeddedResource Include="Templates\ProtoEnumFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFileJavaExtension.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesStaticCollectionsFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityInheritedCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\TangoWebClientCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityDTOCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityInheritedDTOCodeFile.cshtml" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
    </VisualStudio>
  </ProjectExtensions>
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
private MachinesEvent _selectedEvent; /// <summary> /// Gets or sets the selected event. /// </summary> public MachinesEvent SelectedEvent { get { return _selectedEvent; } set { _selectedEvent = value; RaisePropertyChangedAuto(); } } private ObservableCollection<MachinesEvent> _historyEvents; /// <summary> /// Gets or sets the history events. /// </summary> public ObservableCollection<MachinesEvent> HistoryEvents { get { return _historyEvents; } set { _historyEvents = value; RaisePropertyChangedAuto(); } } private MachinesEvent _selectedHistoryEvent; /// <summary> /// Gets or sets the selected event. /// </summary> public MachinesEvent SelectedHistoryEvent { get { return _selectedHistoryEvent; } set { _selectedHistoryEvent = value; RaisePropertyChangedAuto(); } } /// <summary> /// Initializes a new instance of the <see cref="MainViewVM"/> class. /// </summary> public MainViewVM() { CurrentEvents = new ObservableCollection<MachinesEvent>(); _notifications = new List<KeyValuePair<EventTypes, NotificationItem>>(); } /// <summary> /// Called when the application has been started /// </summary> public override void OnApplicationStarted() { EventLogger.EventReceived += EventLogger_EventReceived; EventLogger.EventResolved += EventLogger_EventResolved; } public override async void OnApplicationReady() { base.OnApplicationReady(); using (var db = ObservablesContext.CreateDefault()) { var last_week = DateTime.UtcNow.AddDays(-7); HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Take(100).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None || x.EventType.Code == (int)EventTypes.JOB_FAILED || x.EventType.Code == (int)EventTypes.JOB_STARTED || x.EventType.Code == (int)EventTypes.JOB_COMPLETED || x.EventType.Code == (int)EventTypes.JOB_ABORTED).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection(); } MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; } private void MachineOperator_StatusChanged(object sender, MachineStatuses status) { if (status == MachineStatuses.Disconnected) { foreach (var notification in _notifications.ToList()) { NotificationProvider.PopNotification(notification.Value); } _notifications.Clear(); InvokeUI(() => { CurrentEvents.Clear(); }); } } private void EventLogger_EventReceived(object sender, MachinesEvent ev) { InvokeUI(() => { if (ev.NotificationTime != EventTypeNotificationTimes.None) { CurrentEvents.Insert(0, ev); var notificationItem = new MessageNotificationItem(); notificationItem.CanClose = false; notificationItem.Message = ev.EventType.Title; notificationItem.ExpandedMessage = ev.EventType.Description; notificationItem.Pressed += async (_, __) => { SelectedEventsSource = EventsSource.CURRENT; SelectedEvent = ev; await NavigationManager.NavigateTo<EventsModule>(); }; switch (ev.Category) { case EventTypeCategories.Info: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Info; notificationItem.Priority = NotificationItem.NotificationPriority.Normal; break; case EventTypeCategories.Warning: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Warning; notificationItem.Priority = NotificationItem.NotificationPriority.High; break; case EventTypeCategories.Error: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Error; notificationItem.Priority = NotificationItem.NotificationPriority.VeryHigh; break; case EventTypeCategories.Critical: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Critical; notificationItem.Priority = NotificationItem.NotificationPriority.Critical; break; } NotificationProvider.PushNotification(notificationItem); _notifications.Add(new KeyValuePair<EventTypes, NotificationItem>(ev.EventType.Type, notificationItem)); } else if (ev.IsJobProgressEvent()) { HistoryEvents.Insert(0, ev); } }); } private void EventLogger_EventResolved(object sender, MachinesEvent ev) { InvokeUI(() => { if (ev.NotificationTime != EventTypeNotificationTimes.None) { CurrentEvents.Remove(ev); HistoryEvents.Insert(0, ev); foreach (var item in _notifications.ToList().Where(x => x.Key == ev.EventType.Type)) { _notifications.Remove(item); NotificationProvider.PopNotification(item.Value); } if (HistoryEvents.Count > 100) { HistoryEvents.Remove(HistoryEvents.Last()); } } }); } public override void OnNavigatedTo() { base.OnNavigatedTo(); NotificationProvider.NotificationsVisible = false; } public override void OnNavigatedFrom() { base.OnNavigatedFrom(); NotificationProvider.NotificationsVisible = true; } } }