Shared Flashcard Set

Details

Beginners C#
Syntax
25
Software
2nd Grade
12/05/2014

Additional Software Flashcards

 


 

Cards

Term
What do { } bracket indicate ?
Definition

Binding  example 

<TextBlock Text="Raf" Forground="{StaticResource MyRaf}" />

Term
What does Application.Resource do and where do you code this?
Definition

  <Application.Resources>  is code that applies your Style to the whole of your project.


coded at App.xaml 

Term
General note: you should never force user to use your font choice or theme  , think style 
Definition
Term
What does <Page.Resources> do?
Definition

You add this in the main.xaml page 

it allows you to define your own static Resources

Term
package.appmainifest
Definition

Sometime refer as meta tag area.

don't mess with the background xml area.


Toast section displays at top of the screen to notify users of a event such as news , weather Alert 10sec display.


Lock screen allow you to update lock screen with text numbers or alerts.


Capabilites tab

This is area where you required user permission to access , contact location etc. 

Term
how to use setter tag in xaml page
Definition
<Page.Resources> <Style TargetType="Button" x:Key="MyStyle"> <Setter Property="Background" Value="CornflowerBlue" /> <Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="FontSize" Value="12" /> <Setter Property="Foreground" Value="#777777" /> </Style> </Page.Resources>
Term
how do you navigate to another page?
Definition

Done in C# 

// simple naviation , no parameters

            Frame.Navigate(typeof(Page2));

Term
declaring variables  & assigning
Definition

example :  string FirstName;

  • Int Number;
  • float distance;
Term
how to declare a while loop
Definition
while (DoSomething()) ;
Term
how do you declare Array in c sharp?
Definition

synax: int[] Numbers ={5,4,3,9};

 

above is integer can apply to any varaible.

Term
how to you declare a foreach statement?
Definition

foreach( int variable in variable)

{

 

}

Term
how do you delcare a if statement in C sharp?
Definition

if( variable1 > variable2 )

{

     do something;

}

Term
Defining a C# class
Definition

class Rectangle

{ // start of a class


    private double length;

    private double width;


       public Rectangle(double 1, double  w)

      {

           length = 1;

           width = w;

      }

   

   public double GetArea()

   {

       return length * width; 

   } 



}// end of a class Rectangle

Term
Example of Method :
Definition

public void InitFields(double 1, double w)

{

   lenght = 1;

    width = w;

 

}

Term
Example of Constructors
Definition

class Rectangle 

{

    private double length;

    private double width;


     public Rectangle(double 1, double w )

     {

         length = 1;

          width = w;

     }

 

}

Term
example of Properties
Definition

has two accessors get and set 

 

Class Rectangle

{

     private double length;

     

     public double Length

     {

          get

          {

             return length;

           }


         set 

          {

                 if ( value > 0.0)

                   length = value

          }

     }


}

Term
declaring static members
Definition

class Program

{

     static void Main(string[] args)

    {

        Console.WriteLine(Rectangle.ShapeName);

    }

    

    class Rectangle

    {

        public static string ShapeName

         {

             get { return "Rectangle"; }

         }


     } 

}

Term
Example of Sealed classes
Definition
[image]
Term

The is Operator 

 

To avoid runtime errors such as the InvalidCastException the is operator can be used to check whether the cast is allowed before actually performing the cast.

Definition
[image]
Term
The as operator is similar to the cast operation but, in the case of as , if the type conversion is not possible null is returned instead of raising an exception.
Definition
[image]
Term
Example of Polymorphism ?
Definition
[image]
Term
Example of interface ?
Definition
[image]
Term
Example of namespace 
Definition
[image]
Term
example of Generics synax
Definition

Generics :

 

public class DataStore<T>

{

       public T id;

}

 

DataStore<int> productionData = New DataStore<int>();

productionData.id = 10;

Term
Creating Stored Procedures: SQL
Definition

Example :

 

CREATE PROCEDURE table name 

AS

     SELECT * FROM tblcustomers

     Where Country = 'France'

Return

Supporting users have an ad free experience!