Affichage des articles dont le libellé est C#. Afficher tous les articles
Affichage des articles dont le libellé est C#. Afficher tous les articles

mardi 22 septembre 2015

Windows Store Content Dialog Close programmaticaly

Close content Dialog programmaticaly Windows Universal app

The following code can be used to close the new content Dialog after a period of time.

private IAsyncOperation<ContentDialogResult> dialogTask;
    private void Button_Click(object sender, RoutedEventArgs e)
    {
       ContentDialog dlg= new ContentDialog();
        dlg.Content = new TextBlock() { Text = "This content dialog will closed in 5sec!" };
        try
        {
            dialogTask = dlg.ShowAsync();
        }
        catch (TaskCanceledException)
        {
            //this was cancelled
        }

        DispatcherTimer dt = new DispatcherTimer();
        dt.Interval = TimeSpan.FromSeconds(5);
        dt.Tick += dt_Tick;
        dt.Start();
    }

    void dt_Tick(object sender, object e)
    {
        (sender as DispatcherTimer).Stop();
        dialogTask.Cancel();
    }

vendredi 13 décembre 2013

SharePoint 2010 / 2013 Get all groups for SPUser including active directory group

SharePoint don't give you groups for SPUser if the right is given by an active directory group.

You have to merge groups specificied directly using user login in sharepoint groups and active directory groups.


private static List<SPGroup> GetAllUserGroups(SPUser user)
{
    List<SPGroup> groups = new List<SPGroup>();
    //Get groups from SharePoint
    foreach (SPGroup spGroup in user.Groups)
    {
        groups.Add(spGroup);
    }
    string userLogin = user.LoginName;

mercredi 30 janvier 2013

How to log directly into EventLog server (Observateurs d'événements)

Every application can write into the server event log diary thanks to a C# class called "System.Diagnostics.EventLog"

In order to log message you have to instanciate one object of this class and specify two important elements Source and Log

Log will define the category in which your message will appear, you can use 'Application' 'Security' 'Installation' and so on.

Source define the name of the application that log the message, you can use your application name for example.


And the C# code to log into the diary event :


private static string SourceLog = "MyApplicationName";
private static string LogApp = "Application";
private static System.Diagnostics.EventLog eventLogApplication;

/// <summary>
/// Log the message into the Windows event log diary
/// </summary>
/// <param name="message">Message</param>
static void Log( string message )
{
     Log( message, System.Diagnostics.EventLogEntryType.Information );
}

/// <summary>
/// Log the message into the Windows event log diary
/// </summary>
/// <param name="message">Message enregistré</param>
/// /// <param name="entryType">Entry type</param>
static void Log( string message, System.Diagnostics.EventLogEntryType entryType )
{
     try
     {
          //Initialisation
          if (!System.Diagnostics.EventLog.SourceExists(SourceLog))
         {
              System.Diagnostics.EventLog.CreateEventSource(SourceLog, LogApp);
         }
         if (eventLogApplication == null)
        {
             eventLogApplication = new System.Diagnostics.EventLog();
             ((System.ComponentModel.ISupportInitialize)(eventLogApplication)).BeginInit();
             eventLogApplication.Source = SourceLog;
              eventLogApplication.Log = LogApp;
        }

        //Writing
        eventLogApplication.WriteEntry(message, entryType);
   }
    catch (Exception e)
    {
        Log("Error Log : " + e.InnerException + " " + e.Message, EventLogEntryType.Error);
      }
}

lundi 28 janvier 2013

BeMyApp dev kings 2013

L'initiative BeMyApp continue son petit bonhomme de chemin et propose un nouveau défi pour les fan de développement :

http://pitchyourapp.eventbrite.fr/

Source : BeMyApp.fr

DEV KINGS 2013 - On remet ça !
Edition spéciale app'citoyenne

Venez développer vos applications citoyennes et participez au concours des DEV KINGS 2013.
Choisissez la localité à représenter, créez votre team et développez vos app' !


2 MOIS POUR DEVELOPPER LA MEILLEURE APP'CITOYENNE
Le 12 février
Soirée Pitch Your App, lancement du concours. Pitchez vos idées, rencontrez votre équipe de développeurs, porteurs d'idées, designers et autres super pouvoirs.

Du 12 février au 12 avril
Sessions de coaching Microsoft, développez à l'aide des experts Microsoft vos applications en deux mois.

Weekend du 12 au 14 avril
DEV KINGS 2013inscrivez-vous et venez terminer vos applications avec vos équipes en 48h ! Participez à la grande finale, soumettez vos applications sur Windows Store et passez un WeekEnd de folie dans l'Under d'EPITECH.


INSCRIVEZ-VOUS ICI A LA SOIREE PITCH YOUR APP
Mardi 12 février Chez Régine, venez créer votre équipe à la soirée Pitch Your App

Le but de cette soirée est de mettre en relation des personnes qui ont des idées d'applications, des développeurs et des designers pour créer des applications citoyennes sous Windows 8 et Windows Phone.
Vous avez une super idée d'application, mais pas les compétences, c'est le moment de vous inscrire pour la pitcher et trouver votre team. 
Vous êtes développeurs, designers ou avez des compétences à apporter ? Alors participez au challenge pour rejoindre une équipe, trouvez des compétences complémentaires pour vos applis et gagnez des dotations Microsoft et Intel !