コード例 #1
0
ファイル: App.xaml.cs プロジェクト: StevenHouben/SmartWard
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var window = new MobileApplication();

            var viewModel = new MobileApplicationViewModel();
            // When the ViewModel asks to be closed,

            // close the window.
            EventHandler handler = null;

            handler = delegate
            {
                viewModel.RequestClose -= handler;
                window.Close();
            };
            viewModel.RequestClose += handler;

            // Allow all controls in the window to
            // bind to the ViewModel by setting the
            // DataContext, which propagates down
            // the element tree.
            window.DataContext = viewModel;

            window.Show();
        }
 public static void Initialize(TestContext context)
 {
     mobileApp = new MobileApplication(new AppProperties()
     {
         Apk = "D:\\OneDrive\\AndroidDevelopment\\Apk\\app-release.apk"
     });
     driver = new AndroidDriver <IWebElement>(mobileApp.Server, mobileApp.Capabilities);
     driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1000));
 }
        public static void Initialize(TestContext context)
        {
            mobileApp = new MobileApplication(new AppProperties()
            {
                AppPackage = "com.android2.calculator3", AppActivity = "com.xlythe.calculator.material.Calculator", Apk = "D:\\OneDrive\\AndroidDevelopment\\Apk\\com.android2.calculator3-1.apk"
            });
            mobileApp.SelectDevice();
            //mobileApp.SelectEmulator();

            driver = new AndroidDriver <IWebElement>(mobileApp.Server, mobileApp.Capabilities);
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1000));
        }
コード例 #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (sharedSet_ != null)
            {
                hash ^= SharedSet.GetHashCode();
            }
            if (criterionId_ != null)
            {
                hash ^= CriterionId.GetHashCode();
            }
            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.Keyword)
            {
                hash ^= Keyword.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.YoutubeVideo)
            {
                hash ^= YoutubeVideo.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.YoutubeChannel)
            {
                hash ^= YoutubeChannel.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.Placement)
            {
                hash ^= Placement.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.MobileAppCategory)
            {
                hash ^= MobileAppCategory.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.MobileApplication)
            {
                hash ^= MobileApplication.GetHashCode();
            }
            hash ^= (int)criterionCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (HasSharedSet)
            {
                hash ^= SharedSet.GetHashCode();
            }
            if (HasCriterionId)
            {
                hash ^= CriterionId.GetHashCode();
            }
            if (Type != global::Google.Ads.GoogleAds.V9.Enums.CriterionTypeEnum.Types.CriterionType.Unspecified)
            {
                hash ^= Type.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.Keyword)
            {
                hash ^= Keyword.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.YoutubeVideo)
            {
                hash ^= YoutubeVideo.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.YoutubeChannel)
            {
                hash ^= YoutubeChannel.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.Placement)
            {
                hash ^= Placement.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.MobileAppCategory)
            {
                hash ^= MobileAppCategory.GetHashCode();
            }
            if (criterionCase_ == CriterionOneofCase.MobileApplication)
            {
                hash ^= MobileApplication.GetHashCode();
            }
            hash ^= (int)criterionCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #6
0
 public void OnBackClick()
 {
     new MsgBox.Builder
     {
         id               = ID_QUIT_CONFIRMATION_DIALOG,
         message          = "Нивото няма да бъде запазено.\nСигурен/а ли сте, че искате да излезете.",
         negativeCallback = id =>
         {
             MsgBox.Close();
         },
         negativeButtonText = "Не",
         positiveCallback   = id =>
         {
             MobileApplication.Quit();
         },
         positiveButtonText = "Да",
         style   = MsgBoxStyle.Information,
         buttons = MsgBoxButtons.YES_NO,
         modal   = true
     }
     .Show();
 }
コード例 #7
0
        public void MergeFrom(CustomerNegativeCriterion other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.id_ != null)
            {
                if (id_ == null || other.Id != 0L)
                {
                    Id = other.Id;
                }
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            switch (other.CriterionCase)
            {
            case CriterionOneofCase.ContentLabel:
                if (ContentLabel == null)
                {
                    ContentLabel = new global::Google.Ads.GoogleAds.V2.Common.ContentLabelInfo();
                }
                ContentLabel.MergeFrom(other.ContentLabel);
                break;

            case CriterionOneofCase.MobileApplication:
                if (MobileApplication == null)
                {
                    MobileApplication = new global::Google.Ads.GoogleAds.V2.Common.MobileApplicationInfo();
                }
                MobileApplication.MergeFrom(other.MobileApplication);
                break;

            case CriterionOneofCase.MobileAppCategory:
                if (MobileAppCategory == null)
                {
                    MobileAppCategory = new global::Google.Ads.GoogleAds.V2.Common.MobileAppCategoryInfo();
                }
                MobileAppCategory.MergeFrom(other.MobileAppCategory);
                break;

            case CriterionOneofCase.Placement:
                if (Placement == null)
                {
                    Placement = new global::Google.Ads.GoogleAds.V2.Common.PlacementInfo();
                }
                Placement.MergeFrom(other.Placement);
                break;

            case CriterionOneofCase.YoutubeVideo:
                if (YoutubeVideo == null)
                {
                    YoutubeVideo = new global::Google.Ads.GoogleAds.V2.Common.YouTubeVideoInfo();
                }
                YoutubeVideo.MergeFrom(other.YoutubeVideo);
                break;

            case CriterionOneofCase.YoutubeChannel:
                if (YoutubeChannel == null)
                {
                    YoutubeChannel = new global::Google.Ads.GoogleAds.V2.Common.YouTubeChannelInfo();
                }
                YoutubeChannel.MergeFrom(other.YoutubeChannel);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
コード例 #8
0
        public void MergeFrom(SharedCriterion other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.sharedSet_ != null)
            {
                if (sharedSet_ == null || other.SharedSet != "")
                {
                    SharedSet = other.SharedSet;
                }
            }
            if (other.criterionId_ != null)
            {
                if (criterionId_ == null || other.CriterionId != 0L)
                {
                    CriterionId = other.CriterionId;
                }
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            switch (other.CriterionCase)
            {
            case CriterionOneofCase.Keyword:
                if (Keyword == null)
                {
                    Keyword = new global::Google.Ads.GoogleAds.V2.Common.KeywordInfo();
                }
                Keyword.MergeFrom(other.Keyword);
                break;

            case CriterionOneofCase.YoutubeVideo:
                if (YoutubeVideo == null)
                {
                    YoutubeVideo = new global::Google.Ads.GoogleAds.V2.Common.YouTubeVideoInfo();
                }
                YoutubeVideo.MergeFrom(other.YoutubeVideo);
                break;

            case CriterionOneofCase.YoutubeChannel:
                if (YoutubeChannel == null)
                {
                    YoutubeChannel = new global::Google.Ads.GoogleAds.V2.Common.YouTubeChannelInfo();
                }
                YoutubeChannel.MergeFrom(other.YoutubeChannel);
                break;

            case CriterionOneofCase.Placement:
                if (Placement == null)
                {
                    Placement = new global::Google.Ads.GoogleAds.V2.Common.PlacementInfo();
                }
                Placement.MergeFrom(other.Placement);
                break;

            case CriterionOneofCase.MobileAppCategory:
                if (MobileAppCategory == null)
                {
                    MobileAppCategory = new global::Google.Ads.GoogleAds.V2.Common.MobileAppCategoryInfo();
                }
                MobileAppCategory.MergeFrom(other.MobileAppCategory);
                break;

            case CriterionOneofCase.MobileApplication:
                if (MobileApplication == null)
                {
                    MobileApplication = new global::Google.Ads.GoogleAds.V2.Common.MobileApplicationInfo();
                }
                MobileApplication.MergeFrom(other.MobileApplication);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
コード例 #9
0
 /// <summary>
 /// Subscribes this presenter to the events of its corresponding View
 /// </summary>
 protected override void AttachView()
 {
     View.ViewClose += (sender, e) => MobileApplication.Exit();
 }
コード例 #10
0
 public void OnGameFinish()
 {
     Destroy(Player);
     MobileApplication.Quit(new ResultData(FoundWords.ToArray()));
 }