From: gu.martinm@gmail.com Date: Sat, 22 Feb 2014 13:22:57 +0000 (+0100) Subject: RemoteAgents Mono GTK Linux: move project to right path X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=04b851596d7fa3973b4d693b554611db6dfa3e85;p=CSharpForFun%2F.git RemoteAgents Mono GTK Linux: move project to right path --- diff --git a/Mono/RemoteAgents/GTKLinux.sln b/Mono/RemoteAgents/GTKLinux.sln new file mode 100644 index 0000000..4a9f35d --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux.sln @@ -0,0 +1,179 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GTKLinux", "GTKLinux\GTKLinux.csproj", "{F58086C1-1E2F-459C-B8BE-269A245C09A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Debug|x86.ActiveCfg = Debug|x86 + {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Debug|x86.Build.0 = Debug|x86 + {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Release|x86.ActiveCfg = Release|x86 + {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = GTKLinux\GTKLinux.csproj + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = None + $1.ResourceNamePolicy = FileFormatDefault + $0.StandardHeader = $2 + $2.Text = + $2.IncludeInNewFiles = True + $0.NameConventionPolicy = $3 + $3.Rules = $4 + $4.NamingRule = $5 + $5.Name = Namespaces + $5.AffectedEntity = Namespace + $5.VisibilityMask = VisibilityMask + $5.NamingStyle = PascalCase + $5.IncludeInstanceMembers = True + $5.IncludeStaticEntities = True + $4.NamingRule = $6 + $6.Name = Types + $6.AffectedEntity = Class, Struct, Enum, Delegate + $6.VisibilityMask = Public + $6.NamingStyle = PascalCase + $6.IncludeInstanceMembers = True + $6.IncludeStaticEntities = True + $4.NamingRule = $7 + $7.Name = Interfaces + $7.RequiredPrefixes = $8 + $8.String = I + $7.AffectedEntity = Interface + $7.VisibilityMask = Public + $7.NamingStyle = PascalCase + $7.IncludeInstanceMembers = True + $7.IncludeStaticEntities = True + $4.NamingRule = $9 + $9.Name = Attributes + $9.RequiredSuffixes = $10 + $10.String = Attribute + $9.AffectedEntity = CustomAttributes + $9.VisibilityMask = Public + $9.NamingStyle = PascalCase + $9.IncludeInstanceMembers = True + $9.IncludeStaticEntities = True + $4.NamingRule = $11 + $11.Name = Event Arguments + $11.RequiredSuffixes = $12 + $12.String = EventArgs + $11.AffectedEntity = CustomEventArgs + $11.VisibilityMask = Public + $11.NamingStyle = PascalCase + $11.IncludeInstanceMembers = True + $11.IncludeStaticEntities = True + $4.NamingRule = $13 + $13.Name = Exceptions + $13.RequiredSuffixes = $14 + $14.String = Exception + $13.AffectedEntity = CustomExceptions + $13.VisibilityMask = VisibilityMask + $13.NamingStyle = PascalCase + $13.IncludeInstanceMembers = True + $13.IncludeStaticEntities = True + $4.NamingRule = $15 + $15.Name = Methods + $15.AffectedEntity = Methods + $15.VisibilityMask = Protected, Public + $15.NamingStyle = PascalCase + $15.IncludeInstanceMembers = True + $15.IncludeStaticEntities = True + $4.NamingRule = $16 + $16.Name = Static Readonly Fields + $16.AffectedEntity = ReadonlyField + $16.VisibilityMask = Protected, Public + $16.NamingStyle = PascalCase + $16.IncludeInstanceMembers = False + $16.IncludeStaticEntities = True + $4.NamingRule = $17 + $17.Name = Fields + $17.AffectedEntity = Field + $17.VisibilityMask = Protected, Public + $17.NamingStyle = PascalCase + $17.IncludeInstanceMembers = True + $17.IncludeStaticEntities = True + $4.NamingRule = $18 + $18.Name = ReadOnly Fields + $18.AffectedEntity = ReadonlyField + $18.VisibilityMask = Protected, Public + $18.NamingStyle = PascalCase + $18.IncludeInstanceMembers = True + $18.IncludeStaticEntities = False + $4.NamingRule = $19 + $19.Name = Constant Fields + $19.AffectedEntity = ConstantField + $19.VisibilityMask = Protected, Public + $19.NamingStyle = PascalCase + $19.IncludeInstanceMembers = True + $19.IncludeStaticEntities = True + $4.NamingRule = $20 + $20.Name = Properties + $20.AffectedEntity = Property + $20.VisibilityMask = Protected, Public + $20.NamingStyle = PascalCase + $20.IncludeInstanceMembers = True + $20.IncludeStaticEntities = True + $4.NamingRule = $21 + $21.Name = Events + $21.AffectedEntity = Event + $21.VisibilityMask = Protected, Public + $21.NamingStyle = PascalCase + $21.IncludeInstanceMembers = True + $21.IncludeStaticEntities = True + $4.NamingRule = $22 + $22.Name = Enum Members + $22.AffectedEntity = EnumMember + $22.VisibilityMask = VisibilityMask + $22.NamingStyle = PascalCase + $22.IncludeInstanceMembers = True + $22.IncludeStaticEntities = True + $4.NamingRule = $23 + $23.Name = Parameters + $23.AffectedEntity = Parameter + $23.VisibilityMask = VisibilityMask + $23.NamingStyle = CamelCase + $23.IncludeInstanceMembers = True + $23.IncludeStaticEntities = True + $4.NamingRule = $24 + $24.Name = Type Parameters + $24.RequiredPrefixes = $25 + $25.String = T + $24.AffectedEntity = TypeParameter + $24.VisibilityMask = VisibilityMask + $24.NamingStyle = PascalCase + $24.IncludeInstanceMembers = True + $24.IncludeStaticEntities = True + $0.TextStylePolicy = $26 + $26.FileWidth = 120 + $26.TabsToSpaces = False + $26.EolMarker = Unix + $26.inheritsSet = VisualStudio + $26.inheritsScope = text/plain + $26.scope = text/plain + $0.TextStylePolicy = $27 + $27.FileWidth = 120 + $27.IndentWidth = 2 + $27.EolMarker = Unix + $27.inheritsSet = VisualStudio + $27.inheritsScope = text/plain + $27.scope = text/x-csharp + $0.CSharpFormattingPolicy = $28 + $28.IndentSwitchBody = True + $28.StatementBraceStyle = NextLineShifted2 + $28.BeforeMethodDeclarationParentheses = False + $28.BeforeMethodCallParentheses = False + $28.BeforeConstructorDeclarationParentheses = False + $28.BeforeIndexerDeclarationBracket = False + $28.BeforeDelegateDeclarationParentheses = False + $28.NewParentheses = False + $28.SpacesBeforeBrackets = False + $28.inheritsSet = Mono + $28.inheritsScope = text/x-csharp + $28.scope = text/x-csharp + description = @Little program to connect with remote applications\nthrough JSON API. + EndGlobalSection +EndGlobal diff --git a/Mono/RemoteAgents/GTKLinux.userprefs b/Mono/RemoteAgents/GTKLinux.userprefs new file mode 100644 index 0000000..885cc1c --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux.userprefs @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux.csproj b/Mono/RemoteAgents/GTKLinux/GTKLinux.csproj new file mode 100644 index 0000000..21f6fec --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/GTKLinux.csproj @@ -0,0 +1,85 @@ + + + + Debug + x86 + 12.0.0 + 2.0 + {F58086C1-1E2F-459C-B8BE-269A245C09A2} + WinExe + GTKLinux + GTKLinux + v4.5 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + x86 + + + full + true + bin\Release + prompt + 4 + false + x86 + + + + + False + + + False + + + False + + + False + + + False + + + False + + + + ..\..\..\..\..\..\..\..\usr\mymono\lib\mono\4.5\System.Net.Http.dll + + + monodevelop + + + + + gui.stetic + + + + + + + + + + Program.cs + + + + + + + + + + + \ No newline at end of file diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux.sln b/Mono/RemoteAgents/GTKLinux/GTKLinux.sln deleted file mode 100644 index 4a9f35d..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux.sln +++ /dev/null @@ -1,179 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GTKLinux", "GTKLinux\GTKLinux.csproj", "{F58086C1-1E2F-459C-B8BE-269A245C09A2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Debug|x86.ActiveCfg = Debug|x86 - {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Debug|x86.Build.0 = Debug|x86 - {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Release|x86.ActiveCfg = Release|x86 - {F58086C1-1E2F-459C-B8BE-269A245C09A2}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = GTKLinux\GTKLinux.csproj - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault - $0.StandardHeader = $2 - $2.Text = - $2.IncludeInNewFiles = True - $0.NameConventionPolicy = $3 - $3.Rules = $4 - $4.NamingRule = $5 - $5.Name = Namespaces - $5.AffectedEntity = Namespace - $5.VisibilityMask = VisibilityMask - $5.NamingStyle = PascalCase - $5.IncludeInstanceMembers = True - $5.IncludeStaticEntities = True - $4.NamingRule = $6 - $6.Name = Types - $6.AffectedEntity = Class, Struct, Enum, Delegate - $6.VisibilityMask = Public - $6.NamingStyle = PascalCase - $6.IncludeInstanceMembers = True - $6.IncludeStaticEntities = True - $4.NamingRule = $7 - $7.Name = Interfaces - $7.RequiredPrefixes = $8 - $8.String = I - $7.AffectedEntity = Interface - $7.VisibilityMask = Public - $7.NamingStyle = PascalCase - $7.IncludeInstanceMembers = True - $7.IncludeStaticEntities = True - $4.NamingRule = $9 - $9.Name = Attributes - $9.RequiredSuffixes = $10 - $10.String = Attribute - $9.AffectedEntity = CustomAttributes - $9.VisibilityMask = Public - $9.NamingStyle = PascalCase - $9.IncludeInstanceMembers = True - $9.IncludeStaticEntities = True - $4.NamingRule = $11 - $11.Name = Event Arguments - $11.RequiredSuffixes = $12 - $12.String = EventArgs - $11.AffectedEntity = CustomEventArgs - $11.VisibilityMask = Public - $11.NamingStyle = PascalCase - $11.IncludeInstanceMembers = True - $11.IncludeStaticEntities = True - $4.NamingRule = $13 - $13.Name = Exceptions - $13.RequiredSuffixes = $14 - $14.String = Exception - $13.AffectedEntity = CustomExceptions - $13.VisibilityMask = VisibilityMask - $13.NamingStyle = PascalCase - $13.IncludeInstanceMembers = True - $13.IncludeStaticEntities = True - $4.NamingRule = $15 - $15.Name = Methods - $15.AffectedEntity = Methods - $15.VisibilityMask = Protected, Public - $15.NamingStyle = PascalCase - $15.IncludeInstanceMembers = True - $15.IncludeStaticEntities = True - $4.NamingRule = $16 - $16.Name = Static Readonly Fields - $16.AffectedEntity = ReadonlyField - $16.VisibilityMask = Protected, Public - $16.NamingStyle = PascalCase - $16.IncludeInstanceMembers = False - $16.IncludeStaticEntities = True - $4.NamingRule = $17 - $17.Name = Fields - $17.AffectedEntity = Field - $17.VisibilityMask = Protected, Public - $17.NamingStyle = PascalCase - $17.IncludeInstanceMembers = True - $17.IncludeStaticEntities = True - $4.NamingRule = $18 - $18.Name = ReadOnly Fields - $18.AffectedEntity = ReadonlyField - $18.VisibilityMask = Protected, Public - $18.NamingStyle = PascalCase - $18.IncludeInstanceMembers = True - $18.IncludeStaticEntities = False - $4.NamingRule = $19 - $19.Name = Constant Fields - $19.AffectedEntity = ConstantField - $19.VisibilityMask = Protected, Public - $19.NamingStyle = PascalCase - $19.IncludeInstanceMembers = True - $19.IncludeStaticEntities = True - $4.NamingRule = $20 - $20.Name = Properties - $20.AffectedEntity = Property - $20.VisibilityMask = Protected, Public - $20.NamingStyle = PascalCase - $20.IncludeInstanceMembers = True - $20.IncludeStaticEntities = True - $4.NamingRule = $21 - $21.Name = Events - $21.AffectedEntity = Event - $21.VisibilityMask = Protected, Public - $21.NamingStyle = PascalCase - $21.IncludeInstanceMembers = True - $21.IncludeStaticEntities = True - $4.NamingRule = $22 - $22.Name = Enum Members - $22.AffectedEntity = EnumMember - $22.VisibilityMask = VisibilityMask - $22.NamingStyle = PascalCase - $22.IncludeInstanceMembers = True - $22.IncludeStaticEntities = True - $4.NamingRule = $23 - $23.Name = Parameters - $23.AffectedEntity = Parameter - $23.VisibilityMask = VisibilityMask - $23.NamingStyle = CamelCase - $23.IncludeInstanceMembers = True - $23.IncludeStaticEntities = True - $4.NamingRule = $24 - $24.Name = Type Parameters - $24.RequiredPrefixes = $25 - $25.String = T - $24.AffectedEntity = TypeParameter - $24.VisibilityMask = VisibilityMask - $24.NamingStyle = PascalCase - $24.IncludeInstanceMembers = True - $24.IncludeStaticEntities = True - $0.TextStylePolicy = $26 - $26.FileWidth = 120 - $26.TabsToSpaces = False - $26.EolMarker = Unix - $26.inheritsSet = VisualStudio - $26.inheritsScope = text/plain - $26.scope = text/plain - $0.TextStylePolicy = $27 - $27.FileWidth = 120 - $27.IndentWidth = 2 - $27.EolMarker = Unix - $27.inheritsSet = VisualStudio - $27.inheritsScope = text/plain - $27.scope = text/x-csharp - $0.CSharpFormattingPolicy = $28 - $28.IndentSwitchBody = True - $28.StatementBraceStyle = NextLineShifted2 - $28.BeforeMethodDeclarationParentheses = False - $28.BeforeMethodCallParentheses = False - $28.BeforeConstructorDeclarationParentheses = False - $28.BeforeIndexerDeclarationBracket = False - $28.BeforeDelegateDeclarationParentheses = False - $28.NewParentheses = False - $28.SpacesBeforeBrackets = False - $28.inheritsSet = Mono - $28.inheritsScope = text/x-csharp - $28.scope = text/x-csharp - description = @Little program to connect with remote applications\nthrough JSON API. - EndGlobalSection -EndGlobal diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux.userprefs b/Mono/RemoteAgents/GTKLinux/GTKLinux.userprefs deleted file mode 100644 index 2891302..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux.userprefs +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/GTKLinux.csproj b/Mono/RemoteAgents/GTKLinux/GTKLinux/GTKLinux.csproj deleted file mode 100644 index 21f6fec..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/GTKLinux.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - x86 - 12.0.0 - 2.0 - {F58086C1-1E2F-459C-B8BE-269A245C09A2} - WinExe - GTKLinux - GTKLinux - v4.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - x86 - - - full - true - bin\Release - prompt - 4 - false - x86 - - - - - False - - - False - - - False - - - False - - - False - - - False - - - - ..\..\..\..\..\..\..\..\usr\mymono\lib\mono\4.5\System.Net.Http.dll - - - monodevelop - - - - - gui.stetic - - - - - - - - - - Program.cs - - - - - - - - - - - \ No newline at end of file diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/MainWindow.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/MainWindow.cs deleted file mode 100644 index 22371ca..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/MainWindow.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Gtk; -using System.Net.Http; -using System.Threading.Tasks; -using Example.RemoteAgents.GTKLinux.View; - -namespace Example.RemoteAgents.GTKLinux -{ - public partial class MainWindow: Gtk.Window - { - ViewImpl view; - - public MainWindow () : base (Gtk.WindowType.Toplevel) - { - view = new ViewImpl(); - Build (); - this.RetrieveRemoteDateButton.Clicked += this.ButtonClicked; - this.ButtonGetDate.Clicked += this.ButtonGetDateClicked; - } - - protected void OnDeleteEvent (object sender, DeleteEventArgs a) - { - Application.Quit (); - a.RetVal = true; - } - - async private void ButtonClicked(object sender, EventArgs a) - { - using (HttpClient client = new HttpClient ()) { - Task resultGET = client.GetStringAsync ("http://gumartinm.name"); - this.RemoteDate.Buffer.Text = await resultGET; - } - } - - async private void ButtonGetDateClicked(object sender, EventArgs a) - { - this.RemoteDate.Buffer.Text = await view.getCurrentDate(); - } - } -} diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/Model/CallRemoteProcedure.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/Model/CallRemoteProcedure.cs deleted file mode 100644 index a8d633f..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/Model/CallRemoteProcedure.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Runtime.Remoting.Messaging; -using Newtonsoft.Json; -using System.Net.Http; -using System.Runtime.Remoting.Lifetime; -using System.Threading.Tasks; -using Gtk; -using System.Reflection; -using System.Net; -using System.Security.Cryptography.X509Certificates; - -namespace Example.RemoteAgents.GTKLinux.Model -{ - public class CallRemoteProcedure - { - - async public Task callRemoteService(string uri, string method) - { - POSTResult postResult; - POST postData = new POST(); - postData.id = "2114567586433855105"; - postData.jsonrpc = "2.0"; - postData.method = method; - - string data = JsonConvert.SerializeObject(postData); - HttpContent content = new StringContent(data, System.Text.Encoding.UTF8, "application/json-rpc"); - - HttpResponseMessage response = await this.issueCall(uri, content); - - //if (response.StatusCode == HttpStatusCode.OK) { - Task responseBytes = response.Content.ReadAsByteArrayAsync(); - string responseString = System.Text.Encoding.UTF8.GetString(responseBytes.Result); - postResult = JsonConvert.DeserializeObject>(responseString); - //} - - return postResult.result; - } - - - async private Task issueCall(string uri, HttpContent content) - { - using (HttpClient client = new HttpClient()) - { - return await client.PostAsync(uri, content); - } - } - - private class POST - { - public string id { get; set; } - public string jsonrpc { get; set; } - public string method { get; set; } - } - - - private class POSTResult - { - public string id { get; set; } - public string jsonrpc { get; set; } - public TResult result { get; set; } - } - } -} - diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/Program.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/Program.cs deleted file mode 100644 index 60b38fc..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Gtk; - -namespace Example.RemoteAgents.GTKLinux -{ - class MainClass - { - public static void Main (string[] args) - { - Application.Init (); - MainWindow win = new MainWindow (); - win.Show (); - Application.Run (); - } - } -} diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/Properties/AssemblyInfo.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/Properties/AssemblyInfo.cs deleted file mode 100644 index 7b2678f..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle("GTKLinux")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("gustavo")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion("1.0.*")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/View/View.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/View/View.cs deleted file mode 100644 index f35dc80..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/View/View.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Threading.Tasks; -using Example.RemoteAgents.GTKLinux.ViewModel; - - -namespace Example.RemoteAgents.GTKLinux.View -{ - public class ViewImpl - { - private static readonly ViewModelImpl vm = new ViewModelImpl(); - - async public Task getCurrentDate() - { - return await vm.getCurrentDate(); - } - } -} - diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/ViewModel/ViewModel.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/ViewModel/ViewModel.cs deleted file mode 100644 index e6b7f30..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/ViewModel/ViewModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Threading.Tasks; -using Example.RemoteAgents.GTKLinux.Model; - -namespace Example.RemoteAgents.GTKLinux.ViewModel -{ - public class ViewModelImpl - { - private static readonly string uri = "gumartinm.name"; - private static readonly CallRemoteProcedure remoteProcedure = new CallRemoteProcedure(); - - async public Task getCurrentDate() - { - return await remoteProcedure.callRemoteService(uri, "getCurrentDate"); - } - } -} - diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs deleted file mode 100644 index 12e792d..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs +++ /dev/null @@ -1,74 +0,0 @@ - -// This file has been generated by the GUI designer. Do not modify. -namespace Example.RemoteAgents.GTKLinux -{ - public partial class MainWindow - { - private global::Gtk.VBox vbox3; - private global::Gtk.TextView RemoteDate; - private global::Gtk.HBox hbox2; - private global::Gtk.Button ButtonGetDate; - private global::Gtk.Button RetrieveRemoteDateButton; - - protected virtual void Build () - { - global::Stetic.Gui.Initialize (this); - // Widget Example.RemoteAgents.GTKLinux.MainWindow - this.Name = "Example.RemoteAgents.GTKLinux.MainWindow"; - this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); - this.WindowPosition = ((global::Gtk.WindowPosition)(4)); - // Container child Example.RemoteAgents.GTKLinux.MainWindow.Gtk.Container+ContainerChild - this.vbox3 = new global::Gtk.VBox (); - this.vbox3.Name = "vbox3"; - this.vbox3.Spacing = 6; - // Container child vbox3.Gtk.Box+BoxChild - this.RemoteDate = new global::Gtk.TextView (); - this.RemoteDate.CanFocus = true; - this.RemoteDate.Name = "RemoteDate"; - this.RemoteDate.Editable = false; - this.RemoteDate.CursorVisible = false; - this.vbox3.Add (this.RemoteDate); - global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.RemoteDate])); - w1.Position = 0; - // Container child vbox3.Gtk.Box+BoxChild - this.hbox2 = new global::Gtk.HBox (); - this.hbox2.Name = "hbox2"; - this.hbox2.Spacing = 6; - // Container child hbox2.Gtk.Box+BoxChild - this.ButtonGetDate = new global::Gtk.Button (); - this.ButtonGetDate.CanFocus = true; - this.ButtonGetDate.Name = "ButtonGetDate"; - this.ButtonGetDate.UseUnderline = true; - this.ButtonGetDate.Label = global::Mono.Unix.Catalog.GetString ("GetRemoteDate"); - this.hbox2.Add (this.ButtonGetDate); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.ButtonGetDate])); - w2.Position = 0; - w2.Expand = false; - w2.Fill = false; - // Container child hbox2.Gtk.Box+BoxChild - this.RetrieveRemoteDateButton = new global::Gtk.Button (); - this.RetrieveRemoteDateButton.CanFocus = true; - this.RetrieveRemoteDateButton.Name = "RetrieveRemoteDateButton"; - this.RetrieveRemoteDateButton.UseUnderline = true; - this.RetrieveRemoteDateButton.Label = global::Mono.Unix.Catalog.GetString ("RemoteDate"); - this.hbox2.Add (this.RetrieveRemoteDateButton); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.RetrieveRemoteDateButton])); - w3.Position = 2; - w3.Expand = false; - w3.Fill = false; - this.vbox3.Add (this.hbox2); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox2])); - w4.Position = 2; - w4.Expand = false; - w4.Fill = false; - this.Add (this.vbox3); - if ((this.Child != null)) { - this.Child.ShowAll (); - } - this.DefaultWidth = 484; - this.DefaultHeight = 332; - this.Show (); - this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); - } - } -} diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/generated.cs b/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/generated.cs deleted file mode 100644 index 9ef3363..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/generated.cs +++ /dev/null @@ -1,29 +0,0 @@ - -// This file has been generated by the GUI designer. Do not modify. -namespace Stetic -{ - internal class Gui - { - private static bool initialized; - - internal static void Initialize (Gtk.Widget iconRenderer) - { - if ((Stetic.Gui.initialized == false)) { - Stetic.Gui.initialized = true; - } - } - } - - internal class ActionGroups - { - public static Gtk.ActionGroup GetActionGroup (System.Type type) - { - return Stetic.ActionGroups.GetActionGroup (type.FullName); - } - - public static Gtk.ActionGroup GetActionGroup (string name) - { - return null; - } - } -} diff --git a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/gui.stetic b/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/gui.stetic deleted file mode 100644 index 6fcea56..0000000 --- a/Mono/RemoteAgents/GTKLinux/GTKLinux/gtk-gui/gui.stetic +++ /dev/null @@ -1,83 +0,0 @@ - - - - .. - - - - - - - - MainWindow - CenterOnParent - - - - - 6 - - - - True - False - False - - - - 0 - False - - - - - - - - - 6 - - - - True - TextOnly - GetRemoteDate - True - - - 0 - True - False - False - - - - - - - - - True - TextOnly - RemoteDate - True - - - 2 - True - False - False - - - - - 2 - True - False - False - - - - - - \ No newline at end of file diff --git a/Mono/RemoteAgents/GTKLinux/MainWindow.cs b/Mono/RemoteAgents/GTKLinux/MainWindow.cs new file mode 100644 index 0000000..22371ca --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/MainWindow.cs @@ -0,0 +1,40 @@ +using System; +using Gtk; +using System.Net.Http; +using System.Threading.Tasks; +using Example.RemoteAgents.GTKLinux.View; + +namespace Example.RemoteAgents.GTKLinux +{ + public partial class MainWindow: Gtk.Window + { + ViewImpl view; + + public MainWindow () : base (Gtk.WindowType.Toplevel) + { + view = new ViewImpl(); + Build (); + this.RetrieveRemoteDateButton.Clicked += this.ButtonClicked; + this.ButtonGetDate.Clicked += this.ButtonGetDateClicked; + } + + protected void OnDeleteEvent (object sender, DeleteEventArgs a) + { + Application.Quit (); + a.RetVal = true; + } + + async private void ButtonClicked(object sender, EventArgs a) + { + using (HttpClient client = new HttpClient ()) { + Task resultGET = client.GetStringAsync ("http://gumartinm.name"); + this.RemoteDate.Buffer.Text = await resultGET; + } + } + + async private void ButtonGetDateClicked(object sender, EventArgs a) + { + this.RemoteDate.Buffer.Text = await view.getCurrentDate(); + } + } +} diff --git a/Mono/RemoteAgents/GTKLinux/Model/CallRemoteProcedure.cs b/Mono/RemoteAgents/GTKLinux/Model/CallRemoteProcedure.cs new file mode 100644 index 0000000..a8d633f --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/Model/CallRemoteProcedure.cs @@ -0,0 +1,64 @@ +using System; +using System.Runtime.Remoting.Messaging; +using Newtonsoft.Json; +using System.Net.Http; +using System.Runtime.Remoting.Lifetime; +using System.Threading.Tasks; +using Gtk; +using System.Reflection; +using System.Net; +using System.Security.Cryptography.X509Certificates; + +namespace Example.RemoteAgents.GTKLinux.Model +{ + public class CallRemoteProcedure + { + + async public Task callRemoteService(string uri, string method) + { + POSTResult postResult; + POST postData = new POST(); + postData.id = "2114567586433855105"; + postData.jsonrpc = "2.0"; + postData.method = method; + + string data = JsonConvert.SerializeObject(postData); + HttpContent content = new StringContent(data, System.Text.Encoding.UTF8, "application/json-rpc"); + + HttpResponseMessage response = await this.issueCall(uri, content); + + //if (response.StatusCode == HttpStatusCode.OK) { + Task responseBytes = response.Content.ReadAsByteArrayAsync(); + string responseString = System.Text.Encoding.UTF8.GetString(responseBytes.Result); + postResult = JsonConvert.DeserializeObject>(responseString); + //} + + return postResult.result; + } + + + async private Task issueCall(string uri, HttpContent content) + { + using (HttpClient client = new HttpClient()) + { + return await client.PostAsync(uri, content); + } + } + + private class POST + { + public string id { get; set; } + public string jsonrpc { get; set; } + public string method { get; set; } + } + + + private class POSTResult + { + public string id { get; set; } + public string jsonrpc { get; set; } + public TResult result { get; set; } + } + } +} + diff --git a/Mono/RemoteAgents/GTKLinux/Program.cs b/Mono/RemoteAgents/GTKLinux/Program.cs new file mode 100644 index 0000000..60b38fc --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/Program.cs @@ -0,0 +1,16 @@ +using System; +using Gtk; + +namespace Example.RemoteAgents.GTKLinux +{ + class MainClass + { + public static void Main (string[] args) + { + Application.Init (); + MainWindow win = new MainWindow (); + win.Show (); + Application.Run (); + } + } +} diff --git a/Mono/RemoteAgents/GTKLinux/Properties/AssemblyInfo.cs b/Mono/RemoteAgents/GTKLinux/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7b2678f --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/Properties/AssemblyInfo.cs @@ -0,0 +1,22 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. +[assembly: AssemblyTitle("GTKLinux")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("gustavo")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. +[assembly: AssemblyVersion("1.0.*")] +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/Mono/RemoteAgents/GTKLinux/View/View.cs b/Mono/RemoteAgents/GTKLinux/View/View.cs new file mode 100644 index 0000000..f35dc80 --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/View/View.cs @@ -0,0 +1,18 @@ +using System; +using System.Threading.Tasks; +using Example.RemoteAgents.GTKLinux.ViewModel; + + +namespace Example.RemoteAgents.GTKLinux.View +{ + public class ViewImpl + { + private static readonly ViewModelImpl vm = new ViewModelImpl(); + + async public Task getCurrentDate() + { + return await vm.getCurrentDate(); + } + } +} + diff --git a/Mono/RemoteAgents/GTKLinux/ViewModel/ViewModel.cs b/Mono/RemoteAgents/GTKLinux/ViewModel/ViewModel.cs new file mode 100644 index 0000000..e6b7f30 --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/ViewModel/ViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Threading.Tasks; +using Example.RemoteAgents.GTKLinux.Model; + +namespace Example.RemoteAgents.GTKLinux.ViewModel +{ + public class ViewModelImpl + { + private static readonly string uri = "gumartinm.name"; + private static readonly CallRemoteProcedure remoteProcedure = new CallRemoteProcedure(); + + async public Task getCurrentDate() + { + return await remoteProcedure.callRemoteService(uri, "getCurrentDate"); + } + } +} + diff --git a/Mono/RemoteAgents/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs b/Mono/RemoteAgents/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs new file mode 100644 index 0000000..12e792d --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/gtk-gui/Example.RemoteAgents.GTKLinux.MainWindow.cs @@ -0,0 +1,74 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Example.RemoteAgents.GTKLinux +{ + public partial class MainWindow + { + private global::Gtk.VBox vbox3; + private global::Gtk.TextView RemoteDate; + private global::Gtk.HBox hbox2; + private global::Gtk.Button ButtonGetDate; + private global::Gtk.Button RetrieveRemoteDateButton; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget Example.RemoteAgents.GTKLinux.MainWindow + this.Name = "Example.RemoteAgents.GTKLinux.MainWindow"; + this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); + this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Container child Example.RemoteAgents.GTKLinux.MainWindow.Gtk.Container+ContainerChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + // Container child vbox3.Gtk.Box+BoxChild + this.RemoteDate = new global::Gtk.TextView (); + this.RemoteDate.CanFocus = true; + this.RemoteDate.Name = "RemoteDate"; + this.RemoteDate.Editable = false; + this.RemoteDate.CursorVisible = false; + this.vbox3.Add (this.RemoteDate); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.RemoteDate])); + w1.Position = 0; + // Container child vbox3.Gtk.Box+BoxChild + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.ButtonGetDate = new global::Gtk.Button (); + this.ButtonGetDate.CanFocus = true; + this.ButtonGetDate.Name = "ButtonGetDate"; + this.ButtonGetDate.UseUnderline = true; + this.ButtonGetDate.Label = global::Mono.Unix.Catalog.GetString ("GetRemoteDate"); + this.hbox2.Add (this.ButtonGetDate); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.ButtonGetDate])); + w2.Position = 0; + w2.Expand = false; + w2.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.RetrieveRemoteDateButton = new global::Gtk.Button (); + this.RetrieveRemoteDateButton.CanFocus = true; + this.RetrieveRemoteDateButton.Name = "RetrieveRemoteDateButton"; + this.RetrieveRemoteDateButton.UseUnderline = true; + this.RetrieveRemoteDateButton.Label = global::Mono.Unix.Catalog.GetString ("RemoteDate"); + this.hbox2.Add (this.RetrieveRemoteDateButton); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.RetrieveRemoteDateButton])); + w3.Position = 2; + w3.Expand = false; + w3.Fill = false; + this.vbox3.Add (this.hbox2); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox2])); + w4.Position = 2; + w4.Expand = false; + w4.Fill = false; + this.Add (this.vbox3); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.DefaultWidth = 484; + this.DefaultHeight = 332; + this.Show (); + this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); + } + } +} diff --git a/Mono/RemoteAgents/GTKLinux/gtk-gui/generated.cs b/Mono/RemoteAgents/GTKLinux/gtk-gui/generated.cs new file mode 100644 index 0000000..9ef3363 --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/gtk-gui/generated.cs @@ -0,0 +1,29 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Stetic +{ + internal class Gui + { + private static bool initialized; + + internal static void Initialize (Gtk.Widget iconRenderer) + { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class ActionGroups + { + public static Gtk.ActionGroup GetActionGroup (System.Type type) + { + return Stetic.ActionGroups.GetActionGroup (type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup (string name) + { + return null; + } + } +} diff --git a/Mono/RemoteAgents/GTKLinux/gtk-gui/gui.stetic b/Mono/RemoteAgents/GTKLinux/gtk-gui/gui.stetic new file mode 100644 index 0000000..6fcea56 --- /dev/null +++ b/Mono/RemoteAgents/GTKLinux/gtk-gui/gui.stetic @@ -0,0 +1,83 @@ + + + + .. + + + + + + + + MainWindow + CenterOnParent + + + + + 6 + + + + True + False + False + + + + 0 + False + + + + + + + + + 6 + + + + True + TextOnly + GetRemoteDate + True + + + 0 + True + False + False + + + + + + + + + True + TextOnly + RemoteDate + True + + + 2 + True + False + False + + + + + 2 + True + False + False + + + + + + \ No newline at end of file