提交 01ee3176 编写于 作者: T tanghai

使用.net4.6

上级 244cfd32
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>App.Editor</RootNamespace> <RootNamespace>App.Editor</RootNamespace>
<AssemblyName>Editor</AssemblyName> <AssemblyName>Editor</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.6.4.0" newVersion="6.6.4.0" /> <bindingRedirect oldVersion="0.0.0.0-6.6.4.0" newVersion="6.6.4.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup> </startup>
<appSettings> <appSettings>
<add key="NodePath" value="D:\Source\SLOL\Program\Unity\Assets\Resources\Config\" /> <add key="NodePath" value="D:\Source\SLOL\Program\Unity\Assets\Resources\Config\"/>
</appSettings> </appSettings>
</configuration> </configuration>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>App.Infrastructure</RootNamespace> <RootNamespace>App.Infrastructure</RootNamespace>
<AssemblyName>Infrastructure</AssemblyName> <AssemblyName>Infrastructure</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\CSharp\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\CSharp\</SolutionDir>
<RestorePackages>true</RestorePackages> <RestorePackages>true</RestorePackages>
......
...@@ -16,4 +16,4 @@ ...@@ -16,4 +16,4 @@
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
...@@ -83,7 +83,7 @@ namespace Modules.BehaviorTreeModule ...@@ -83,7 +83,7 @@ namespace Modules.BehaviorTreeModule
cfg.AppSettings.Settings["NodePath"].Value = path; cfg.AppSettings.Settings["NodePath"].Value = path;
cfg.Save(); cfg.Save();
ConfigurationManager.AppSettings["NodePath"] = path; ConfigurationManager.AppSettings["NodePath"] = path;
Application.Current.MainWindow.Title = string.Format("行为树编辑器 当前工作目录[{0}]", ConfigurationManager.AppSettings["NodePath"]); Application.Current.MainWindow.Title = $"行为树编辑器 当前工作目录[{ConfigurationManager.AppSettings["NodePath"]}]";
} }
private void MenuItem_Remove(object sender, RoutedEventArgs e) private void MenuItem_Remove(object sender, RoutedEventArgs e)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Modules.BehaviorTreeModule</RootNamespace> <RootNamespace>Modules.BehaviorTreeModule</RootNamespace>
<AssemblyName>BehaviorTreeModule</AssemblyName> <AssemblyName>BehaviorTreeModule</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Utf8Output>true</Utf8Output> <Utf8Output>true</Utf8Output>
<ExpressionBlendVersion>4.0.20621.0</ExpressionBlendVersion> <ExpressionBlendVersion>4.0.20621.0</ExpressionBlendVersion>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup> </startup>
</configuration> </configuration>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Profile</RootNamespace> <RootNamespace>Profile</RootNamespace>
<AssemblyName>Profile</AssemblyName> <AssemblyName>Profile</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Controller</RootNamespace> <RootNamespace>Controller</RootNamespace>
<AssemblyName>Controller</AssemblyName> <AssemblyName>Controller</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -18,7 +18,7 @@ namespace Model ...@@ -18,7 +18,7 @@ namespace Model
if (!Directory.Exists(path)) if (!Directory.Exists(path))
{ {
throw new Exception(string.Format("not found config path: {0}", path)); throw new Exception($"not found config path: {path}");
} }
foreach (string file in Directory.GetFiles(path)) foreach (string file in Directory.GetFiles(path))
......
...@@ -32,7 +32,7 @@ namespace Model ...@@ -32,7 +32,7 @@ namespace Model
} }
catch (Exception e) catch (Exception e)
{ {
Log.Trace(string.Format(e.ToString())); Log.Trace(e.ToString());
} }
} }
} }
......
...@@ -29,7 +29,7 @@ namespace Model ...@@ -29,7 +29,7 @@ namespace Model
Type classType = type; Type classType = type;
if (this.dictionary.ContainsKey(attribute.Type)) if (this.dictionary.ContainsKey(attribute.Type))
{ {
throw new GameException(string.Format("已经存在同类节点: {0}", attribute.Type)); throw new GameException($"已经存在同类节点: {attribute.Type}");
} }
this.dictionary.Add(attribute.Type, config => (Node)Activator.CreateInstance(classType, config)); this.dictionary.Add(attribute.Type, config => (Node)Activator.CreateInstance(classType, config));
} }
...@@ -51,7 +51,7 @@ namespace Model ...@@ -51,7 +51,7 @@ namespace Model
BehaviorTree behaviorTree; BehaviorTree behaviorTree;
if (!this.behaviorTrees.TryGetValue(id, out behaviorTree)) if (!this.behaviorTrees.TryGetValue(id, out behaviorTree))
{ {
throw new GameException(string.Format("无法找到行为树: {0}", id)); throw new GameException($"无法找到行为树: {id}");
} }
return behaviorTree; return behaviorTree;
} }
...@@ -59,10 +59,10 @@ namespace Model ...@@ -59,10 +59,10 @@ namespace Model
private Node CreateOneNode(NodeConfig proto) private Node CreateOneNode(NodeConfig proto)
{ {
NodeType nodeType = (NodeType)proto.Type; NodeType nodeType = proto.Type;
if (!this.dictionary.ContainsKey(nodeType)) if (!this.dictionary.ContainsKey(nodeType))
{ {
throw new KeyNotFoundException(string.Format("NodeType没有定义该节点: {0}", nodeType)); throw new KeyNotFoundException($"NodeType没有定义该节点: {nodeType}");
} }
return this.dictionary[nodeType](proto); return this.dictionary[nodeType](proto);
} }
......
...@@ -49,14 +49,12 @@ namespace Model ...@@ -49,14 +49,12 @@ namespace Model
{ {
if (this.buffs.Contains(buff)) if (this.buffs.Contains(buff))
{ {
throw new ArgumentException(string.Format("already exist same buff, Id: {0} ConfigId: {1}", throw new ArgumentException($"already exist same buff, Id: {buff.Id} ConfigId: {buff.Config.Id}");
buff.Id, buff.Config.Id));
} }
if (this.idBuff.ContainsKey(buff.Id)) if (this.idBuff.ContainsKey(buff.Id))
{ {
throw new ArgumentException(string.Format("already exist same buff, Id: {0} ConfigId: {1}", throw new ArgumentException($"already exist same buff, Id: {buff.Id} ConfigId: {buff.Config.Id}");
buff.Id, buff.Config.Id));
} }
Env env = new Env(); Env env = new Env();
......
...@@ -34,7 +34,7 @@ namespace Model ...@@ -34,7 +34,7 @@ namespace Model
ICategory iCategory = obj as ICategory; ICategory iCategory = obj as ICategory;
if (iCategory == null) if (iCategory == null)
{ {
throw new Exception(string.Format("class: {0} not inherit from ACategory", type.Name)); throw new Exception($"class: {type.Name} not inherit from ACategory");
} }
iCategory.BeginInit(); iCategory.BeginInit();
iCategory.EndInit(); iCategory.EndInit();
...@@ -49,7 +49,7 @@ namespace Model ...@@ -49,7 +49,7 @@ namespace Model
ICategory configCategory; ICategory configCategory;
if (!this.allConfig.TryGetValue(type, out configCategory)) if (!this.allConfig.TryGetValue(type, out configCategory))
{ {
throw new KeyNotFoundException(string.Format("ConfigComponent not found key: {0}", type.FullName)); throw new KeyNotFoundException($"ConfigComponent not found key: {type.FullName}");
} }
return ((ACategory<T>) configCategory)[id]; return ((ACategory<T>) configCategory)[id];
} }
...@@ -60,7 +60,7 @@ namespace Model ...@@ -60,7 +60,7 @@ namespace Model
ICategory configCategory; ICategory configCategory;
if (!this.allConfig.TryGetValue(type, out configCategory)) if (!this.allConfig.TryGetValue(type, out configCategory))
{ {
throw new KeyNotFoundException(string.Format("ConfigComponent not found key: {0}", type.FullName)); throw new KeyNotFoundException($"ConfigComponent not found key: {type.FullName}");
} }
return ((ACategory<T>) configCategory).GetAll(); return ((ACategory<T>) configCategory).GetAll();
} }
......
...@@ -36,8 +36,7 @@ namespace Model ...@@ -36,8 +36,7 @@ namespace Model
object obj = Activator.CreateInstance(t); object obj = Activator.CreateInstance(t);
if (obj == null) if (obj == null)
{ {
throw new Exception(string.Format("event not inherit IEvent or IEventAsync interface: {0}", throw new Exception($"event not inherit IEvent or IEventAsync interface: {obj.GetType().FullName}");
obj.GetType().FullName));
} }
if (!this.allEvents.ContainsKey(aEventAttribute.Type)) if (!this.allEvents.ContainsKey(aEventAttribute.Type))
{ {
...@@ -62,7 +61,7 @@ namespace Model ...@@ -62,7 +61,7 @@ namespace Model
AEvent iEvent = obj as AEvent; AEvent iEvent = obj as AEvent;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent", type)); throw new GameException($"event type: {type} is not IEvent");
} }
iEvent.Run(); iEvent.Run();
await iEvent.RunAsync(); await iEvent.RunAsync();
...@@ -89,7 +88,7 @@ namespace Model ...@@ -89,7 +88,7 @@ namespace Model
AEvent<A> iEvent = obj as AEvent<A>; AEvent<A> iEvent = obj as AEvent<A>;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent<{1}>", type, typeof(A).Name)); throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}>");
} }
iEvent.Run(a); iEvent.Run(a);
await iEvent.RunAsync(a); await iEvent.RunAsync(a);
...@@ -116,7 +115,7 @@ namespace Model ...@@ -116,7 +115,7 @@ namespace Model
AEvent<A, B> iEvent = obj as AEvent<A, B>; AEvent<A, B> iEvent = obj as AEvent<A, B>;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}>", type, typeof(A).Name, typeof(B).Name)); throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}>");
} }
iEvent.Run(a, b); iEvent.Run(a, b);
await iEvent.RunAsync(a, b); await iEvent.RunAsync(a, b);
...@@ -143,8 +142,7 @@ namespace Model ...@@ -143,8 +142,7 @@ namespace Model
AEvent<A, B, C> iEvent = obj as AEvent<A, B, C>; AEvent<A, B, C> iEvent = obj as AEvent<A, B, C>;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}>", type, throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}>");
typeof(A).Name, typeof(B).Name, typeof(C).Name));
} }
iEvent.Run(a, b, c); iEvent.Run(a, b, c);
await iEvent.RunAsync(a, b, c); await iEvent.RunAsync(a, b, c);
...@@ -171,8 +169,7 @@ namespace Model ...@@ -171,8 +169,7 @@ namespace Model
AEvent<A, B, C, D> iEvent = obj as AEvent<A, B, C, D>; AEvent<A, B, C, D> iEvent = obj as AEvent<A, B, C, D>;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}, {4}>", type, throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}>");
typeof(A).Name, typeof(B).Name, typeof(C).Name, typeof(D).Name));
} }
iEvent.Run(a, b, c, d); iEvent.Run(a, b, c, d);
await iEvent.RunAsync(a, b, c, d); await iEvent.RunAsync(a, b, c, d);
...@@ -199,8 +196,8 @@ namespace Model ...@@ -199,8 +196,8 @@ namespace Model
AEvent<A, B, C, D, E> iEvent = obj as AEvent<A, B, C, D, E>; AEvent<A, B, C, D, E> iEvent = obj as AEvent<A, B, C, D, E>;
if (iEvent == null) if (iEvent == null)
{ {
throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}, {4}, {5}>", type, throw new GameException(
typeof(A).Name, typeof(B).Name, typeof(C).Name, typeof(D).Name, typeof(E).Name)); $"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
} }
iEvent.Run(a, b, c, d, e); iEvent.Run(a, b, c, d, e);
await iEvent.RunAsync(a, b, c, d, e); await iEvent.RunAsync(a, b, c, d, e);
......
...@@ -32,7 +32,7 @@ namespace Model ...@@ -32,7 +32,7 @@ namespace Model
var iFactory = obj as IFactory<T>; var iFactory = obj as IFactory<T>;
if (iFactory == null) if (iFactory == null)
{ {
throw new Exception(string.Format("class: {0} not inherit from IFactory", type.Name)); throw new Exception($"class: {type.Name} not inherit from IFactory");
} }
this.allConfig[attribute.Type] = iFactory; this.allConfig[attribute.Type] = iFactory;
......
...@@ -37,14 +37,9 @@ namespace Model ...@@ -37,14 +37,9 @@ namespace Model
object obj = Activator.CreateInstance(t); object obj = Activator.CreateInstance(t);
IRegister iRegister = obj as IRegister; IRegister iRegister = obj as IRegister;
if (iRegister != null) iRegister?.Register();
{
iRegister.Register();
}
throw new Exception( throw new Exception($"message handler not inherit IRegister interface: {obj.GetType().FullName}");
string.Format("message handler not inherit IRegister interface: {0}",
obj.GetType().FullName));
} }
} }
...@@ -72,7 +67,7 @@ namespace Model ...@@ -72,7 +67,7 @@ namespace Model
{ {
return await funcAsync(messageBytes); return await funcAsync(messageBytes);
} }
throw new GameException(string.Format("not found opcode handler: {0}", opcode)); throw new GameException($"not found opcode handler: {opcode}");
} }
} }
} }
\ No newline at end of file
...@@ -179,8 +179,7 @@ namespace Model ...@@ -179,8 +179,7 @@ namespace Model
switch (status) switch (status)
{ {
case RpcResponseStatus.Timeout: case RpcResponseStatus.Timeout:
tcs.SetException(new Exception( tcs.SetException(new Exception($"rpc timeout {opcode} {MongoHelper.ToJson(request)}"));
string.Format("rpc timeout {0} {1}", opcode, MongoHelper.ToJson(request))));
return; return;
case RpcResponseStatus.Exception: case RpcResponseStatus.Exception:
BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All)); BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Model</RootNamespace> <RootNamespace>Model</RootNamespace>
<AssemblyName>Model</AssemblyName> <AssemblyName>Model</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -34,9 +34,7 @@ namespace Common.Base ...@@ -34,9 +34,7 @@ namespace Common.Base
if (this.componentDict.ContainsKey(component.GetComponentType())) if (this.componentDict.ContainsKey(component.GetComponentType()))
{ {
throw new Exception( throw new Exception($"AddComponent, component already exist, id: {this.Id}, component: {typeof (K).Name}");
string.Format("AddComponent, component already exist, id: {0}, component: {1}", this.Id,
typeof (K).Name));
} }
if (this.components == null) if (this.components == null)
...@@ -53,9 +51,7 @@ namespace Common.Base ...@@ -53,9 +51,7 @@ namespace Common.Base
{ {
if (this.componentDict.ContainsKey(component.GetComponentType())) if (this.componentDict.ContainsKey(component.GetComponentType()))
{ {
throw new Exception( throw new Exception($"AddComponent, component already exist, id: {this.Id}, component: {component.GetComponentType().Name}");
string.Format("AddComponent, component already exist, id: {0}, component: {1}", this.Id,
component.GetComponentType().Name));
} }
if (this.components == null) if (this.components == null)
...@@ -71,9 +67,7 @@ namespace Common.Base ...@@ -71,9 +67,7 @@ namespace Common.Base
Component<T> component; Component<T> component;
if (!this.componentDict.TryGetValue(typeof (K), out component)) if (!this.componentDict.TryGetValue(typeof (K), out component))
{ {
throw new Exception( throw new Exception($"RemoveComponent, component not exist, id: {this.Id}, component: {typeof (K).Name}");
string.Format("RemoveComponent, component not exist, id: {0}, component: {1}", this.Id,
typeof (K).Name));
} }
this.components.Remove(component); this.components.Remove(component);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace> <RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -10,7 +10,7 @@ namespace Common.Helper ...@@ -10,7 +10,7 @@ namespace Common.Helper
{ {
if (!File.Exists(path)) if (!File.Exists(path))
{ {
throw new Exception(string.Format("not found path, path: {0}", path)); throw new Exception($"not found path, path: {path}");
} }
byte[] buffer = File.ReadAllBytes(path); byte[] buffer = File.ReadAllBytes(path);
Assembly assembly = Assembly.Load(buffer); Assembly assembly = Assembly.Load(buffer);
......
...@@ -23,8 +23,7 @@ namespace Common.Helper ...@@ -23,8 +23,7 @@ namespace Common.Helper
{ {
if (hexString.Length % 2 != 0) if (hexString.Length % 2 != 0)
{ {
throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, throw new ArgumentException($"The binary key cannot have an odd number of digits: {hexString}");
"The binary key cannot have an odd number of digits: {0}", hexString));
} }
var hexAsBytes = new byte[hexString.Length / 2]; var hexAsBytes = new byte[hexString.Length / 2];
......
...@@ -68,8 +68,7 @@ namespace TNet ...@@ -68,8 +68,7 @@ namespace TNet
{ {
if (this.Count < buffer.Length || buffer.Length == 0) if (this.Count < buffer.Length || buffer.Length == 0)
{ {
throw new Exception(string.Format("bufferList size < n, bufferList: {0} buffer length: {1}", throw new Exception($"bufferList size < n, bufferList: {this.Count} buffer length: {buffer.Length}");
this.Count, buffer.Length));
} }
int alreadyCopyCount = 0; int alreadyCopyCount = 0;
while (alreadyCopyCount < buffer.Length) while (alreadyCopyCount < buffer.Length)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TNet</RootNamespace> <RootNamespace>TNet</RootNamespace>
<AssemblyName>TNet</AssemblyName> <AssemblyName>TNet</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -86,7 +86,7 @@ namespace TNet ...@@ -86,7 +86,7 @@ namespace TNet
{ {
if (this.acceptor == null) if (this.acceptor == null)
{ {
throw new Exception(string.Format("service construct must use host and port param")); throw new Exception("service construct must use host and port param");
} }
TSocket socket = new TSocket(this.poller); TSocket socket = new TSocket(this.poller);
await this.acceptor.AcceptAsync(socket); await this.acceptor.AcceptAsync(socket);
......
...@@ -126,7 +126,7 @@ namespace TNet ...@@ -126,7 +126,7 @@ namespace TNet
e.UserToken = null; e.UserToken = null;
if (e.SocketError != SocketError.Success) if (e.SocketError != SocketError.Success)
{ {
tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError))); tcs.SetException(new Exception($"socket error: {e.SocketError}"));
return; return;
} }
tcs.SetResult(true); tcs.SetResult(true);
...@@ -150,7 +150,7 @@ namespace TNet ...@@ -150,7 +150,7 @@ namespace TNet
e.UserToken = null; e.UserToken = null;
if (e.SocketError != SocketError.Success) if (e.SocketError != SocketError.Success)
{ {
tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError))); tcs.SetException(new Exception($"socket error: {e.SocketError}"));
return; return;
} }
tcs.SetResult(true); tcs.SetResult(true);
...@@ -174,7 +174,7 @@ namespace TNet ...@@ -174,7 +174,7 @@ namespace TNet
e.UserToken = null; e.UserToken = null;
if (e.SocketError != SocketError.Success) if (e.SocketError != SocketError.Success)
{ {
tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError))); tcs.SetException(new Exception($"socket error: {e.SocketError}"));
return; return;
} }
tcs.SetResult(e.BytesTransferred); tcs.SetResult(e.BytesTransferred);
...@@ -198,7 +198,7 @@ namespace TNet ...@@ -198,7 +198,7 @@ namespace TNet
e.UserToken = null; e.UserToken = null;
if (e.SocketError != SocketError.Success) if (e.SocketError != SocketError.Success)
{ {
tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError))); tcs.SetException(new Exception($"socket error: {e.SocketError}"));
return; return;
} }
tcs.SetResult(e.BytesTransferred); tcs.SetResult(e.BytesTransferred);
...@@ -221,7 +221,7 @@ namespace TNet ...@@ -221,7 +221,7 @@ namespace TNet
e.UserToken = null; e.UserToken = null;
if (e.SocketError != SocketError.Success) if (e.SocketError != SocketError.Success)
{ {
tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError))); tcs.SetException(new Exception($"socket error: {e.SocketError}"));
return; return;
} }
tcs.SetResult(true); tcs.SetResult(true);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
int ret = NativeMethods.ENetInitialize(); int ret = NativeMethods.ENetInitialize();
if (ret < 0) if (ret < 0)
{ {
throw new UException(string.Format("Initialization failed, ret: {0}", ret)); throw new UException($"Initialization failed, ret: {ret}");
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UNet</RootNamespace> <RootNamespace>UNet</RootNamespace>
<AssemblyName>UNet</AssemblyName> <AssemblyName>UNet</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ModelTest</RootNamespace> <RootNamespace>ModelTest</RootNamespace>
<AssemblyName>ModelTest</AssemblyName> <AssemblyName>ModelTest</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TNetTest</RootNamespace> <RootNamespace>TNetTest</RootNamespace>
<AssemblyName>TNetTest</AssemblyName> <AssemblyName>TNetTest</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UNetTest</RootNamespace> <RootNamespace>UNetTest</RootNamespace>
<AssemblyName>UNetTest</AssemblyName> <AssemblyName>UNetTest</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nuget</RootNamespace> <RootNamespace>Nuget</RootNamespace>
<AssemblyName>Nuget</AssemblyName> <AssemblyName>Nuget</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages> <RestorePackages>true</RestorePackages>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" /> <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册