Exemplo n.º 1
0
 public MainWindow()
 {
     //System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("ru-RU");
     InitializeComponent();
     Closing += (s, EA) => Environment.Exit(0);
     RICClient.Init(KeyInputDialog.Show());
     RICClient.InitCompleted += RICClient_InitCompleted;
 }
Exemplo n.º 2
0
 public static List <Article> Take(int count)
 {
     return(new List <Article>(RICClient.RequestData(new RICRequest
     {
         Type = "GET",
         In = "Article",
         By = "Take",
         Data = count.ToString()
     }).Data.OfType <Article>()));
 }
Exemplo n.º 3
0
 public static string Remove(int ID)
 {
     return(RICClient.RequestData(new RICRequest
     {
         Type = "REMOVE",
         In = "Article",
         By = "ID",
         Data = ID.ToString()
     }).Data.OfType <string>().FirstOrDefault());
 }
Exemplo n.º 4
0
 public static List <Article> GetArticlesByTags(string tags)
 {
     return(new List <Article>(RICClient.RequestData(new RICRequest
     {
         Type = "GET",
         In = "Article",
         By = "AnyTag",
         Data = tags.Replace(" ", "").Replace(",", "")
     }).Data.OfType <Article>()));
 }
Exemplo n.º 5
0
 public static List <Article> GetArticlesByText(string text)
 {
     return(new List <Article>(RICClient.RequestData(new RICRequest
     {
         Type = "GET",
         In = "Article",
         By = "Text",
         Data = text
     }).Data.OfType <Article>()));
 }
Exemplo n.º 6
0
 public static Article GetArticleByID(int ID)
 {
     return((Article)RICClient.RequestData(new RICRequest
     {
         Type = "GET",
         In = "Article",
         By = "ID",
         Data = ID.ToString()
     }).Data.FirstOrDefault(c => c is Article));
 }
Exemplo n.º 7
0
 public static string Set(int at, Article article)
 {
     article.ID = at;
     return(RICClient.RequestData(new RICRequest
     {
         Type = "SET",
         In = "Article",
         By = "ID",
         Data = article.ToString()
     }).Data.OfType <string>().FirstOrDefault());
 }
Exemplo n.º 8
0
        public static string Add(Article article)
        {
            var similarArticles = GetArticlesByTitle(article.Title);

            if (similarArticles.Any(c => c.Title == article.Title))
            {
                return(Set(similarArticles.First(c => c.Title == article.Title).ID, article));
            }
            else
            {
                return(RICClient.RequestData(new RICRequest
                {
                    Type = "ADD",
                    In = "Article",
                    By = "ID",
                    Data = article.ToString()
                }).Data.OfType <string>().FirstOrDefault());
            }
        }
Exemplo n.º 9
0
 void AdminCrown_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     RICClient.Stop();
     RICClient.Init(KeyInputDialog.Show());
 }