예제 #1
0
        public void OpenFileMethod(object obj)
        {
            try
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.Filter = "Dll files (*.dll)|*.dll";

                if (openFileDialog.ShowDialog() == true)
                {
                    if (fBrowserModel == null)
                    {
                        fBrowserModel = new Models.MainModel();
                    }
                    Result = fBrowserModel.GetResult(openFileDialog.FileName);
                }
                lAssemblyName = Result.AssemblyName;
            }
            catch (System.BadImageFormatException)
            {
                MessageBox.Show("This is not .NET assembly!!!!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #2
0
        public IActionResult Main(Models.MainModel m)
        {
            DatabaseClasses.MainClass.CreateDataBaseFile(Config.DatabaseFileName);

            m.user = GetUser(m.access_token);


            //DatabaseClasses.MainClass conn= new MainClass(Config.DatabaseFileName);
            //conn.InsertUser(m.user);


            // var artists = GetUserArtists(m.user.id);
            // conn.InsertArtists(artists.data,m.user.id);

            /* var albums = new List<Album>();
             *
             * foreach( var a in artists.data)
             * {
             *   var l = GetArtistAlbums(a.id);
             *   albums.AddRange(l.data);
             *   conn.InsertAlbums(l.data, a.id);
             *   //test
             *   //break;
             * }*/



            return(View("Main", m));
        }
예제 #3
0
        public ActionResult ManageWords(int?collectionid)
        {
            try
            {
                using (var ctx = new WordsContext())
                {
                    if (collectionid == null)
                    {
                        collectionid = -1;
                    }

                    var model = new Models.MainModel();
                    model.Words        = ctx.Words.Include(x => x.Image).Where(x => x.Collection.CollectionId == collectionid).ToList();
                    model.CollectionId = collectionid;
                    var c = ctx.Collections.Include(x => x.Image).Where(x => x.CollectionId == collectionid).FirstOrDefault();
                    if (c != null)
                    {
                        model.CollectionName = c.Name;
                    }
                    if (c.Image != null)
                    {
                        model.CollectionPictureId = c.Image.PictureId;
                    }
                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
        public ActionResult Index(int?collectionid, bool ordenades = false)
        {
            using (var ctx = new WordsContext())
            {
                if (collectionid == null)
                {
                    collectionid = ctx.Collections.Min(x => x.CollectionId);
                }

                var model = new Models.MainModel()
                {
                    Words        = ctx.Words.Include(x => x.Image).Where(x => x.Collection.CollectionId == collectionid).ToList(),
                    CollectionId = collectionid
                };

                var c = ctx.Collections.Include(x => x.Image).Where(x => x.CollectionId == collectionid).FirstOrDefault();
                if (c != null)
                {
                    model.CollectionName = c.Name;
                }
                if (c.Image != null)
                {
                    model.CollectionPictureId = c.Image.PictureId;
                }

                model.Ordenades = ordenades;
                return(View(model));
            }
        }
예제 #5
0
 public MainWindowVM()
 {
     mainModel          = new Models.MainModel();
     ConvertionCommand  = new Commands.MenuAnimationButtonMWCommand(this);
     LiveRateCommand    = new Commands.MenuAnimationButtonMWCommand(this);
     HistoricalCommand  = new Commands.MenuAnimationButtonMWCommand(this);
     ExitProgramCommand = new Commands.MenuAnimationButtonMWCommand(this);
 }
예제 #6
0
        // GET: Pieces
        public ActionResult Index()
        {
            using (var ctx = new WordsContext())
            {
                var model = new Models.MainModel()
                {
                    Words = ctx.Words.Where(x => x.Type == Word.TypeEnum.Piece && !string.IsNullOrEmpty(x.Part1.Trim())).ToList(),
                };

                return(View(model));
            }
        }
예제 #7
0
        public FlightViewModel(ModifyViewModel modifyVM)
        {
            modifyViewModel = modifyVM;
            model           = modifyViewModel.Model;
            Views.FlightView fl = new Views.FlightView();

            casingImage = model.CasingType;
            heaterImage = model.HeaterType;
            basketImage = model.BasketType;
            model.HeaterCurrentPower = model.HeaterPower / 2;

            if (model.Overheat)
            {
                ActivateItem(new CasingOverheatDialogViewModel());
            }
        }
예제 #8
0
 public ActionResult ManagePieces()
 {
     try
     {
         using (var ctx = new WordsContext())
         {
             var model = new Models.MainModel();
             model.Words = ctx.Words.Where(x => x.Type == Word.TypeEnum.Piece).ToList();
             return(View(model));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #9
0
        public IActionResult AfterAuth(string code, string state)
        {
            string url = Urls.GetUrlForAccessToken(code);

            string content = "";

            using (var client = new HttpClient())
            {
                var response = client.GetAsync(url).Result;
                content = response.Content.ReadAsStringAsync().Result;

                content = HttpUtility.ParseQueryString(content).Get("access_token");
            }



            Models.MainModel m = new Models.MainModel();

            m.access_token = content;
            return(Main(m));
        }
예제 #10
0
 public MainViewModel()
 {
     _mainModel = new Models.MainModel();
     Initialize();
 }
예제 #11
0
 public MainViewModel()
 {
     mainModel = new Models.MainModel();
 }
예제 #12
0
 public FileDocumentsMgr(MainModel mainModel)
 {
     this._mainModel = mainModel;
 }