public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            News_Card card = gEventArgs.GestureObjects[0] as News_Card;

            Shared_Card_List.UpdateSharedCards();
            gestureControler.Control.CloudControler.UpdateMatrix();
            base.TerminateGesture(sender, gEventArgs);
        }
        public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            News_Card card = sender as News_Card;

            Shared_Card_List.UpdateSharedCards();
            gestureControler.Control.CloudControler.UpdateMatrix();
            base.FailGesture(sender, gEventArgs);
        }
Example #3
0
        public void LoadCardLayout(String dir)
        {
            configFileDir = Path.Combine(Environment.CurrentDirectory, dir);
            if (File.Exists(configFileDir))
            {
                StreamReader reader   = new StreamReader(configFileDir);
                String       nextLine = "";
                while ((nextLine = reader.ReadLine()) != null)
                {
                    LoadingCard readCard = JsonConvert.DeserializeObject <LoadingCard>(nextLine);
                    int         zindex   = 0;
                    if (readCard.userID == "Alex" && STATICS.ALEX_ACTIVE ||
                        readCard.userID == "Ben" && STATICS.BEN_ACTIVE ||
                        readCard.userID == "Chris" && STATICS.CHRIS_ACTIVE ||
                        readCard.userID == "Danny" && STATICS.DANNY_ACTIVE)
                    {
                        News_Card myCard = new News_Card(loader.MainWindow.Controlers.CardControler, readCard.userID);
                        myCard.UUID  = readCard.cardID;
                        myCard.Owner = readCard.userID;
                        My_News news = new My_News();
                        news.Author   = readCard.author;
                        news.Title    = readCard.title;
                        news.Content  = readCard.content;
                        myCard.News   = news;
                        myCard.NewsID = readCard.newsID;
                        System.Windows.Media.Color color = System.Windows.Media.Colors.White;
                        switch (readCard.userID)
                        {
                        case "Alex":
                            color = STATICS.USER_COLOR_CODE[0];
                            break;

                        case "Ben":
                            color = STATICS.USER_COLOR_CODE[1];
                            break;

                        case "Chris":
                            color = STATICS.USER_COLOR_CODE[2];
                            break;

                        case "Danny":
                            color = STATICS.USER_COLOR_CODE[3];
                            break;
                        }
                        myCard.InitializeCard(color, new Point(readCard.position[0], readCard.position[1]), readCard.rotate, 1, zindex++);
                        Card_List.AddCard(myCard);
                        loader.MainWindow.Controlers.UserControler.ReceiveCard(readCard.userID, myCard);
                        loader.MainWindow.CardLayer.AddCard(myCard);
                        Canvas.SetZIndex(myCard, myCard.ZIndex);
                    }
                }
            }
        }
 public void LoadCardLayout(String dir)
 {
     configFileDir = Path.Combine(Environment.CurrentDirectory, dir);
     if (File.Exists(configFileDir))
     {
         StreamReader reader = new StreamReader(configFileDir);
         String nextLine = "";
         while ((nextLine = reader.ReadLine()) != null)
         {
             LoadingCard readCard = JsonConvert.DeserializeObject<LoadingCard>(nextLine);
             int zindex = 0;
             if (readCard.userID == "Alex" && STATICS.ALEX_ACTIVE ||
                 readCard.userID == "Ben" && STATICS.BEN_ACTIVE ||
                 readCard.userID == "Chris" && STATICS.CHRIS_ACTIVE ||
                 readCard.userID == "Danny" && STATICS.DANNY_ACTIVE)
             {
                 News_Card myCard = new News_Card(loader.MainWindow.Controlers.CardControler, readCard.userID);
                 myCard.UUID = readCard.cardID;
                 myCard.Owner = readCard.userID;
                 My_News news = new My_News();
                 news.Author = readCard.author;
                 news.Title = readCard.title;
                 news.Content = readCard.content;
                 myCard.News = news;
                 myCard.NewsID = readCard.newsID;
                 System.Windows.Media.Color color= System.Windows.Media.Colors.White;
                 switch (readCard.userID) {
                     case "Alex":
                         color = STATICS.USER_COLOR_CODE[0];
                         break;
                     case "Ben":
                         color = STATICS.USER_COLOR_CODE[1];
                         break;
                     case "Chris":
                         color = STATICS.USER_COLOR_CODE[2];
                         break;
                     case "Danny":
                         color = STATICS.USER_COLOR_CODE[3];
                         break;
                 }
                 myCard.InitializeCard(color, new Point(readCard.position[0], readCard.position[1]), readCard.rotate, 1, zindex++);
                 Card_List.AddCard(myCard);
                 loader.MainWindow.Controlers.UserControler.ReceiveCard(readCard.userID, myCard);
                 loader.MainWindow.CardLayer.AddCard(myCard);
                 Canvas.SetZIndex(myCard, myCard.ZIndex);
             }
         }
     }
 }