Hi Michael,
You can click the Close button on that window, from there you’ll have the option to deactivate your license and re-activate it with a new license key.
HTH,
Alaa
Paul meant that paypal and stripe already provide easy to use C# rest apis ready to plug in a wisej app and fully documented and maintained. There is nothing for us to rewrite.
Hi Vincent
Please, try the attached mixin theme
On it there is this change
"styles": {
“css”: “{ \”transition\”: \”background-color 1s linear\” }”
},
HTH
regards
Hi Neil
This kind of question sadly is outside of the scope of help that we provide in the forum.
This info can help you to go in the right direction
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0
Also we can provide proffesional services for specific advanced request, in 4h support packages
Here the link for contact us
Thanks and regards
It’s a lot easier than the code you attached. There are two ways to use custom editors:
Light way: column1.Editor = new TextBox()
This is all you need. TextBox can be MyTextBox() or whatever control you like. When a cell in column1 enters edit mode the single instance (for that column) of the edit control is moved to that cell, initialized with the cell formatted value and then the Text property of the editor is parsed and stored in the cell.
More involved way: Custom column, custom cell, and custom editor implementing IDataGridViewEditingControl. Of course there are also ways in between where you can change a cell type in a standard column, or change only a single cell, etc.
// custom column using a custom cell
public class RICStandardColumn : DataGridViewColumn {
public RICStandardColumn() : base(new RICStandardCell()) {
}
}
// custom cell using a custom editor
public class RICStandardCell : DataGridViewCell {
public override Type EditType { get { return typeof(RICStandardEditingControl); } }
// optional override
public override void InitializeEditingControl(Control editor, DataGridViewCellStyle style) {
// initialize the editing control here.
base.InitializeEditingControl(editor, style);
}
}
// custom editor implementing IDataGridViewEditingControl
// if you extend an existing class like DataGridViewTextBoxEditingControl just call the base for the initialization.
public class RICStandardEditingControl : TextBox, IDataGridViewEditingControl {
public DataGridView DataGridView { get; set; }
public void ApplyCellStyleToEditingControl(DataGridViewCellStyle style) {
}
public string GetEditingControlFormattedValue() {
return this.Text;
}
public void PrepareEditingControlForEdit(bool selectAll) {
}
protected override void OnTextChanged(EventArgs e) {
base.OnTextChanged(e);
// this is necessary to inform the grid that something has been edited or
// the cell is never dirty.
// ONLY when implementing IDataGridViewEditingControl, otherwise Wisej
// will automatically use TextChanged for light implementation simply assigning the Editor property
// of a column. Cannot mix the two.
this.DataGridView?.NotifyCurrentCellDirty(true);
}
}
Hi Ruben
Under the hood, Wisej.Net use Net6 or DotNet Framework (4.8) , with c# or vb.net
Out there there a lot of information of how integrate a traditonial aspnet solution with others platforme providers that you can adapt it to your needs.
Also you can evaluate our consulting services for any specific needs
Regards
using System.Drawing.Drawing2D;
//set max width and height we are willing to accept e.g HD Image
double maxWidth = 1920;
double maxHeight = 1080;double srcWidth = src_image.Width;
double srcHeight = src_image.Height;double widthRatio = maxWidth / srcWidth;
double heightRatio = maxHeight / srcHeight;double ratio = Math.Min(widthRatio, heightRatio);
//set new dimensions with aspect ratio preserved
int newWidth = (int)(srcWidth * ratio);
int newHeight = (int)(srcHeight * ratio);Size size = new Size(newWidth, newHeight);
Image out_image = (Image)(new Bitmap(src_image, size));
Hi Paul, I have attached a sample demonstrating what I’m looking for in a theme. The sample is slow but hopefully it’s enough to show what I mean.
Thanks!
Thank you for your answer. I created a small sample and it worked as I expected it to work. This makes me think I’ve done something wrong in my main project’s code. I have a static SessionManager object that I’ve created, and I think that may be leading to the problem. I will do further research now. Thanks again.
Hi Lloyd
Please, could you send us a small runnable sample that reproduce the issue?
by the way, Session are isolated, there is no way to cross data in Application.Session
Regards.
Hi Vencent
Could you please, put an image with what you have in mind ?
thanks
Hi Ruben,
while Wisej already compresses all communication between client and server (http and websocket) we don´t offer any specialized extension for image compression.
However there are a gazillion tools for VB.NET and C# out there that you can use with Wisej.NET like you did in WinForms before.
Some are commercial, others are free.
Best regards
Frank
Hello Luca,
many thanks for your help. Now it works. You rescued me.
Hi Ruben,
you can use our Wisej AceEditor extension:
https://github.com/iceteagroup/wisej-extensions/tree/3.0/Wisej.Web.Ext.AceEditor
It includes line numbers and a lot more.
Best regards
Frank
OAuth2 authentication works by navigating to the authentication server (authentication url) passing a redirect url (which is your callback basically). The authentication server authenticates and navigates back your web application’s redirect url passing back a code, then the application makes one more requests using the code and receives a token.
SPA apps may do this in a popup window, but it requires the authentication flow to be executed in javascript. Wisej supports both ways. They are both a bit confusing and the samples from microsoft (onedrive) and google are fragmented and not always working.
If you implemented the Web approach (not SPA) you have to handle the redirection with the code. I have attached a sample generics GoogleApiHelper class that works for most Google services, usage:
var service = await GoogleApiHelper.GetServiceAsync<DriveService>(UserId, "Application Name", "http://localhost:64191/"); var listRequest = service.Files.List(); listRequest.PageSize = 100; listRequest.Fields = "nextPageToken, files(id, name)"; // List files. var files = listRequest.Execute().Files;
Run in an async method, like
private async void button1_Click(object sender, EventArgs e)
It expects a file “client_secrets.json” which is the authorization credentials downloaded from Google developer console. I followed Google web authorization examples and code in github.
You will have to adapt the code to your needs. The solution key is in the Application_ApplicationRefresh handler and the async task callback. The sample also shows you how to make your authentication method async.
HTH
Hello Luca,
many thanks for your fast answer.
I am so happy about wisej framework, because it is really the best tool to convert my windows-application to a cloud-app.
And it works so good, that it is not really necessary to be a ASP-NET developer.
But now this is my problem.
In the attachment you can find a sample to connect google drive by different ways.
It authenficates to google, a google window lets select the private account and gives the privileges to read the data in the private drive-account and if this all was successfull the sample shows the filenames of the root-path in drive.
Desktop-connection is working and is no problem,
but after publishing my wisej web application to the webserver) google needs to authenficate by a different way with postback and redirect-uri.
And this is something i didnt need (thanks wisej) until now.
It would be great if you can support me with this, because i spend already a lot of time.
Many thanks in advance
Rupert
Hi Marcelo,
Sorry for the delay, we are in the process of solving this case.
Thanks,
Kevin (ITG)
Works the same as it would work with an aspnet application. If you have a downloadable and runnable sample that shows the issue we can try to help. Attach it as a zip. It has to be a compilable visual studio solution.
Hi Levie,
first i will explain you what i am doing and what intention i have:
Using wisej i developed an accounting system which is used by a lot of users.
Now users should be able to digitalize their receipts.
I thought the simpliest way is, that for digtalizing of receipts users should use their private smartphones and then using the built in function ‘Scanning’ in Google Drive and store the receipts as pfd-files in their own google drive.
So far so good.
But now my central web-app has to let each user access their own google drive and they should be able to store a link to each pdf-file.
Can it be possible that no other developer needed something like this before?
I really searched a lot for some samples in the internet and found nothing.
In console.cloud.google.com you can export 2 types of json files:
One for access via Desktop-Application and
one for access via Web-Server which uses a redirect-url.
Access with the json file for Desktop-Apps is no problem and i am able to access Google Drive on my developer-PC.
But the same app does not work when i publish it to the webserver.
So i read in Google documentation that i have to use the json for Webservers and to change some Google-Api functions to
Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp and to do a request.
But i dont know how to do it in wisej?
In my added sample code you can find this functions (unconverted as they are) with “System.Web.HttpContext.Current” namespace (how they cannot work)
Please can you help me how to do this?
Many thanks in advance.
Rupert
Because the upload of my samplecode.vb was forbidden, i insert it here:
Public Class GDriveClass
Public Service As DriveService = Nothing
Public BasePath As String = “”
Public OAuth_File_Web As String = “client-secrets-web.json”
Public ApplicationName As String = “AppName”
Public UserId As String = “UserId”
Public Scopes As String() = {DriveService.Scope.Drive}
Private Function Authenticate() As IConfigurableHttpClientInitializer
Dim clientSecrets As ClientSecrets
Dim usercredential As UserCredential
Dim googlecredential As GoogleCredential
Dim oauthfile As FileStream
Dim oauthFilePath As String
Dim token As TokenResponse
Dim flow As GoogleAuthorizationCodeFlow
Dim flowinit As Object
Try
‘Path for json-Files
If BasePath = “” Then
ErrL.Add(“TokenFileName for Json-File is not set”)
Return Nothing
End If
‘ full path and filename of json credential file for web-authorization for google drive
oauthFilePath = IIf(OAuth_File_Web <> “”, Path.Combine(BasePath, OAuth_File_Web), “”)
If oauthFilePath <> “” Then
If System.IO.File.Exists(oauthFilePath) Then
Debug.Print(“Loading Web OAuth2 credentials from ” + oauthFilePath)
oauthfile = System.IO.File.Open(oauthFilePath, FileMode.Open, FileAccess.Read)
flowinit = New GoogleAuthorizationCodeFlow.Initializer() With {
.DataStore = New FileDataStore(BasePath),
.ClientSecretsStream = oauthfile,
.Scopes = Scopes
}
flow = New GoogleAuthorizationCodeFlow(flowinit)
‘until here it works
‘but the next statements i use System.Web.HttpContext.Current which cannot work in my wisej-serverapp
‘but i dont know how do it
Dim Uri As Object = System.Web.HttpContext.Current.Request.Url.ToString()
Dim code As Object = System.Web.HttpContext.Current.Request(“code”)
If code IsNot Nothing Then
token = flow.ExchangeCodeForTokenAsync(UserId, code, Uri.substring(0, Uri.indexof(“?”)), CancellationToken.None).Result
Dim oauthState As Object = Web.AuthWebUtility.ExtracRedirectFromState(flow.DataStore, UserId, System.Web.HttpContext.Current.Request(“State”)).Result
System.Web.HttpContext.Current.Response.Redirect(oauthState)
Else
Dim result As Object = New Web.AuthorizationCodeWebApp(flow, uri, uri).AuthorizeAsync(UserId, CancellationToken.None).Result
If result.RedirectUri IsNot Nothing Then
System.Web.HttpContext.Current.Response.Redirect(result.RedirectUri)
Else
Return result.Credential
End If
End If
End If
End If
Debug.Print(“Could not find authentication credentials”)
Return Nothing
Catch ex As Exception
ErrMgr.Handler(ex)
Finally
CloseObject(oauthfile)
CloseObject(usercredential)
CloseObject(googlecredential)
CloseObject(flowinit)
CloseObject(flow)
End Try
End Function
End Class
Hi Tung,
It appears that you’re using an old version of the Bootstrap-4 theme.
You can get the latest themes from Wisej Themes | Github, after cloning the repository please replace the existing themes in Documents\Wisej\Themes with the newer ones.
HTH,
Alaa
