Google Calendar v3 api Adding ExtendedProperties - google-calendar-api

Using the .net api I am adding a new event to Google and it is working fine until I add ExtendedProperties.
I have tried this and I get an error "Object not set to an instance of an object" because ExtendedProperties is nothing.
myevent.ExtendedProperties.Shared.Add("MyKey", "MyValue")
So I tried this and got the same error because Shared is nothing.
Dim ep As New Data.Event.ExtendedPropertiesData
ep.Shared.Add("MyKey", "MyValue")
Seems that Shared is "Nothing" and nothing I do adds a new Shared. How do I add a new Shared ExtendedProperties if the Add method doesn't work?
I see plenty of samples on how to read ExtendedProperties and that seems to work fine. I also see plenty of samples on how to add Events. Does anyone know how to add an Event with ExtendedProperties?

I had the same problem and found the solution:
Dim EP As New Data.Event.ExtendedPropertiesData()
EP.Shared = New System.Collections.Generic.Dictionary(Of String, String)
EP.Shared.Add("MyKey", "MyValue")
myevent.ExtendedProperties = EP
Hope, it helps

Inorder to set Extended Properties, you will have to use
myevent.ExtendedProperties.setShared(java.util.Map<java.lang.String,java.lang.String> shared);
then use
myevent.ExtendedProperties.set("MyKey", "MyValue");
Here is the link for the documentation.

Related

VS 2017 / ASP.net - Global functions not being recognized

I made the jump from VS 2010 (VB) all the way to VS 2017, and that may have been a mistake. I've already been slowed down with bugs, which I have reported. My latest concern is about accessing a global functions class that I have never had a problem with in VS 2010. I have reported it and it is in triage, but I wanted to make sure that something hasn't changed in the versions since 2010, hoping someone here can tell me.
Essentially what happens is that the global class, no matter how it is configured, is not recognized by any other class. Including a reference in a form class causes the IDE to tag it as an error. For example, the code in the GlobalFunctions.vb document:
Public Class GlobalFunctions
Public Function DecodeBase64(strEncoded As String) As String
Dim byt As Byte() = Convert.FromBase64String(strEncoded)
Return (System.Text.ASCIIEncoding.ASCII.GetString(byt))
End Function
Public Function EncodeBase64(strUnencoded As String) As String
Dim byt As Byte() = System.Text.Encoding.UTF8.GetBytes(strUnencoded)
Return (Convert.ToBase64String(byt))
End Function
End Class
and the calling methods from a form page:
If elemSetting.Attributes("name").Value = "LoginName" Then
Session("MailLoginName") = globalfunctions.DecodeBase64(elemSetting.Attributes("value").Value)
End If
If elemSetting.Attributes("name").Value = "LoginPass" Then
Session("MailLoginPass") = globalfunctions.DecodeBase64(elemSetting.Attributes("value").Value)
End If
Here the errors are being highlighted in the IDE:
And the error messages in the error list:
Understand, too, that I have tried as many variations of declarations as I can think of, such as "Public Shared Function," making the calling sub Shared, defining the global functions document as a Class or a Module, etc. Nothing works.
I've also tried placing the GlobalFunctions.vb class in the project's root directory and in a directory named App_Code, as was suggested in some blog posts around the net.
And since I have had no trouble like this with VS 2010, I assume it's a bug in 2017, which, as I said, I have reported. But I wanted to check with better minds than my own to see if I have overlooked something that may have changed somewhere between 2010 and 2017.
Can someone tell me if I am doing something wrong? Or maybe reaffirm for me that this is, indeed, a bug?
Thanks!
Try to delete and recreate your GlobalFunction.vb as maybe by renaming it in the past it didn't correctly correct everywhere in the project.
I think this is normal. You are using a Class and not a Module so you would need to declare a new instance either call like this:
Dim Globaler As New GlobalFunctions
If elemSetting.Attributes("name").Value = "LoginName" Then
Session("MailLoginName") = Globaler.DecodeBase64(elemSetting.Attributes("value").Value)
End If
If elemSetting.Attributes("name").Value = "LoginPass" Then
Session("MailLoginPass") = Globaler.DecodeBase64(elemSetting.Attributes("value").Value)
End If
Or use a Module and you wont need to declare a new instance.
Also if it still can't be accessed you should check the fact that maybe you just included the file to the solution without including it to the project
To Add new class:
Solution Explorer
Right Click your Project Name (above My Project)
Add
Class

VB.Net PayPal Integration Description

I am working with a historical PayPal system in vb.net. I am struggling to add individual item descriptions or names for the products that the user is paying for. It is using the NVPSetExpressCheckout and the data is meant to display on the PayPal website when the user is about to pay. Instead however I am getting constant issues which I assume must be due to syntax or just the way I am trying to do it.
Here is the current code which works:
Dim ppSet As New NvpSetExpressCheckout()
ppSet.Add(NvpSetExpressCheckout.Request._AMT, Decimal.Parse(litTotal.Text))
ppSet.Add(NvpSetExpressCheckout.Request.CURRENCYCODE, "GBP")
Dim basePath As String = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, String.Empty) + Request.ApplicationPath
ppSet.Add(NvpSetExpressCheckout.Request._RETURNURL, basePath & "paypal.aspx")
ppSet.Add(NvpSetExpressCheckout.Request._CANCELURL, basePath & "cancel.aspx")
I have then tried to add the a description using many methods such as:
ppSet.Add(NvpSetExpressCheckout.Request.L_DESC0, "First Item")
I however am simply getting errors like these:
'L_DESC0' is not a member of 'Encore.PayPal.Nvp.NvpSetExpressCheckout.Request'.
This issue is driving me mad and I can not find a fix. All documentation including the XML says that this is the correct way. I did try to just use the DESC field which worked however all the items just got displayed as one paragraph instead of being on separate lines. Help extremely appreciated.
Found the solution. It was due to the L_AMTn request not being submitted which is basically the item amounts. Once this adds up to the total cost it submits perfectly.

Content export in ektron

I am new to Ektron & using its 8.6.0 version, I want to create an widget which Import content of selected folder/form in Xliff/XML format (working same as EKtron provide but need to implement in custom widget using code, not in browser), I receive mail from support they tell that "There is a set of API’s that allows you to connect to the language export feature." but I am unable to find any API. Is anyone can help me for this.
I have use following approach but not get any result.
Localization temp = new Localization();
temp.StartExportContentForTranslation("1136,5012,5006", "2057,1031,1041");
Whenever you see a feature in the workarea that you want to emulate, just look at the workarea code. In Workarea\controls\content\localization_uc.ascx.cs, It says
protected Ektron.Cms.LocalizationAPI m_objLocalizationApi = new Ektron.Cms.LocalizationAPI();
protected Ektron.Cms.BusinessObjects.Localization.L10nManager localizationManager = null;
And then calls StartExportContentForTranslation

Get property value of control in a dynamically created usercontrol

I'm having trouble recovering a reference to a user control that is created dynamically so I can get the values of its properties or child controls.
I have a custom control called BookingObject.ascx which resides in App_Code.
I can create the controls programmatically without a problem but, later on, when I try to get a reference to the control, in order to access its child controls values, I just keep getting null.
Heres some code:
Dim MainItem As BookingItem = TryCast(LoadControl(GetType(BookingItem), Nothing), BookingItem)
MainItem.ID = "Item_" & NumberOfControls.ToString() 'Item_0
Dim lblid As Label = MainItem.FindControl("lblID")
lblid.Text = (NumberOfControls + 1).ToString()
NewItemPH.Controls.Add(MainItem)
Me.NumberOfControls += 1
This works fine and I can set the labels value successfully.
However:
Dim MainItem As BookingItem = TryCast(Me.Page.FindControl("Item_0"), BookingItem)
Dim product_id As DropDownList = MainItem.FindControl("product_id")
I get a null reference exception when trying to FindControl("product_id") as MainItem is nothing.
I've been struggling with this issue for hours now and it's something I assumed would be simple. I'm sure i'm just missing something small.
Can anyone tell me what I'm doing wrong?
All help is appreciated.
UPDATE
Never mind, I was being stupid and searching Me.Page for the control when I should have been searching NewItemPH.
Thanks to the mystery person who gave me the clue and then deleted their comment minutes later.

What is the equivalent of ASP(VB) Server.CreateObject("ADOX.Catalog") in ASP.net (VB.net)

Hi
I am trying to convert a asp page to asp.net.
I changed everything except this one line
Set dbC = Server.CreateObject("ADOX.Catalog")
Can anyone suggest an equivalent to this ADOX.Catalog in asp.net
This dbC is being used in the following way in asp
Set cm = Server.CreateObject("ADODB.Command")
cm.CommandText = Request("qry")
sN = Request("sN")
Set tmpTable = dbC.Tables(sN)
if NOT IsObject(tmpTable) then
dbC.Views.Append sN, cm
else
tmpTble.Command = cm
end if
Although I do not have direct experience, this article seems like it would be of assistance to you:
How To Retrieve Schema Information by Using GetOleDbSchemaTable and Visual C# .NET
Try adding a reference into your project called, Microsoft ADO ext.6.0 for DLL and security or something similar.
Once you add it, you'd be able to write code like:
Dim dbc as New ADOX.Catalog
Ps: Not answering from a windows m/c to verify. Got this from another forum post

Resources