Sunday, 21 April 2013

Objects is like arrays by using "Indexers"

I am here give some introduce about C# object indexers like array.

Define Object indexer
"this" keyword + [ ] is used for defining a object indexer.Take this as a example,you'll get a more complete example shortly.

class yourCls{
   public object this[String passIn] // Declare Indexer.
   {
     get{}
     set{}       
   }
}
 
yourCls indexerCls = new indexerCls();
indexerCls["ObjectIndexer"] = "Sample"; //you can using indexer like this.
 
Example with Collection
This example is using Collection in .Net Framework to implement Get or Set Properties dynamically.


using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;

namespace ObjectindexerWithCollection
{
    class DynamicProperties
    {
        public Dictionary<string, string> hData 
            = new Dictionary<string, string>(); //Declare dictionary to handler properties.

        public string this[string parameterName]
        {
            get
            {
                return this.hData[parameterName];
            }
            set
            {
                this.hData[parameterName] = value;
            }
        }

    }
    class Program
    {
        static void Main(string[] args)
        {
            DynamicProperties lbx = new DynamicProperties();
            lbx["test"] = "Object ";  //set Indexer
            lbx["test1"] = "Indexers";//set Indexer

            Console.WriteLine("Here is the sample of {0}{1}", 
                lbx["test"], lbx["test1"]); //get Indexer
           
            Console.ReadLine();
        }

    }
}


Example Output
This C# feature is useful at advanced C# software development. Just take as a note.Its can be using to design internal the "software pattern", you also can Apply in your software depend on your creative thinking.

Saturday, 20 April 2013

Interview Failed At Avanade

Last two week,i visit avanade for an interview.I failed because my poor english.Interviewer sayed ,your technical skill not bad,but you will got problem for english presentation.I failed because my english.Interviewer is a nice guy.He introduce me to another ms company and telling me take some english course to improve my english.After i improve my english,i will attend for interview again,hope i will pass the interview soon,good luck!

Monday, 15 April 2013

MsCrm 2011 :Error Message - Assembly must be registered in isolation when register Plugin






If you found this error was being thrown because user was not a deployment administrator(maybe System Administrator).For security purpose,Mscrm will forced register the plugins under sandbox isolation mode.

You can know more at : http://msdn.microsoft.com/en-us/library/gg309620.aspx

Security Restrictions Part.





Monday, 18 March 2013

How to downgrade Visual Studio project version

Here is the method to downgrade your VS project version.

  1. Make back up of your .sln file
  2. Open your VS .sln in text editor.
It look something like this:
Microsoft Visual Studio Solution File, Format Version 11.00

Visual Studio 2010 Project("{FAE04EC0-301F-11D3.......}

  1. Change the Version ?? to Version ?? and the Visual Studio yyyy to yyyy
without the version ,you can reference to a project (Or using VS to create a new project),take a view with text editor to get it's.

Starting to explore on Dynamic CRM 2011

First of March 2013,i accepted a new job offer at PJ,Malaysia as a Analyst.
My job scope is develop .net product ,such as dynamic crm(plugin ,planing ,customization,etc).
 Finally i got a chance to focus on Mircosoft product.
Starting my new life and All The Best!