コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: punker76/Gallifrey
        public MainWindow(InstanceType instance)
        {
            InitializeComponent();

            var gallifrey = new Backend(instance);

            modelHelpers = new ModelHelpers(gallifrey, FlyoutsControl);

            exceptionlessHelper = new ExceptionlessHelper(modelHelpers);
            exceptionlessHelper.RegisterExceptionless();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers);

            var viewModel = new MainViewModel(modelHelpers);

            DataContext = viewModel;

            Height = gallifrey.Settings.UiSettings.Height;
            Width  = gallifrey.Settings.UiSettings.Width;
            ThemeHelper.ChangeTheme(gallifrey.Settings.UiSettings.Theme);

            updateHeartbeat          = new Timer(TimeSpan.FromMinutes(30).TotalMilliseconds);
            updateHeartbeat.Elapsed += AutoUpdateCheck;

            idleDetectionHeartbeat          = new Timer(TimeSpan.FromSeconds(30).TotalMilliseconds);
            idleDetectionHeartbeat.Elapsed += IdleDetectionCheck;

            flyoutOpenCheck          = new Timer(100);
            flyoutOpenCheck.Elapsed += FlyoutOpenCheck;
        }
コード例 #2
0
        public Search(ModelHelpers modelHelpers, bool openFromAdd, DateTime selectedDateTab)
        {
            this.modelHelpers    = modelHelpers;
            this.openFromAdd     = openFromAdd;
            this.selectedDateTab = selectedDateTab;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            var recent = modelHelpers.Gallifrey.JiraTimerCollection.GetJiraReferencesForLastDays(50);

            List <string> filters;
            List <Issue>  issues;

            try
            {
                filters = modelHelpers.Gallifrey.JiraConnection.GetJiraFilters().ToList();
            }
            catch (Exception)
            {
                filters = new List <string>();
            }

            try
            {
                issues = modelHelpers.Gallifrey.JiraConnection.GetJiraCurrentUserOpenIssues().ToList();
            }
            catch (Exception)
            {
                issues = new List <Issue>();
            }

            DataContext = new SearchModel(filters, recent, issues);
        }
コード例 #3
0
        private void SetupViews()
        {
            this.progress = new ProgressDialogHelper(this);
            this.advertisementDetailsWrapperLayout = FindViewById <RelativeLayout>(Resource.Id.advertisementDetailsWrapperLayout);
            this.distanceTextView = FindViewById <TextView>(Resource.Id.distanceDetailsTextView);
            this.sellerNetworkStateInfoImageView = FindViewById <ImageView>(Resource.Id.sellerNetworkState);
            this.forSellOrChangeInfoTextView     = FindViewById <TextView>(Resource.Id.forSellOrChangeInfo);
            this.startConversationBtn            = FindViewById <ImageView>(Resource.Id.startConvesationBtn);
            this.price                  = FindViewById <TextView>(Resource.Id.advertisementDeatilsPrice);
            this.title                  = FindViewById <TextView>(Resource.Id.advertisementDetailsTitle);
            this.description            = FindViewById <TextView>(Resource.Id.advertisementDetailsDescription);
            this.sellerName             = FindViewById <TextView>(Resource.Id.textViewUserNameAdvertDetails);
            this.textViewCityName       = FindViewById <TextView>(Resource.Id.textViewCityName);
            this.textViewAdvertStatus   = FindViewById <TextView>(Resource.Id.textViewAdvertStatus);
            this.btnContactBottom       = FindViewById <Button>(Resource.Id.btnContactBottom);
            this.userPhoto              = FindViewById <CircleImageView>(Resource.Id.profile_image_on_advert_det);
            this.userPhoto.Click       += (s, e) => TogleLayouts();
            this.nestedScrollViewLayout = FindViewById <NestedScrollView>(Resource.Id.nestedScrollViewLayout);
            this.userAdvertsLayout      = FindViewById <RelativeLayout>(Resource.Id.userAdvertisementsRecyclerViewWrapper);
            textViewSizeValue           = FindViewById <TextView>(Resource.Id.textViewSizeValue);
            advertisementsRecyclerView  = FindViewById <RecyclerView>(Resource.Id.advertisementsRecyclerViewOnAdvertDetails);
            var mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical);

            advertisementsRecyclerView.SetLayoutManager(mLayoutManager);

            photosRecyclerView = FindViewById <RecyclerView>(Resource.Id.photosRecyclerViewOnAdvertDetails);
            var photoRecyclerLayoutManager = new LinearLayoutManager(this);

            photoRecyclerLayoutManager.Orientation = LinearLayoutManager.Horizontal;
            photosRecyclerView.SetLayoutManager(photoRecyclerLayoutManager);

            this.nestedScrollViewLayout.RequestLayout();
        }
コード例 #4
0
ファイル: Export.xaml.cs プロジェクト: fzr600dave/Gallifrey
 public Export(ModelHelpers modelHelpers, Guid timerId, TimeSpan?exportTime, bool skipJiraCheck = false)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
     SetupContext(modelHelpers.Gallifrey.JiraTimerCollection.GetTimer(timerId), exportTime, skipJiraCheck);
 }
コード例 #5
0
        public EunKGDetailsViewModel(IEventAggregator EventAggregator, IEunKGServices EunKGServices)
        {
            this.EunKGServices   = EunKGServices;
            this.EventAggregator = EventAggregator;

            State = string.Empty;

            hlp    = new ProgressDialogHelper(EventAggregator);
            worker = new BackgroundWorker();
            worker.WorkerSupportsCancellation = true;

            _onloadedCommand   = new DelegateCommand(OnLoaded);
            _saveCommand       = new DelegateCommand <object>(SaveCommand, CanSave);
            _deleteCommand     = new DelegateCommand <object>(DeleteCommand, CanDelete);
            _IsSelected        = new DelegateCommand <object>(CheckBoxIsSelected);
            _PrintLblCommand   = new DelegateCommand <object>(PrintLabel, CanPrint);
            _checkedAllCommand = new DelegateCommand(() =>
            {
                SetIsSelectedProperty(true);
            });
            _unCheckedAllCommand = new DelegateCommand(() =>
            {
                SetIsSelectedProperty(false);
            });
            _backCommand       = new DelegateCommand(BackCommand);
            interactionRequest = new InteractionRequest <Confirmation>();
        }
コード例 #6
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActivityInstance = this;
            progress         = new ProgressDialogHelper(this);
            signInService    = new SignInService();
            bitmapService    = new BitmapOperationService();
            appSettings      = SharedPreferencesHelper.GetAppSettings(this);
            if (!appSettings.ChatDisabled)
            {
                this.chatHubClientService = ChatHubClientService.GetServiceInstance(bearerToken);
            }
            this.messagesService = new MessagesService(bearerToken);
            SetContentView(Resource.Layout.ConversationActivity);
            SetupViews(savedInstanceState);
            SetupConversationToolbar();
            pageNumber = 0;
            GetExtras();
            player = new MediaPlayer();
            player.SetDataSource(this, Android.Net.Uri.Parse("android.resource://" + this.PackageName + "/raw/" + Resource.Raw.message_sound));
            player.Prepare();
            progress.ShowProgressDialog("Trwa pobieranie wiadomoœci...");
            await SetupIntelocutorInfo();
            await GetAndDisplayMesages(savedInstanceState);

            coversationsLayoutWrapper.Visibility = ViewStates.Visible;
            progress.CloseProgressDialog();
        }
コード例 #7
0
ファイル: Export.xaml.cs プロジェクト: BlythMeister/Gallifrey
 public Export(ModelHelpers modelHelpers, Guid timerId, TimeSpan? exportTime, bool skipJiraCheck = false)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
     SetupContext(modelHelpers.Gallifrey.JiraTimerCollection.GetTimer(timerId), exportTime, skipJiraCheck);
 }
コード例 #8
0
        public Settings(ModelHelpers modelHelpers)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers);
            DataContext          = new SettingModel(modelHelpers.Gallifrey.Settings, modelHelpers.Gallifrey.VersionControl);
        }
コード例 #9
0
ファイル: BulkExport.xaml.cs プロジェクト: punker76/Gallifrey
 public BulkExport(ModelHelpers modelHelpers, List <JiraTimer> timers)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers);
     DataContext          = new BulkExportContainerModel();
     SetupContext(timers);
 }
コード例 #10
0
 private void SetupViews()
 {
     progress = new ProgressDialogHelper(this);
     SetupFacebookLogin();
     SetupAcceptCheckbox();
     SetupStandardLogin();
     SetupGoToRegistration();
 }
コード例 #11
0
 public BulkExport(ModelHelpers modelHelpers, List<JiraTimer> timers)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
     DataContext = new BulkExportContainerModel();
     SetupContext(timers);
 }
コード例 #12
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.AppInfoAndContactActivity);
     feedbackService = new FeedbackService(bearerToken);
     progress        = new ProgressDialogHelper(this);
     base.SetupToolbar();
     SetupViews();
 }
コード例 #13
0
        private async Task SetupViews()
        {
            progress = new ProgressDialogHelper(this);
            this.textViewNoConversations   = FindViewById <TextView>(Resource.Id.textViewNoConversations);
            this.conversationsRecyclerView = FindViewById <RecyclerView>(Resource.Id.conversationsRecyclerView);
            var mLayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(this);

            this.conversationsRecyclerView.SetLayoutManager(mLayoutManager);
            await DownloadAndShowConversations(true);
        }
コード例 #14
0
ファイル: EditTimer.xaml.cs プロジェクト: punker76/Gallifrey
        public EditTimer(ModelHelpers modelHelpers, Guid selected)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers);

            EditedTimerId = selected;
            DataContext   = new EditTimerModel(modelHelpers.Gallifrey, EditedTimerId);
        }
コード例 #15
0
        public EditTimer(ModelHelpers modelHelpers, Guid selected)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            EditedTimerId = selected;
            DataContext = new EditTimerModel(modelHelpers.Gallifrey, EditedTimerId);
        }
コード例 #16
0
ファイル: Search.xaml.cs プロジェクト: BlythMeister/Gallifrey
        public Search(ModelHelpers modelHelpers, bool openFromAdd = false, bool openFromEdit = false, DateTime? selectedDateTab = null)
        {
            this.modelHelpers = modelHelpers;
            this.openFromAdd = openFromAdd;
            this.openFromEdit = openFromEdit;
            this.selectedDateTab = selectedDateTab ?? DateTime.Now.Date;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            LoadSearch();
        }
コード例 #17
0
        public Search(ModelHelpers modelHelpers, bool openFromAdd = false, bool openFromEdit = false, DateTime?selectedDateTab = null)
        {
            this.modelHelpers    = modelHelpers;
            this.openFromAdd     = openFromAdd;
            this.openFromEdit    = openFromEdit;
            this.selectedDateTab = selectedDateTab ?? DateTime.Now.Date;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            LoadSearch();
        }
コード例 #18
0
        public LabelPrintMainViewModel(IEventAggregator EventAggregator)
        {
            this.EventAggregator = EventAggregator;

            hlp    = new ProgressDialogHelper(EventAggregator);
            worker = new BackgroundWorker();
            worker.WorkerSupportsCancellation = true;

            _CommandBindings = new CommandBindingCollection();
            _printLblCommand = new DelegateCommand <object>(Print, CanPrint);

            InitializeCommandBindings();
        }
コード例 #19
0
        // internal static to make it more testable
        internal static CommandProcessor PrepareCommandsAndIntegrityChecks(
            ModelBuilderSettings modelBuilderSettings,
            EditingContext editingContext,
            EntityDesignArtifact designArtifact)
        {
            Debug.Assert(modelBuilderSettings != null, "modelBuilderSettings != null");
            Debug.Assert(editingContext != null, "editingContext != null");
            Debug.Assert(designArtifact != null, "artifact != null");

            var commands = new List <Command>();

            if (modelBuilderSettings.NewFunctionSchemaProcedures != null &&
                modelBuilderSettings.NewFunctionSchemaProcedures.Count > 0)
            {
                // user selected to create new FunctionImports, but don't create the composable ones as these have already been created by the runtime
                ProgressDialogHelper.ProcessStoredProcedureReturnTypeInformation(
                    designArtifact,
                    modelBuilderSettings.NewFunctionSchemaProcedures,
                    commands,
                    shouldCreateComposableFunctionImports: false);
            }
            else
            {
                commands.AddRange(CreateRemoveFunctionImportCommands(designArtifact));
            }

            // for SqlServer and SqlServerCe we need to add integrity checks - see the comment below
            if (commands.Count > 0 ||
                designArtifact.IsSqlFamilyProvider())
            {
                // set up CommandProcessorContext
                var cpc = new CommandProcessorContext(
                    editingContext,
                    EfiTransactionOriginator.CreateNewModelId,
                    Resources.Tx_CreateFunctionImport);

                // We propagate facets by default only for Sql Server or Sql Server CE since for other providers facets in C-Space might be intentionally
                // out of sync with facets from S-Space and we should not break this. For Sql Server and Sql Server CE facets should be in sync in most cases.
                if (designArtifact.IsSqlFamilyProvider())
                {
                    // Add integrity check to enforce synchronizing C-side Property facets to S-side values
                    PropagateStoragePropertyFacetsToConceptualModel.AddRule(cpc, designArtifact);
                }

                return(new CommandProcessor(cpc, commands));
            }

            // no commands or integrity checks to run
            return(null);
        }
コード例 #20
0
        private void ResetDefaults_PreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
        {
            AlertDialogHelper.DisplayDialog(Activity, "Reset settings to default", "This will reset ALL settings to default values! Are you sure?", () =>
            {
                ProgressDialogHelper.RunTask(Activity, "Resetting settings...", () =>
                {
                    PreferenceHelper.ResetToDefaults();

                    PreferenceScreen = null;
                    SetPreferencesFromResource(Resource.Xml.preferences, _rootKey);
                    //InitializePreferences();
                });
            });
        }
コード例 #21
0
 public NavigationViewMenu(BaseActivityWithNavigationDrawer activity, SharedPreferencesHelper sharedPreferencesHelper)
 {
     this.activity = activity;
     signInService = new SignInService();
     this.bitmapOperationService  = new BitmapOperationService();
     this.progressDialogHelper    = new ProgressDialogHelper(activity);
     this.sharedPreferencesHelper = sharedPreferencesHelper;
     this.gpsService           = GpsLocationService.GetServiceInstance(activity);
     this.googleMapsAPIService = new GoogleMapsAPIService();
     this.categoriesHelper     = new CategoriesSelectingHelper(activity, (string)this.sharedPreferencesHelper.GetSharedPreference <string>(SharedPreferencesKeys.BEARER_TOKEN));
     this.sizeSelectingHelper  = new SizeSelectingHelper(activity);
     this.appSettings          = SharedPreferencesHelper.GetAppSettings(activity);
     SetupViews(activity);
 }
コード例 #22
0
ファイル: AddTimer.xaml.cs プロジェクト: forki/Gallifrey
        public AddTimer(ModelHelpers modelHelpers, string jiraRef = null, DateTime?startDate = null, bool?enableDateChange = null, List <IdleTimer> idleTimers = null, bool?startNow = null)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            if (!modelHelpers.Gallifrey.Settings.InternalSettings.IsPremium && startNow.HasValue && startNow.Value)
            {
                startNow = false;
            }

            DataContext = new AddTimerModel(modelHelpers.Gallifrey, jiraRef, startDate, enableDateChange, idleTimers, startNow);
            AddedTimer  = false;
        }
コード例 #23
0
        public AddTimer(ModelHelpers modelHelpers, string jiraRef = null, DateTime? startDate = null, bool? enableDateChange = null, List<IdleTimer> idleTimers = null, bool? startNow = null)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            if (!modelHelpers.Gallifrey.Settings.InternalSettings.IsPremium && startNow.HasValue && startNow.Value)
            {
                startNow = false;
            }

            DataContext = new AddTimerModel(modelHelpers.Gallifrey, jiraRef, startDate, enableDateChange, idleTimers, startNow);
            AddedTimer = false;
        }
コード例 #24
0
        private void SetupViews()
        {
            this.progress                = new ProgressDialogHelper(this);
            emailInput                   = FindViewById <EditText>(Resource.Id.inputEmailRegistration);
            passwordInput                = FindViewById <EditText>(Resource.Id.inputPasswordRegistration);
            confirmPasswordInput         = FindViewById <EditText>(Resource.Id.inputConfirmPasswordRegistration);
            submitRegistrationBtn        = FindViewById <Button>(Resource.Id.buttonSubmitRegistration);
            submitRegistrationBtn.Click += async(s, e) =>
            {
                submitRegistrationBtn.Enabled = false;
                await SubmitRegistrationBtn_Click(s, e);

                submitRegistrationBtn.Enabled = true;
            };
            SetupAcceptCheckbox();
        }
コード例 #25
0
        private void SetupViews()
        {
            this.CreateAdvertMenuItemClicked = async() =>
            {
                progress.ShowProgressDialog("Wysy³anie ogloszenia. Proszê czekaæ...");
                try
                {
                    await CreateAdvertisement();
                }
                catch { AlertsService.ShowShortToast(this, "Wyst¹pi³ nieoczekiwany b³¹d..."); }
                finally
                {
                    progress.CloseProgressDialog();
                }
            };
            rdBtnOnlyForSell         = (RadioButton)FindViewById(Resource.Id.rdBtnOnlyForSell);
            progress                 = new ProgressDialogHelper(this);
            advertisementTitle       = (EditText)FindViewById(Resource.Id.editTextTitle);
            advertisementDescription = (EditText)FindViewById(Resource.Id.editTextDescription);
            advertisementPrice       = (EditText)FindViewById(Resource.Id.editTextPrice);
            mPhotoView1              = (ImageView)FindViewById(Resource.Id.photoView1);
            mButtonTakePicture1      = (Button)FindViewById(Resource.Id.buttonTakePicture1);
            mButtonTakePicture1.Tag  = 1;
            photoDivider2            = (TextView)FindViewById(Resource.Id.photoView2Divider);
            mPhotoView2              = (ImageView)FindViewById(Resource.Id.photoView2);
            mButtonTakePicture2      = (Button)FindViewById(Resource.Id.buttonTakePicture2); mButtonTakePicture1.Tag = 1;
            mButtonTakePicture2.Tag  = 2;
            photoDivider3            = (TextView)FindViewById(Resource.Id.photoView3Divider);
            mPhotoView3              = (ImageView)FindViewById(Resource.Id.photoView3);
            mButtonTakePicture3      = (Button)FindViewById(Resource.Id.buttonTakePicture3);
            mButtonTakePicture3.Tag  = 3;

            btnChoseCategory        = (ImageView)FindViewById(Resource.Id.btnAddAdvCategoryChosing);
            btnChoseCategory.Click += async(s, e) => await BtnChoseCategory_Click(s, e);

            textViewChodesdCategory        = (TextView)FindViewById(Resource.Id.textViewChosedCategory);
            textViewChodesdCategory.Click += async(s, e) => await BtnChoseCategory_Click(s, e);

            btnChoseSize               = (ImageView)FindViewById(Resource.Id.btnAddSize);
            btnChoseSize.Click        += BtnChoseSize_Click;
            textViewChodesdSize        = (TextView)FindViewById(Resource.Id.textViewSelectedSize);
            textViewChodesdSize.Click += BtnChoseSize_Click;

            mButtonTakePicture1.Click += MButtonTakePicture_Click;
            mButtonTakePicture2.Click += MButtonTakePicture_Click;
            mButtonTakePicture3.Click += MButtonTakePicture_Click;
        }
コード例 #26
0
        private void UpdateNewFunctionFilterEntries()
        {
            var mapper = new TreeViewSchemaFilterMapper();

            mapper.AddTreeView(AddTreeView.TreeViewControl, null);
            var filterEntryBag = mapper.CreateSchemaFilterEntryBag();

            // because we only added the AddTreeView above IncludedSprocEntries is the list of selected
            // sprocs in the Add tab only
            var newFunctionEntries = filterEntryBag.IncludedSprocEntries.ToList();

            // if there are any new Function entries and if the user has selected to create matching Function Imports
            // then create and run a ProgressDialog while we are collecting the sproc return type info
            if (newFunctionEntries.Count > 0 &&
                chkCreateFunctionImports.Checked)
            {
                var result = ProgressDialogHelper.ShowProgressDialog(this, newFunctionEntries, Wizard.ModelBuilderSettings);
            }
        }
コード例 #27
0
        private void SetupViews()
        {
            progress                              = new ProgressDialogHelper(this);
            textViewNoAdverts                     = FindViewById <TextView>(Resource.Id.textViewNoAdverts);
            textViewNoAdverts.Click              += (s, e) => RefreshAdvertisementList(true);
            advertisementsListKindTextView        = FindViewById <TextView>(Resource.Id.advertisementsKindList);
            advertisementsListKindTextView.Click += (s, e) => ShowChoosingAdvertisementsKindDialog();
            advertisementsListKindTextView.Text   = this.advertisementsSearchModel.AdvertisementsKind.GetDisplayName();
            advertisementsRecyclerView            = FindViewById <RecyclerView>(Resource.Id.advertisementsRecyclerView);
            mainListLayout                        = FindViewById <RelativeLayout>(Resource.Id.mainListLayout);
            mainListSwipeLayout                   = FindViewById <SwipeRefreshLayout>(Resource.Id.mainListSwipeLayout);
            mainListSwipeLayout.Refresh          += (s, e) =>
            {
                RefreshAdvertisementList(false);
            };
            var mLayoutManager = new GridLayoutManager(this, 2);

            advertisementsRecyclerView.SetLayoutManager(mLayoutManager);
        }
コード例 #28
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            FacebookSdk.SdkInitialize(this);
            SetFullscreenOptions();
            SetContentView(Resource.Layout.StartActivity);
            progressHelper = new ProgressDialogHelper(this);
            SetupViews();
            var gps = new GpsLocationService(this, this);

            if (!gps.CanGetLocation)
            {
                settingsAlertIsShow = true;
                gps.ShowSettingsAlert();
            }

            try
            {
                userIsLogged = await SignInUser();
            }
            catch (UserHasToSetNickNameException exc)
            {
                logoLayout.Visibility        = ViewStates.Gone;
                setUserNameLayout.Visibility = ViewStates.Visible;
                return;
            }
            catch (Exception exc)
            {
                AlertsService.ShowAlertDialog(this, "Wystąpił problem z połączeniem z serwerem. Spróbuj ponownie później");
                return;
            }

            if (!settingsAlertIsShow)
            {
                StartMainOrLoginActivity(userIsLogged);
            }
            else
            {
                actionToExecuteAfterCloseSettingsDialog = StartMainOrLoginActivity;
            }
        }
コード例 #29
0
        private void UpdateModelBuilderFilterSettings()
        {
            var mapper         = new TreeViewSchemaFilterMapper(databaseObjectTreeView.TreeViewControl);
            var filterEntryBag = mapper.CreateSchemaFilterEntryBag();

            IList <EntityStoreSchemaFilterEntry> newFunctionEntries = new List <EntityStoreSchemaFilterEntry>();

            foreach (var entry in filterEntryBag.IncludedSprocEntries)
            {
                newFunctionEntries.Add(entry);
            }

            // if there are any new Function entries and if the user has selected to create matching Function Imports
            // then create and run a ProgressDialog while we are collecting the sproc return type info
            if (newFunctionEntries.Count > 0 &&
                chkCreateFunctionImports.Checked)
            {
                var result = ProgressDialogHelper.ShowProgressDialog(this, newFunctionEntries, Wizard.ModelBuilderSettings);
            }
        }
コード例 #30
0
ファイル: MainWindow.xaml.cs プロジェクト: forki/Gallifrey
        public MainWindow(InstanceType instance)
        {
            InitializeComponent();

            var gallifrey = new Backend(instance);

            modelHelpers = new ModelHelpers(gallifrey, FlyoutsControl);

            exceptionlessHelper = new ExceptionlessHelper(modelHelpers);
            exceptionlessHelper.RegisterExceptionless();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            var viewModel = new MainViewModel(modelHelpers);

            modelHelpers.RefreshModel();
            modelHelpers.SelectRunningTimer();
            DataContext = viewModel;

            gallifrey.NoActivityEvent   += GallifreyOnNoActivityEvent;
            gallifrey.ExportPromptEvent += GallifreyOnExportPromptEvent;
            SystemEvents.SessionSwitch  += SessionSwitchHandler;

            Height = gallifrey.Settings.UiSettings.Height;
            Width  = gallifrey.Settings.UiSettings.Width;
            ThemeHelper.ChangeTheme(gallifrey.Settings.UiSettings.Theme, gallifrey.Settings.UiSettings.Accent);

            updateHeartbeat          = new Timer(TimeSpan.FromMinutes(1).TotalMilliseconds);
            updateHeartbeat.Elapsed += AutoUpdateCheck;

            idleDetectionHeartbeat          = new Timer(TimeSpan.FromSeconds(30).TotalMilliseconds);
            idleDetectionHeartbeat.Elapsed += IdleDetectionCheck;

            flyoutOpenCheck          = new Timer(100);
            flyoutOpenCheck.Elapsed += FlyoutOpenCheck;
        }
コード例 #31
0
ファイル: MainWindow.xaml.cs プロジェクト: forki/Gallifrey
        private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            await PerformUpdate(UpdateType.StartUp);

            var debuggerMissing   = false;
            var multipleInstances = false;
            var missingConfig     = false;
            var connectionError   = false;
            var noInternet        = false;

            try
            {
                var progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
                var result = await progressDialogHelper.Do(modelHelpers.Gallifrey.Initialise, "Initialising Gallifrey", true, true);

                if (result.Status == ProgressResult.JiraHelperStatus.Cancelled)
                {
                    await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Gallifrey Not Initialised", "Gallifrey Initialisation Was Cancelled, The App Will Now Close");

                    modelHelpers.CloseApp();
                }
            }
            catch (NoInternetConnectionException)
            {
                noInternet = true;
            }
            catch (MissingJiraConfigException)
            {
                missingConfig = true;
            }
            catch (JiraConnectionException)
            {
                connectionError = true;
            }
            catch (MultipleGallifreyRunningException)
            {
                multipleInstances = true;
            }
            catch (DebuggerException)
            {
                debuggerMissing = true;
            }

            if (debuggerMissing)
            {
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Debugger Not Running", "It Looks Like Your Running Without Auto-Update\nPlease Use The Installed Shortcut To Start Gallifrey Or Download Again From GallifreyApp.co.uk");

                modelHelpers.CloseApp();
            }
            else if (multipleInstances)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.MultipleInstancesRunning);
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Multiple Instances", "You Can Only Have One Instance Of Gallifrey Running At A Time\nPlease Close The Other Instance");

                modelHelpers.CloseApp();
            }
            else if (noInternet)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.NoInternet);
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "No Internet Connection ", "Gallifrey Requires An Active Internet Connection To Work.\nPlease Try Again When You Have Internet");

                modelHelpers.CloseApp();
            }
            else if (missingConfig)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.SettingsMissing);
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Welcome To Gallifrey", "You Current Have No Jira Settings In Gallifrey\nWe Therefore Think Your A New User, So Welcome!\n\nTo Get Started, We Need Your Jira Details");

                await NewUserOnBoarding();

                modelHelpers.RefreshModel();
            }
            else if (connectionError)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.ConnectionError);
                var userUpdate = await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Login Failure", "We Were Unable To Authenticate To Jira, Please Confirm Login Details\nWould You Like To Update Your Details?", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AffirmativeButtonText = "Yes", NegativeButtonText = "No" });

                if (userUpdate == MessageDialogResult.Negative)
                {
                    await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Come Back Soon", "Without A Correctly Configured Jira Connection Gallifrey Will Close, Please Come Back Soon!");

                    modelHelpers.CloseApp();
                }

                await UserLoginFailure();
            }

            if (modelHelpers.Gallifrey.VersionControl.IsAutomatedDeploy && modelHelpers.Gallifrey.VersionControl.IsFirstRun)
            {
                var changeLog = modelHelpers.Gallifrey.GetChangeLog(XDocument.Parse(Properties.Resources.ChangeLog)).Where(x => x.NewVersion).ToList();

                if (changeLog.Any())
                {
                    await modelHelpers.OpenFlyout(new Flyouts.ChangeLog(changeLog));
                }
            }

            exceptionlessHelper.RegisterExceptionless();
            updateHeartbeat.Enabled        = true;
            idleDetectionHeartbeat.Enabled = true;
            flyoutOpenCheck.Enabled        = true;
        }
コード例 #32
0
        private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            var debuggerMissing = false;
            var multipleInstances = false;
            var showSettings = false;
            try
            {
                var progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
                var result = await progressDialogHelper.Do(modelHelpers.Gallifrey.Initialise, "Initialising Gallifrey", true, true);
                if (result.Status == ProgressResult.JiraHelperStatus.Cancelled)
                {
                    await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Gallifrey Not Initialised", "Gallifrey Initialisation Was Cancelled, The App Will Now Close");
                    modelHelpers.CloseApp();
                }
            }
            catch (MissingJiraConfigException)
            {
                showSettings = true;
            }
            catch (JiraConnectionException)
            {
                showSettings = true;
            }
            catch (MultipleGallifreyRunningException)
            {
                multipleInstances = true;
            }
            catch (DebuggerException)
            {
                debuggerMissing = true;
            }

            if (debuggerMissing)
            {
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Debugger Not Running", "It Looks Like Your Running Without Auto-Update\nPlease Use The Installed Shortcut To Start Gallifrey Or Download Again From GallifreyApp.co.uk");
                modelHelpers.CloseApp();
            }
            else if (multipleInstances)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.MultipleInstancesRunning);
                await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Multiple Instances", "You Can Only Have One Instance Of Gallifrey Running At A Time\nPlease Close The Other Instance");
                modelHelpers.CloseApp();
            }
            else if (showSettings)
            {
                modelHelpers.Gallifrey.TrackEvent(TrackingType.SettingsMissing);
                await modelHelpers.OpenFlyout(new Flyouts.Settings(modelHelpers));
                if (!modelHelpers.Gallifrey.JiraConnection.IsConnected)
                {
                    await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Connection Required", "You Must Have A Working Jira Connection To Use Gallifrey");
                    modelHelpers.CloseApp();
                }
                modelHelpers.RefreshModel();
            }

            if (modelHelpers.Gallifrey.VersionControl.IsAutomatedDeploy && modelHelpers.Gallifrey.VersionControl.IsFirstRun)
            {
                var changeLog = modelHelpers.Gallifrey.GetChangeLog(XDocument.Parse(Properties.Resources.ChangeLog)).Where(x => x.NewVersion).ToList();

                if (changeLog.Any())
                {
                    await modelHelpers.OpenFlyout(new Flyouts.ChangeLog(changeLog));
                }
            }

            exceptionlessHelper.RegisterExceptionless();
        }