Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsDNN Event Module - Anyone have a C# (C Sharp) version of the source?DNN Event Module - Anyone have a C# (C Sharp) version of the source?
Previous
 
Next
New Post
5/29/2011 1:57 AM
 
Try

gvEvents.Columns[0].Visible = true;

 
New Post
5/29/2011 6:38 AM
 
Perfect! Thanks.
 
New Post
5/29/2011 11:35 AM
 
I am down to two errors!  Yeah! 
Now I have a new issue.

VB Code:
Namespace DotNetNuke.Modules.Events

    Partial Class EventIcons
        Inherits DotNetNuke.Modules.Events.EventBase
        Private MyFileName As String = Me.GetType().BaseType.Name + ".ascx"

        Protected Overloads ReadOnly Property LocalResourceFile() As String
            Get
                Return Services.Localization.Localization.GetResourceFile(Me, MyFileName)
            End Get
        End Property

C Sharp Code:  (I need to figure out how to get the keyword 'this', or some other way of getting the BaseType Name.
namespace DotNetNuke.Modules.Events
{

    partial class EventIcons : QHWeb.Modules.Event.EventBase
    {
        private string MyFileName = this.GetType().BaseType.Name + ".ascx";
                                                           ~~~  <- Keyword this does not exist in this context.
        protected string LocalResourceFile {
            get { return Localization.GetResourceFile(this, MyFileName); }
        }
 
New Post
5/29/2011 8:57 PM
 
For some reason, C# does not let you reference the 'this' keyword when defining a class field or in a static method. Perhaps it is because 'this' is not in scope prior to the class constructor being called - but not sure the reason. Either of the following should work - I'd go with the second option and just hardcode the Filename as a string as it is the most easily understood by those looking at your code int he future.

Option 1:     private string MyFileName = typeof(EventIcons).BaseType.Name + ".ascx";

Option 2:     private string MyFileName = "EventIcons.ascx";



Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
5/29/2011 9:14 PM
 
I found the solution.  The private won't work, but bringing the text into the function actually worked..


        protected string LocalResourceFile {
            get { return Localization.GetResourceFile(this, this.GetType().BaseType.Name + ".ascx"); }
                                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        }
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsDNN Event Module - Anyone have a C# (C Sharp) version of the source?DNN Event Module - Anyone have a C# (C Sharp) version of the source?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out