Exemplo n.º 1
0
        /// <summary>
        /// Get queue email for send email wellcome user
        /// </summary>
        /// <param name="emailTemplate">Template email</param>
        /// <param name="userEmail">Email of user</param>
        /// <param name="userPassowrd">Password of user optional</param>
        /// <param name="userDisplayName">full name of user</param>
        /// <param name="linkCallback">link if have</param>
        /// <returns></returns>
        public virtual QueuedEmail GetQueuedEmailForNewUser(MessageTemplate emailTemplate, string userEmail, string userPassowrd, string userDisplayName, string linkCallback = "")
        {
            GuardClausesParameter.Null(emailTemplate, nameof(emailTemplate));
            GuardClausesParameter.NullOrEmpty(userEmail, nameof(userEmail));
            Dictionary <string, string> replaceValue = new Dictionary <string, string>
            {
                { "[useremail]", userEmail },
                { "[userpassword]", userPassowrd },
                { "[userfullname]", userDisplayName },
                { "[callbacklink]", linkCallback }
            };
            string title   = CoreUtility.ReplaceContentHelper(emailTemplate.Title, replaceValue);
            string content = CoreUtility.ReplaceContentHelper(emailTemplate.Body, replaceValue) + "<br />" + _systemSettings.Common.EmailSignature;

            return(new QueuedEmail()
            {
                To = userEmail,
                Title = title,
                EmailBody = content,
                Cc = null,
                Bcc = null,
                ToName = userDisplayName,
                EmailAccountId = null,
                SendTime = null,
                Priority = 5,
                TrySend = 0
            });
        }
Exemplo n.º 2
0
 public void OnScrollStateChanged(AbsListView listView, ScrollState scrollState)
 {
     CoreUtility.ExecuteMethod("OnScrollStateChanged", delegate()
     {
         if (this.ViewModel != null)
         {
             if (this.ViewModel.HasMoreData)
             {
                 if (listView.LastVisiblePosition >= listView.Count - 1 - this.ViewModel.ScrollThresholdCount)
                 {
                     Container.Track.LogTrace("Getting more data");
                     this.ViewModel.DoGetMoreData(); // it has its own built-in skip mechanism
                 }
             }
             int topRowVerticalPosition = 0;
             if (this.ListView != null && this.ListView.ChildCount > 0)
             {
                 topRowVerticalPosition = this.ListView.GetChildAt(0).Top;
             }
             if (this.RefreshLayout != null)
             {
                 this.RefreshLayout.Enabled = (topRowVerticalPosition >= 0);
             }
         }
     });
 }
Exemplo n.º 3
0
        /// <summary>
        /// Hàm xóa ảnh được upload lên
        /// </summary>
        /// <param name="imageFileName">Tên file ảnh cần xóa</param>
        public async Task DeleteImageFileAsync(string imageFileName)
        {
            if (!string.IsNullOrWhiteSpace(imageFileName))
            {
                List <string> listDeletePath = new List <string>();
                string        uploadPath     = _systemSettings.Upload.UploadImgPath;

                if (!string.IsNullOrEmpty(_systemSettings.Upload.ImgResizeList))
                {
                    foreach (string item in _systemSettings.Upload.ImgResizeList.Split(','))
                    {
                        string[] imgSize = item.Split('*');
                        if (imgSize.Length <= 1)
                        {
                            listDeletePath.Add(uploadPath + "\\" + imgSize[0] + "." + imageFileName.Replace('/', '\\'));
                        }
                        else
                        {
                            listDeletePath.Add(uploadPath + "\\" + imgSize[0] + "." + imgSize[1] + "." + imageFileName.Replace('/', '\\'));
                        }
                    }
                }

                listDeletePath.Add(uploadPath + "\\" + imageFileName.Replace('/', '\\'));

                foreach (string item in listDeletePath)
                {
                    await Task.Run(() =>
                    {
                        CoreUtility.DeleteFile(item);
                    });
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Called when user clicks on the add-in menu
        /// </summary>
        /// <param name="e">The context of the VS tools and metadata</param>
        public override void OnClick(AddinEventArgs e)
        {
            try
            {
                DadJoke           joke  = DadJoke.construct(Request.dadJoke());
                MotivationalQuote quote = MotivationalQuote.construct(Request.motivationalQuote());

                string message = string.Empty;

                if (joke.Id != null)
                {
                    //message += string.Format("Dad joke:\n{0}", joke.Joke);
                    message += joke.Joke;
                }

                //if (quote.Id != 0)
                //{
                //    message += "\n\n";
                //    message += string.Format("Motivational quote:\n{0}{1}", HttpUtility.HtmlDecode(quote.Content), quote.Title.ToUpper());
                //}

                CoreUtility.DisplayInfo(message);
            }
            catch (Exception ex)
            {
                CoreUtility.HandleExceptionWithErrorMessage(ex);
            }
        }
        public void ScanningOurselvesShouldReturnResults()
        {
            var repoRootPath = CoreUtility.FindRepositoryRoot(IntegrationTestHelper.GetIntegrationTestRootDirectory());
            var router       = new RoutingState();
            var kernel       = new NSubstituteMockingKernel();

            var fixture = setupStandardFixture(router, kernel, () => kernel.Bind <IRepoAnalysisProvider>().To <RepoAnalysisProvider>());

            fixture.AnalyzeRepo.Execute(repoRootPath);
            fixture.AnalyzeRepo.ItemsInflight.Where(x => x == 0).First();

            fixture.BranchInformation.ShouldNotBeNull();
            fixture.CurrentRepoPath.ShouldEqual(repoRootPath);

            this.Log().Info(JsonConvert.SerializeObject(fixture.BranchInformation, Formatting.Indented));

            // We should have both the WD and the branches
            fixture.BranchInformation.Any(x => x.BranchName.ToLowerInvariant().Contains("working")).ShouldBeTrue();
            fixture.BranchInformation.Any(x => x.BranchName.ToLowerInvariant().Contains("master")).ShouldBeTrue();

            // We should have examined some files
            fixture.BranchInformation.All(x => x.BadEncodingInfoHeader != null).ShouldBeTrue();
            fixture.BranchInformation.All(x => x.BadEndingsInfoHeader != null).ShouldBeTrue();
            fixture.BranchInformation.All(x => x.Model.TotalFilesExamined > 0).ShouldBeTrue();

            // .gitignored files shouldn't show up
            var working = fixture.BranchInformation.First(x => x.BranchName == Constants.WorkingDirectory);

            working.Model.BadLineEndingFiles.Any(x => x.Key.ToLowerInvariant().Contains("_resharper")).ShouldBeFalse();
        }
Exemplo n.º 6
0
 protected override void RefreshBrowsableFields()
 {
     base.RefreshBrowsableFields();
     CoreUtility.SetBrowsable(this, nameof(TargetMode), ((Dynamics365Field)DestinationField)?.Targets?.Length > 1);
     CoreUtility.SetBrowsable(this, nameof(TargetEntity), ((Dynamics365Field)DestinationField)?.Targets?.Length > 1 && targetMode == TargetMode.Fixed);
     CoreUtility.SetBrowsable(this, nameof(TargetEntityField), ((Dynamics365Field)DestinationField)?.Targets?.Length > 1 && targetMode == TargetMode.Variable);
 }
Exemplo n.º 7
0
        public virtual T DequeueReusableCustomView <T>(UITableView tableView, string identifier)
            where T : UIView, new()
        {
            return(CoreUtility.ExecuteFunction("DequeueReusableCustomView", delegate()
            {
                T result = null;
                if (!this.CachedCustomViews.ContainsKey(identifier))
                {
                    this.CachedCustomViews[identifier] = new List <UIView>();
                }
                result = (T)this.CachedCustomViews[identifier].FirstOrDefault(x => x.Superview == null);
                if (tableView != null && result == null)
                {
                    result = (T)(object)tableView.DequeueReusableCell(identifier);

                    if (result != null)
                    {
                        this.CachedCustomViews[identifier].Add(result);
                    }
                }
                if (result == null)
                {
                    result = new T();
                    if (result != null)
                    {
                        this.CachedCustomViews[identifier].Add(result);
                    }
                }

                return result;
            }));
        }
Exemplo n.º 8
0
        public void run()
        {
            AxClass axClass = MetadataProvider.Classes.Read(classItem.Name);

            bool allMethodsDocumented = true; // Please do not disappoint me! :)

            foreach (AxMethod method in axClass.Methods)
            {
                IContent tagContent = null;
                string   devDoc     = string.Empty;

                if (!method.Source.Contains("<summary>"))
                {
                    tagContent = new SummaryTag(method);
                    tagContent = new ParamTag(tagContent, method);
                    tagContent = new ExceptionTag(tagContent, method);
                    tagContent = new ReturnsTag(tagContent, method);
                    tagContent = new RemarksTag(tagContent, method);

                    method.Source = method.Source.Insert(0, $"{tagContent.getContent()}\n");

                    allMethodsDocumented = false; // Shame on you! :(
                }
            }

            if (allMethodsDocumented)
            {
                CoreUtility.DisplayInfo("All your methods are documented already! I've transfered $500,00 to your bank account as reward!");
            }
            else
            {
                this.MetaModelService.UpdateClass(axClass, this.ModelSaveInfo);
            }
        }
Exemplo n.º 9
0
        public virtual ResourceType GetMediaType(string resourcePath)
        {
            GuardClausesParameter.NullOrEmpty(resourcePath, nameof(resourcePath));
            string fileExtentson = CoreUtility.GetFileExtension(resourcePath, false);

            if (!string.IsNullOrEmpty(fileExtentson))
            {
                if (!string.IsNullOrEmpty(_systemSettings.Upload.ImageAllowedExtensions) && _systemSettings.Upload.ImageAllowedExtensions.Split(',', ';').Contains(fileExtentson, StringComparer.OrdinalIgnoreCase))
                {
                    return(ResourceType.Image);
                }

                if (!string.IsNullOrEmpty(_systemSettings.Upload.VideoAllowedExtensions) && _systemSettings.Upload.VideoAllowedExtensions.Split(',', ';').Contains(fileExtentson, StringComparer.OrdinalIgnoreCase))
                {
                    return(ResourceType.Movie);
                }

                if (!string.IsNullOrEmpty(_systemSettings.Upload.AudioAllowedExtensions) && _systemSettings.Upload.AudioAllowedExtensions.Split(',', ';').Contains(fileExtentson, StringComparer.OrdinalIgnoreCase))
                {
                    return(ResourceType.Audio);
                }

                if (!string.IsNullOrEmpty(_systemSettings.Upload.FileAllowedExtensions) && _systemSettings.Upload.FileAllowedExtensions.Split(',', ';').Contains(fileExtentson, StringComparer.OrdinalIgnoreCase))
                {
                    return(ResourceType.None);
                }
            }
            return(ResourceType.None);
        }
        /// <summary>
        /// Called when user clicks on the add-in menu
        /// </summary>
        /// <param name="e">The context of the VS tools and metadata</param>
        public override void OnClick(AddinDesignerEventArgs e)
        {
            try
            {
                StringBuilder messages = new StringBuilder();

                // Get the selected element as a base type "NamedElement". Maybe you don't need to know the specific
                // type, because you just want to dump element names, for example. You still can check the type later
                // and run any type-specific logic.
                NamedElement namedElement = e.SelectedElement as NamedElement;
                if (namedElement != null)
                {
                    messages.AppendLine($"You selected {namedElement.GetType().Name} named {namedElement.Name}.");
                }

                // If you're looking for a specific type, try to cast the selected item directly to the type.
                ClassItem c = e.SelectedElement as ClassItem;
                if (c != null)
                {
                    int methodCount = c.Methods.Cast <IMethod>().Count(); // Calculating number of methods
                    messages.AppendLine($"The class has {methodCount} method(s).");
                }

                // Show messages in a dialog box.
                CoreUtility.DisplayInfo(messages.ToString());
            }
            catch (Exception ex)
            {
                CoreUtility.HandleExceptionWithErrorMessage(ex);
            }
        }
Exemplo n.º 11
0
        public override Java.Lang.Object Evaluate(float fraction, Java.Lang.Object startValue, Java.Lang.Object endValue)
        {
            return(CoreUtility.ExecuteFunction <Java.Lang.Object>("Evaluate", delegate()
            {
                Java.Lang.Object result;

                int startInt = Convert.ToInt32(startValue);
                int startA = (startInt >> 24) & 0xff;
                int startR = (startInt >> 16) & 0xff;
                int startG = (startInt >> 8) & 0xff;
                int startB = startInt & 0xff;

                int endInt = Convert.ToInt32(endValue);
                int endA = (endInt >> 24) & 0xff;
                int endR = (endInt >> 16) & 0xff;
                int endG = (endInt >> 8) & 0xff;
                int endB = endInt & 0xff;

                result = ((startA + (int)(fraction * (endA - startA))) << 24) |
                         ((startR + (int)(fraction * (endR - startR))) << 16) |
                         ((startG + (int)(fraction * (endG - startG))) << 8) |
                         ((startB + (int)(fraction * (endB - startB))));

                return result;
            }));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Called when user clicks on the add-in menu
        /// </summary>
        /// <param name="e">The context of the VS tools and metadata</param>
        public override void OnClick(AddinDesignerEventArgs e)
        {
            //Microsoft.Dynamics.AX.Metadata.Core.MetaModel.EntryPointType entryPointType;
            try
            {
                var selectedItem = e.SelectedElement as INamedElement;
                if (selectedItem != null)
                {
                    //var metadataType = selectedItem.GetMetadataType();

                    EdtLabelInfo edtLabelInfo = new EdtLabelInfo();

                    if (selectedItem is IEdtBase)
                    {
                        var axEdt = Common.CommonUtil.GetModelSaveService().GetExtendedDataType(selectedItem.Name);
                        edtLabelInfo = this.getEdtBaseLabel(axEdt, edtLabelInfo);
                    }
                    else if (selectedItem is BaseField)
                    {
                        var axBaseField = selectedItem as BaseField;
                        edtLabelInfo = this.getTableFieldLabel(axBaseField, edtLabelInfo);
                    }


                    edtLabelInfo.DecypherLabels();
                    System.Windows.Forms.MessageBox.Show("Label: " + edtLabelInfo.Label + Environment.NewLine + "Help: " + edtLabelInfo.HelpLabel);
                }
            }
            catch (Exception ex)
            {
                CoreUtility.HandleExceptionWithErrorMessage(ex);
            }
        }
Exemplo n.º 13
0
        public virtual bool SendSMS(string message)
        {
            return(CoreUtility.ExecuteFunction("SendSMS", delegate()
            {
                if (MFMessageComposeViewController.CanSendText)
                {
                    this.SMSController = new MFMessageComposeViewController();

                    this.SMSController.Body = message;
                    this.SMSController.Finished += SMSController_Finished;
                    if (this.NavigationController != null)
                    {
                        this.NavigationController.PresentViewController(this.SMSController, true, null);
                    }
                    else
                    {
                        this.PresentViewController(this.SMSController, true, null);
                    }
                    return true;
                }
                else
                {
                    return false;
                }
            }));
        }
Exemplo n.º 14
0
        public virtual bool SendEmail(string subject, string message)
        {
            return(CoreUtility.ExecuteFunction("SendEmail", delegate()
            {
                if (MFMailComposeViewController.CanSendMail)
                {
                    this.MailController = new MFMailComposeViewController();

                    this.MailController.SetSubject(subject);
                    this.MailController.SetMessageBody(message, false);

                    this.MailController.Finished += MailController_Finished;
                    if (this.NavigationController != null)
                    {
                        this.NavigationController.PresentViewController(this.MailController, true, null);
                    }
                    else
                    {
                        this.PresentViewController(this.MailController, true, null);
                    }
                    return true;
                }
                else
                {
                    return false;
                }
            }));
        }
Exemplo n.º 15
0
        public override void OnMessageReceived(RemoteMessage message)
        {
            CoreUtility.ExecuteMethod("OnMessageReceived", delegate()
            {
                // Shape like previous version of GCM for ease
                Bundle messageIntent = new Bundle();
                if (message.Data != null)
                {
                    foreach (string key in message.Data.Keys)
                    {
                        messageIntent.PutString(key, message.Data[key]);
                    }
                }

                PushNotification notification = PushNotificationProcessor.ExtractPushNotification(messageIntent);
                if (notification != null)
                {
                    notification.Alert += "!";
                    v7.NotificationCompat.Builder builder = PushNotificationProcessor.GenerateNotification(this, notification, messageIntent);
                    if (builder != null)
                    {
                        int uniqueID = (int)DateTime.UtcNow.ToUnixSeconds(); // will work until 2038
                        NotificationManager notificationManager = (NotificationManager)GetSystemService(Context.NotificationService);
                        notificationManager.Notify(uniqueID, builder.Build());
                    }
                }
            });
        }
Exemplo n.º 16
0
 /// <summary>
 /// Pushes to current root nav controller, presents if one was not found.
 /// </summary>
 public static bool PushToRootNavigationController(this IViewPlatform platform, UIViewController controller, bool animated)
 {
     return(CoreUtility.ExecuteFunction("PushToRootNavigationController", delegate()
     {
         UINavigationController navController = platform.GetRootNavigationController();
         if (navController != null)
         {
             navController.PushViewController(controller, animated);
             return true;
         }
         else
         {
             BaseUIViewController rootBaseController = platform.GetRootViewController() as BaseUIViewController;
             if (rootBaseController != null)
             {
                 rootBaseController.PresentViewControllerWithDisposeOnReturn(controller, animated, null);
                 return true;
             }
             UIViewController rootController = platform.GetRootViewController();
             if (rootController != null)
             {
                 rootController.PresentViewController(controller, animated, null);
                 return true;
             }
         }
         return false;
     }));
 }
Exemplo n.º 17
0
 /// <summary>
 ///     Called when user clicks on the add-in menu
 /// </summary>
 /// <param name="e">The context of the VS tools and metadata</param>
 public override void OnClick(AddinDesignerEventArgs e)
 {
     try
     {
         if (e.SelectedElement is IForm)
         {
             var form = e.SelectedElement as IForm;
             AotElementCreate.CreateMenuItem(Dynamics.AX.Application.UtilElementType.DisplayTool,
                                             form.Name, form.FormDesign.Caption);
         }
         if (e.SelectedElement is ClassItem)
         {
             AotElementCreate.CreateMenuItem(Dynamics.AX.Application.UtilElementType.ActionTool,
                                             (e.SelectedElement as ClassItem).Name);
         }
         if (e.SelectedElement is IReport)
         {
             AotElementCreate.CreateMenuItem(Dynamics.AX.Application.UtilElementType.OutputTool,
                                             (e.SelectedElement as IReport).Name);
         }
     }
     catch (Exception ex)
     {
         CoreUtility.HandleExceptionWithErrorMessage(ex);
     }
 }
Exemplo n.º 18
0
        public static void AddUrlsForText(this NSMutableAttributedString attributedString, UIFont font, UIColor linkColor, string allText, string linkText, string destinationUrl)
        {
            CoreUtility.ExecuteMethod("AddUrlsForText", delegate()
            {
                int ix = allText.IndexOf(linkText, StringComparison.OrdinalIgnoreCase);
                while (ix >= 0)
                {
                    NSRange foundRange = new NSRange(ix, linkText.Length);

                    if (foundRange.Location >= 0)
                    {
                        attributedString.SetAttributes(new UIStringAttributes()
                        {
                            Font            = font,
                            ForegroundColor = linkColor
                        }, foundRange);

                        attributedString.AddAttribute(new NSString("handle"), new NSString(destinationUrl), foundRange);
                    }
                    int nextIX = allText.Substring(ix + linkText.Length).IndexOf(linkText, StringComparison.OrdinalIgnoreCase);
                    if (nextIX >= 0)
                    {
                        ix = ix + linkText.Length + nextIX;
                    }
                    else
                    {
                        ix = -1;
                    }
                }
            });
        }
Exemplo n.º 19
0
 public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     CoreUtility.ExecuteMethod("RowSelected", delegate()
     {
         UITableViewCell cell = tableView.CellAt(indexPath);
         if (this.OnSelectedMethodRaw != null)
         {
             if (!this.DisableRowDeselection)
             {
                 tableView.DeselectRow(indexPath, true); // iOS convention is to remove the highlight
             }
             if (this.OnSelectedMethodRaw != null)
             {
                 this.OnSelectedMethodRaw(indexPath, cell);
             }
         }
         else
         {
             TItem info = this.GetItem(indexPath.Row);
             if (!this.DisableRowDeselection)
             {
                 tableView.DeselectRow(indexPath, true); // iOS convention is to remove the highlight
             }
             if (this.OnSelectedMethod != null)
             {
                 this.OnSelectedMethod(info, cell);
             }
         }
     });
 }
Exemplo n.º 20
0
 private void RefreshBrowsableFields()
 {
     CoreUtility.SetBrowsable(this, nameof(OwnerType), Mode == AssignMode.Fixed);
     CoreUtility.SetBrowsable(this, nameof(Team), Mode == AssignMode.Fixed && OwnerType == OwnerType.Team);
     CoreUtility.SetBrowsable(this, nameof(User), Mode == AssignMode.Fixed && OwnerType == OwnerType.User);
     CoreUtility.SetBrowsable(this, nameof(Owner), Mode == AssignMode.Variable);
 }
Exemplo n.º 21
0
 public void DisplayLog()
 {
     if (!String.IsNullOrWhiteSpace(_logString))
     {
         CoreUtility.DisplayInfo($"The following element(s)({_logString}) created and added to the project");
     }
 }
Exemplo n.º 22
0
    void SetActive(bool isActive)
    {
        if (CharacterAsset == null)
        {
            return;
        }

        if (isActive == true)
        {
            Character character = CharacterAsset.Alloc();
            CoreUtility.SetRecursiveLayer(character.gameObject, "Character");
            character.transform.SetParent(transform, false);
            character.transform.localPosition = Vector3.zero;
            character.IsPause = false;

            character.CharacterAnimation.SetBattleMode();
            character.SetUIMode(false);
            character.CharacterAnimation.SetRenderQueue(2999);
        }
        else if (CharacterAsset != null && CharacterAsset.Asset != null)
        {
            //m_PlaybackTime = Character.PlaybackTime;
            Character.Reset();
            CharacterAsset.Asset.Creature = null;
            CharacterAsset.Free();
        }
    }
Exemplo n.º 23
0
        /// <summary>
        /// Called when user clicks on the add-in menu
        /// </summary>
        /// <param name="e">The context of the VS tools and metadata</param>
        public override void OnClick(AddinEventArgs e)
        {
            try
            {
                // TODO: Do your magic for your add-in
                DirectoryInfo dirInfo = Directory.GetParent(this.Configuration.SSRSReportingLocation);

                string logPath = Path.Combine(dirInfo.FullName, "LogFiles");

                if (Directory.Exists(logPath))
                {
                    DirectoryInfo dirInfoLogs = new DirectoryInfo(logPath);

                    var latestFile = dirInfoLogs.GetFiles()
                                     .OrderByDescending(f => f.LastWriteTime)
                                     .Where(f => f.Name.StartsWith("ReportServerService__"))
                                     .First();
                    if (latestFile != null)
                    {
                        Process.Start(latestFile.FullName);
                    }
                }
            }
            catch (Exception ex)
            {
                CoreUtility.HandleExceptionWithErrorMessage(ex);
            }
        }
Exemplo n.º 24
0
 public override void DidRegisterUserNotificationSettings(UIApplication application, UIUserNotificationSettings notificationSettings)
 {
     CoreUtility.ExecuteMethod("DidRegisterUserNotificationSettings", delegate()
     {
         application.RegisterForRemoteNotifications(); // second part, first from viewplatform
     });
 }
Exemplo n.º 25
0
    public void OnRelease()
    {
        if (m_DragLayout != null)
        {
            TargetInfo target = CurrentInfo.Targets.Find(e => e.type == eTutorialType.Drag);
            Vector3    pos    = CoreUtility.WorldPositionToUIPosition(UICamera.lastWorldPosition);
//            Debug.Log(pos);

            if (DungeonInfoMenu.IsRectContainsPoint(target.pos, target.size, pos) == true)
            {
                m_DragLayout.ProcessRelease();
                while (m_Prefabs.Count > 0)
                {
                    Destroy(m_Prefabs[0]);
                    m_Prefabs.RemoveAt(0);
                }
                m_DragLayout = null;
                SetNextTutorial();
            }
            else
            {
                m_DragLayout.DragContainer = null;
                //m_DragLayout.Rebatch();
                m_DragLayout.Init(TeamDataManager.Instance.GetTeam(pe_Team.Main));
                m_DragLayout.ProcessRelease();
                m_DragLayout = null;

                //TweenPosition tween = m_Prefabs[0].GetComponent<TweenPosition>();
                //tween.enabled = false;
                //Vector3 indicator_pos = m_Prefabs[0].transform.localPosition;
                //m_Prefabs[0].transform.localPosition = tween.from;
            }
        }
    }
Exemplo n.º 26
0
 protected virtual void InitializeEnvironment()
 {
     CoreUtility.ExecuteMethod("InitializeEnvironment", delegate()
     {
         //TODO:COULD: Any 3rd party bootstrap-like settings
     });
 }
Exemplo n.º 27
0
 public override nint GetComponentCount(UIPickerView picker)
 {
     return(CoreUtility.ExecuteFunction <int> ("GetComponentCount", delegate()
     {
         return 1;
     }));
 }
Exemplo n.º 28
0
        public static UIImage CreateMaskedImage(string maskImageBundleName, UIColor backgroundColor)
        {
            return(CoreUtility.ExecuteFunction("CreateMaskedImage", delegate()
            {
                UIImage image = UIImage.FromBundle(maskImageBundleName);
                UIGraphics.BeginImageContextWithOptions(image.Size, false, image.CurrentScale);
                CGRect target = new CGRect(new CGPoint(0, 0), image.Size);
                var context = UIGraphics.GetCurrentContext();

                //flips drawing context
                context.TranslateCTM(0f, image.Size.Height);
                context.ScaleCTM(1f, -1f);//flip context

                image.Draw(target);
                context.ClipToMask(target, image.CGImage);
                context.SetBlendMode(CGBlendMode.Normal);
                backgroundColor.SetFill();
                context.FillRect(target);

                image = UIGraphics.GetImageFromCurrentImageContext();
                UIGraphics.EndImageContext();

                return image;
            }));
        }
        /// <summary>
        /// Called when user clicks on the add-in menu
        /// </summary>
        /// <param name="e">The context of the VS tools and metadata</param>
        public override void OnClick(AddinDesignerEventArgs e)
        {
            Microsoft.Dynamics.AX.Metadata.Core.MetaModel.EntryPointType entryPointType;
            try
            {
                // we will create 2 security privileges for the menu item with the same name + Maintain,  +View
                var selectedMenuItem = e.SelectedElement as ITable;
                if (selectedMenuItem != null)
                {
                    var metadataType = selectedMenuItem.GetMetadataType();

                    if (selectedMenuItem is ITable)
                    {
                        ITable axForm = selectedMenuItem as ITable;

                        this.createForm(axForm);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                CoreUtility.HandleExceptionWithErrorMessage(ex);
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// Get queue email for send email to revovery user passowrd
        /// </summary>
        /// <param name="emailTemplate">Template email</param>
        /// <param name="userEmail">active email user</param>
        /// <param name="webSiteName">system name</param>
        /// <param name="userDisplayName">User full name</param>
        /// <param name="recoveryLink">recovery link</param>
        public virtual QueuedEmail UserPasswordRecovery(MessageTemplate emailTemplate, string userEmail, string webSiteName, string userDisplayName, string recoveryLink)
        {
            GuardClausesParameter.Null(emailTemplate, nameof(emailTemplate));
            GuardClausesParameter.NullOrEmpty(userEmail, nameof(userEmail));
            GuardClausesParameter.NullOrEmpty(recoveryLink, nameof(recoveryLink));
            Dictionary <string, string> replaceValue = new Dictionary <string, string>
            {
                { "[systemname]", webSiteName },
                { "[userfullname]", userDisplayName },
                { "[recoverylink]", recoveryLink }
            };
            string title   = CoreUtility.ReplaceContentHelper(emailTemplate.Title, replaceValue);
            string content = CoreUtility.ReplaceContentHelper(emailTemplate.Body, replaceValue) + "<br />" + _systemSettings.Common.EmailSignature;

            return(new QueuedEmail()
            {
                To = userEmail,
                Title = title,
                EmailBody = content,
                Cc = null,
                Bcc = null,
                ToName = userDisplayName,
                EmailAccountId = null,
                SendTime = null,
                Priority = 5,
                TrySend = 0
            });
        }