public Activity this[ActivityName state]
 {
     get
     {
         return(activities[(int)state]);
     }
 }
Example #2
0
    public void SetHighlightWith(ActivityName name)
    {
        switch (name)
        {
        case ActivityName.Home:
            transform.parent.FindChild("Home").FindChild("Label").GetComponent <UILabel>().color   = COLOR_SELECTED;
            transform.parent.FindChild("Home").FindChild("Sprite").GetComponent <UISprite>().color = COLOR_SELECTED;
            break;

        case ActivityName.MatchInfo:
            transform.parent.FindChild("Ball").FindChild("Label").GetComponent <UILabel>().color   = COLOR_SELECTED;
            transform.parent.FindChild("Ball").FindChild("Sprite").GetComponent <UISprite>().color = COLOR_SELECTED;
            break;

        case ActivityName.Store:
            transform.parent.FindChild("Challenge").FindChild("Label").GetComponent <UILabel>().color   = COLOR_SELECTED;
            transform.parent.FindChild("Challenge").FindChild("Sprite").GetComponent <UISprite>().color = COLOR_SELECTED;
            break;

        case ActivityName.Post:
            transform.parent.FindChild("BtnPost").FindChild("Label").GetComponent <UILabel>().color       = COLOR_SELECTED;
            transform.parent.FindChild("BtnPost").FindChild("Background").GetComponent <UISprite>().color = COLOR_SELECTED;
            break;

        case ActivityName.Menu:
            transform.parent.FindChild("---").FindChild("Label").GetComponent <UILabel>().color   = COLOR_SELECTED;
            transform.parent.FindChild("---").FindChild("Sprite").GetComponent <UISprite>().color = COLOR_SELECTED;
            break;
        }
    }
 /// <summary>
 /// Initialize the fields
 /// </summary>
 /// <param name="xml"></param>
 public void Initialise(XElement xml)
 {
     if (!ActivityName.IsNullOrEmpty())
     {
         CreateServerActivity(xml);
     }
 }
Example #4
0
 private void SetControlStatus(Control c, string names)
 {
     if (names.Split('|').ToList().Contains(ActivityName.ToLower()) || names == "*")
     {
         if (CurrentType == ProcessType.EA)
         {
             ((WebControl)c).Enabled = true;
         }
         if (CurrentType == ProcessType.VA)
         {
             ((WebControl)c).Visible = true;
         }
     }
     else
     {
         if (CurrentType == ProcessType.EA)
         {
             ((WebControl)c).Enabled = false;
         }
         if (CurrentType == ProcessType.VA)
         {
             ((WebControl)c).Visible = false;
         }
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (ActivityDescription != null)
            {
                ActivityDescription.Dispose();
                ActivityDescription = null;
            }

            if (ActivityImage != null)
            {
                ActivityImage.Dispose();
                ActivityImage = null;
            }

            if (ActivityName != null)
            {
                ActivityName.Dispose();
                ActivityName = null;
            }

            if (EditMetaButton != null)
            {
                EditMetaButton.Dispose();
                EditMetaButton = null;
            }

            if (FooterButton != null)
            {
                FooterButton.Dispose();
                FooterButton = null;
            }
        }
 public PerformanceEntity ActiityChange(ActivityName activityName)
 {
     WorkingActivity.GetInstance().StopTime = DateTime.Now;
     SetPerformance();
     WorkingActivity.GetInstance().StartTime    = _performance.EndTime;
     WorkingActivity.GetInstance().ActivityName = activityName;
     return(_performance);
 }
Example #7
0
 /// <summary>
 /// Function called to search the model for availability of the specified string.
 /// </summary>
 /// <param name="str">The search string</param>
 /// <returns>True, if the string is contained in the model, else false</returns>
 public override bool Contains(string str)
 {
     return((ContractNumber != null && ContractNumber.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (InvoiceCustomer != null && InvoiceCustomer.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (CompanyName != null && CompanyName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (DivisionName != null && DivisionName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (ActivityName != null && ActivityName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (!string.IsNullOrEmpty(Convert.ToString(InvoiceDate)) && InvoiceDate.ToString(Constants.DATE_FORMAT).Contains(str)) ||
            (!string.IsNullOrEmpty(Convert.ToString(Amount)) && Convert.ToString(Amount).StartsWith(str, StringComparison.CurrentCultureIgnoreCase)));
 }
Example #8
0
        private void UpdateActivityDisplay()
        {
            if (GamestateManager.Instance?.Player?.CurrentRegion?.Activity?.ProgressText != null)
            {
                ActivityName.SetText("Current objective: " + GamestateManager.Instance.Player.CurrentRegion.Activity.Name);

                ActivityText.SetText(GamestateManager.Instance.Player.CurrentRegion.Activity.ProgressText ?? "");
            }
            else
            {
                ActivityName.SetText("No current objective.");
                ActivityText.SetText("");
            }
        }
        private void FindActivity()
        {
            ActivityName = "Neznáma";


            CleaningDetection cleaningDetection = new CleaningDetection();
            Boolean           cleaning          = cleaningDetection.DetectCleaning(_context, StartdateTime, StopdateTime, _roomStatistics.Sekvencie.Count, tepListConst, teplotaListConst);

            if (cleaning)
            {
                ActivityName = "Pohyb";
            }

            SleepDetection sleepDetection = new SleepDetection();
            Boolean        sleep          = sleepDetection.DetectSleep(_context, _roomStatistics.RoomName, StartdateTime, StopdateTime, _roomStatistics.Sekvencie.Count, tepListConst);

            if (sleep)
            {
                ActivityName = "Spánok";
            }

            CookDetection cookDetection = new CookDetection();
            Boolean       cook          = cookDetection.DetectCooking(_context, _roomStatistics.RoomName, StartdateTime, StopdateTime, _roomStatistics.Sekvencie.Count, tepListConst, teplotaListConst);

            if (cook)
            {
                ActivityName = "Pohyb";
            }

            OutsideRestDetection outsideRestDetection = new OutsideRestDetection();
            Boolean outside = outsideRestDetection.DetectOutsideRest(_context, _roomStatistics.RoomName, StartdateTime, StopdateTime, _roomStatistics.Sekvencie.Count, tepListConst, teplotaListConst);

            if (outside)
            {
                ActivityName = "Oddych";
            }
            RestDetection restDetection = new RestDetection();
            Boolean       rest          = restDetection.DetectRest(_context, _roomStatistics.RoomName, StartdateTime, StopdateTime, _roomStatistics.Sekvencie.Count, tepListConst);

            if (rest)
            {
                ActivityName = "Oddych";
            }

            if (fallList.Any() && !ActivityName.Equals("Pohyb"))
            {
                ActivityName = "Neznáma";
            }
            System.Diagnostics.Debug.WriteLine("************ ACTIVITY sleep: " + sleep.ToString() + " cook: " + cook);
        }
Example #10
0
        static void Main(string[] args)
        {
            int    userInput = 1;
            string ProjectName, ActivityName, UserInput;

            Console.WriteLine("Welcome to URLEncoder");

            while (userInput == 1)
            {
                Console.WriteLine("Please input the project name: ");
                ProjectName = Console.ReadLine();

                while (ProjectName.Contains("NUL") || ProjectName.Contains("SOH") || ProjectName.Contains("STX") || ProjectName.Contains("ETX") || ProjectName.Contains("EOT") || ProjectName.Contains("ENQ") || ProjectName.Contains("ACK") || ProjectName.Contains("BEL") || ProjectName.Contains("BS") || ProjectName.Contains("HT") || ProjectName.Contains("LF") || ProjectName.Contains("VT") || ProjectName.Contains("FF") || ProjectName.Contains("CR") || ProjectName.Contains("SO") || ProjectName.Contains("SI") || ProjectName.Contains("DLE") || ProjectName.Contains("DC1") || ProjectName.Contains("DC2") || ProjectName.Contains("DC3") || ProjectName.Contains("DC4") || ProjectName.Contains("NAK") || ProjectName.Contains("SYN") || ProjectName.Contains("ETB") || ProjectName.Contains("CAN") || ProjectName.Contains("EM") || ProjectName.Contains("SUB") || ProjectName.Contains("ESC") || ProjectName.Contains("FS") || ProjectName.Contains("GS") || ProjectName.Contains("RS") || ProjectName.Contains("US"))
                {
                    Console.WriteLine("That input is invalid beause it contains a control character. Please input a new project name: ");
                    ProjectName = Console.ReadLine();
                }

                Console.WriteLine("Please input the activity name: ");
                ActivityName = Console.ReadLine();

                while (ActivityName.Contains("NUL") || ActivityName.Contains("SOH") || ActivityName.Contains("STX") || ActivityName.Contains("ETX") || ActivityName.Contains("EOT") || ActivityName.Contains("ENQ") || ActivityName.Contains("ACK") || ActivityName.Contains("BEL") || ActivityName.Contains("BS") || ActivityName.Contains("HT") || ActivityName.Contains("LF") || ActivityName.Contains("VT") || ActivityName.Contains("FF") || ActivityName.Contains("CR") || ActivityName.Contains("SO") || ActivityName.Contains("SI") || ActivityName.Contains("DLE") || ActivityName.Contains("DC1") || ActivityName.Contains("DC2") || ActivityName.Contains("DC3") || ActivityName.Contains("DC4") || ActivityName.Contains("NAK") || ActivityName.Contains("SYN") || ActivityName.Contains("ETB") || ActivityName.Contains("CAN") || ActivityName.Contains("EM") || ActivityName.Contains("SUB") || ActivityName.Contains("ESC") || ActivityName.Contains("FS") || ActivityName.Contains("GS") || ActivityName.Contains("RS") || ActivityName.Contains("US"))
                {
                    Console.WriteLine("That input is invalid beause it contains a control character. Please input a new activity name: ");
                    ActivityName = Console.ReadLine();
                }

                var projectName  = ProjectName.Replace(" ", "%20").Replace("<", "%3C").Replace(">", "%3E").Replace("#", "%23").Replace("%", "%25").Replace("\"", "%22").Replace(";", "%3B").Replace("/", "%2F").Replace("?", "%3F").Replace(":", "%3A").Replace("@", "%40").Replace("&", "%26").Replace("$", "%24").Replace("+", "%2B").Replace("=", "%3D").Replace("[", "%5B").Replace("]", "%5D").Replace("\\", "%5C").Replace("^", "%5E").Replace("`", "%60").Replace("{", "%7B").Replace("}", "%7D").Replace("|", "%7C");
                var activityName = ActivityName.Replace(" ", "%20").Replace("<", "%3C").Replace(">", "%3E").Replace("#", "%23").Replace("%", "%25").Replace("\"", "%22").Replace(";", "%3B").Replace("/", "%2F").Replace("?", "%3F").Replace(":", "%3A").Replace("@", "%40").Replace("&", "%26").Replace("$", "%24").Replace("+", "%2B").Replace("=", "%3D").Replace("[", "%5B").Replace("]", "%5D").Replace("\\", "%5C").Replace("^", "%5E").Replace("`", "%60").Replace("{", "%7B").Replace("}", "%7D").Replace("|", "%7C");

                Console.WriteLine("https://companyserver.com/content/{0}/files/{1}/{1}Report.pdf", projectName, activityName);

                Console.WriteLine("Would you like to create another URL? Type \"yes\", and then hit the \"enter\" key twice if you do, or type anything else and hit enter twice to exit the program.");
                UserInput = Console.ReadLine();

                if (UserInput == "yes")
                {
                    userInput = 1;
                }

                else
                {
                    userInput = 0;
                }

                Console.ReadLine();
            }
        }
        public static WorkEntity GetWork(List <WorkEntity> WorkEntities, ActivityName activityName)
        {
            WorkEntity tmp;

            if (WorkEntities == null)
            {
                tmp = _errorWorkEntity;
                return(tmp);
            }
            tmp = WorkEntities.Find(x => x.WorkActivity_id == (int)activityName);
            if (tmp == null)
            {
                tmp = _errorWorkEntity;
                return(tmp);
            }
            return(tmp);
        }
Example #12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ProjectName != null ? ProjectName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AssigneeName != null ? AssigneeName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ActivityName != null ? ActivityName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)ActivityStatus;
         hashCode = (hashCode * 397) ^ (ActivityType != null ? ActivityType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ EstimatedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LoggedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ProjectId.GetHashCode();
         hashCode = (hashCode * 397) ^ ActivityId.GetHashCode();
         hashCode = (hashCode * 397) ^ AssigneeId.GetHashCode();
         return(hashCode);
     }
 }
        public string ToQueryString()
        {
            string istrue = "true", isfalse = "false";
            var    dfrom    = StartTime.ToString("ddd, dd MMM yyyy hh:mm:ss") + " GMT";
            var    dfromesc = Uri.EscapeDataString(dfrom).Replace("%20", "+");
            var    dto      = EndTime.ToString("ddd, dd MMM yyyy hh:mm:ss") + " GMT";
            var    dtoesc   = Uri.EscapeDataString(dto).Replace("%20", "+");
            var    sb       = new StringBuilder();

            sb.Append($"Success={(Success ? istrue : isfalse)}");
            sb.Append($"&AllowRetry={(AllowRetry ? istrue : isfalse)}");
            sb.Append($"&Message={Uri.EscapeUriString(Message.Replace(" ", "+"))}");
            sb.Append($"&StartTime={dfromesc}");
            sb.Append($"&EndTime={dfromesc}");
            sb.Append($"&FacilityName={Uri.EscapeUriString(FacilityName.Replace(" ", "+"))}");
            sb.Append($"&ActivityName={Uri.EscapeUriString(ActivityName.Replace(" ", "+"))}");
            sb.Append($"&ResourceLocation={Uri.EscapeUriString(ResourceLocation.Replace(" ", "+"))}");
            sb.Append($"&KeepThis={istrue}");
            return(sb.ToString());
        }
Example #14
0
        /// <summary>Execute a single config file.</summary>
        /// <param name="sessionContext">The session context.</param>
        /// <param name="configFile">The config file.</param>
        /// <param name="activity">The activity</param>
        /// <param name="fileType">The file types</param>
        /// <param name="measure">If it should measure.</param>
        /// <param name="fullPathToConfigFiles">The full Path To Config Files.</param>
        /// <returns>The success.</returns>
        private static Tuple <bool, int> ExecuteConfigFile(IWebGreaseContext sessionContext, string configFile, ActivityName activity, FileTypes fileType, bool measure, string fullPathToConfigFiles)
        {
            var configFileStart = DateTimeOffset.Now;

            var configFileInfo = new FileInfo(configFile);

            // Creates the context specific to the configuration file
            var fileContext = new WebGreaseContext(sessionContext, configFileInfo);

            var configFileSuccess = true;
            var fileSets          = GetFileSets(fileContext.Configuration, fileType).ToArray();

            if (fileSets.Length > 0 || (fileType.HasFlag(FileTypes.Image) && fileContext.Configuration.ImageDirectoriesToHash.Any()))
            {
                var configFileContentItem = ContentItem.FromFile(configFileInfo.FullName);
                configFileSuccess = sessionContext
                                    .SectionedActionGroup(fileType.ToString(), SectionIdParts.WebGreaseBuildTask, SectionIdParts.ConfigurationFile)
                                    .MakeCachable(configFileContentItem, new { activity, fileContext.Configuration }, activity == ActivityName.Bundle) // Cached action can only be skipped when it is the bundle activity, otherwise don't.
                                    .Execute(configFileCacheSection =>
                {
                    fileContext.Configuration.AllLoadedConfigurationFiles.ForEach(configFileCacheSection.AddSourceDependency);

                    var success = true;
                    fileContext.Log.Information("Activity Start: [{0}] for [{1}] on configuration file \"{2}\"".InvariantFormat(activity, fileType, configFile), MessageImportance.High);
                    switch (activity)
                    {
                    case ActivityName.Bundle:
                        // execute the bundle pipeline
                        var bundleActivity = new BundleActivity(fileContext);
                        success           &= bundleActivity.Execute(fileSets);
                        break;

                    case ActivityName.Everything:
                        // execute the full pipeline
                        var everythingActivity = new EverythingActivity(fileContext);
                        success &= everythingActivity.Execute(fileSets, fileType);
                        break;
                    }

                    if (success && measure)
                    {
                        var configReportFile = Path.Combine(sessionContext.Configuration.ReportPath, (configFileInfo.Directory != null ? configFileInfo.Directory.Name + "." : string.Empty) + activity.ToString() + "." + fileType + "." + configFileInfo.Name);
                        fileContext.Measure.WriteResults(configReportFile, configFileInfo.FullName, configFileStart);
                    }

                    fileContext.Log.Information("Activity End: [{0}] for [{1}] on configuration file \"{2}\"".InvariantFormat(activity, fileType, configFile), MessageImportance.High);
                    return(success);
                });
            }

            return(Tuple.Create(configFileSuccess, fileSets.Length));
        }
Example #15
0
 public bool Matched(string activityName)
 {
     return(ActivityName.Equals(activityName));
 }
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     ActivityName.SelectAll();
     ActivityName.Focus();
 }
Example #17
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (StateName != null)
         {
             hashCode = hashCode * 59 + StateName.GetHashCode();
         }
         if (ActivityName != null)
         {
             hashCode = hashCode * 59 + ActivityName.GetHashCode();
         }
         if (SchemeId != null)
         {
             hashCode = hashCode * 59 + SchemeId.GetHashCode();
         }
         if (SchemeCode != null)
         {
             hashCode = hashCode * 59 + SchemeCode.GetHashCode();
         }
         if (PreviousState != null)
         {
             hashCode = hashCode * 59 + PreviousState.GetHashCode();
         }
         if (PreviousStateForDirect != null)
         {
             hashCode = hashCode * 59 + PreviousStateForDirect.GetHashCode();
         }
         if (PreviousStateForReverse != null)
         {
             hashCode = hashCode * 59 + PreviousStateForReverse.GetHashCode();
         }
         if (PreviousActivity != null)
         {
             hashCode = hashCode * 59 + PreviousActivity.GetHashCode();
         }
         if (PreviousActivityForDirect != null)
         {
             hashCode = hashCode * 59 + PreviousActivityForDirect.GetHashCode();
         }
         if (PreviousActivityForReverse != null)
         {
             hashCode = hashCode * 59 + PreviousActivityForReverse.GetHashCode();
         }
         if (ParentProcessId != null)
         {
             hashCode = hashCode * 59 + ParentProcessId.GetHashCode();
         }
         if (RootProcessId != null)
         {
             hashCode = hashCode * 59 + RootProcessId.GetHashCode();
         }
         if (InstanceStatus != null)
         {
             hashCode = hashCode * 59 + InstanceStatus.GetHashCode();
         }
         if (Transitions != null)
         {
             hashCode = hashCode * 59 + Transitions.GetHashCode();
         }
         if (History != null)
         {
             hashCode = hashCode * 59 + History.GetHashCode();
         }
         if (ProcessParameters != null)
         {
             hashCode = hashCode * 59 + ProcessParameters.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #18
0
        /// <summary>
        /// Returns true if ProcessInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of ProcessInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ProcessInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     StateName == other.StateName ||
                     StateName != null &&
                     StateName.Equals(other.StateName)
                 ) &&
                 (
                     ActivityName == other.ActivityName ||
                     ActivityName != null &&
                     ActivityName.Equals(other.ActivityName)
                 ) &&
                 (
                     SchemeId == other.SchemeId ||
                     SchemeId != null &&
                     SchemeId.Equals(other.SchemeId)
                 ) &&
                 (
                     SchemeCode == other.SchemeCode ||
                     SchemeCode != null &&
                     SchemeCode.Equals(other.SchemeCode)
                 ) &&
                 (
                     PreviousState == other.PreviousState ||
                     PreviousState != null &&
                     PreviousState.Equals(other.PreviousState)
                 ) &&
                 (
                     PreviousStateForDirect == other.PreviousStateForDirect ||
                     PreviousStateForDirect != null &&
                     PreviousStateForDirect.Equals(other.PreviousStateForDirect)
                 ) &&
                 (
                     PreviousStateForReverse == other.PreviousStateForReverse ||
                     PreviousStateForReverse != null &&
                     PreviousStateForReverse.Equals(other.PreviousStateForReverse)
                 ) &&
                 (
                     PreviousActivity == other.PreviousActivity ||
                     PreviousActivity != null &&
                     PreviousActivity.Equals(other.PreviousActivity)
                 ) &&
                 (
                     PreviousActivityForDirect == other.PreviousActivityForDirect ||
                     PreviousActivityForDirect != null &&
                     PreviousActivityForDirect.Equals(other.PreviousActivityForDirect)
                 ) &&
                 (
                     PreviousActivityForReverse == other.PreviousActivityForReverse ||
                     PreviousActivityForReverse != null &&
                     PreviousActivityForReverse.Equals(other.PreviousActivityForReverse)
                 ) &&
                 (
                     ParentProcessId == other.ParentProcessId ||
                     ParentProcessId != null &&
                     ParentProcessId.Equals(other.ParentProcessId)
                 ) &&
                 (
                     RootProcessId == other.RootProcessId ||
                     RootProcessId != null &&
                     RootProcessId.Equals(other.RootProcessId)
                 ) &&
                 (
                     InstanceStatus == other.InstanceStatus ||
                     InstanceStatus != null &&
                     InstanceStatus.Equals(other.InstanceStatus)
                 ) &&
                 (
                     Transitions == other.Transitions ||
                     Transitions != null &&
                     Transitions.SequenceEqual(other.Transitions)
                 ) &&
                 (
                     History == other.History ||
                     History != null &&
                     History.SequenceEqual(other.History)
                 ) &&
                 (
                     ProcessParameters == other.ProcessParameters ||
                     ProcessParameters != null &&
                     ProcessParameters.Equals(other.ProcessParameters)
                 ));
        }
Example #19
0
        static void Main(string[] args)
        {
            string ProjectName;
            int    good = 0;
            string ActivityName;
            string x = "y";

            while (x == "y")
            {
                Console.WriteLine("Enter The Project Name: ");
                ProjectName = Console.ReadLine();
                good        = 0;
                while (good == 0)
                {
                    foreach (char i in ProjectName)
                    {
                        if (i <= (char)1F & i >= (char)00)
                        {
                            Console.WriteLine("Input Invalid! Enter A New Project Name Without Control Characters: ");
                            ProjectName = Console.ReadLine();
                            break;
                        }
                        else
                        {
                            if (i == (char)7F)
                            {
                                Console.WriteLine("Input Invalid! Enter A New Project Name Without Control Characters: ");
                                ProjectName = Console.ReadLine();
                                break;
                            }
                            else
                            {
                                good++;
                            }
                        }
                    }
                }
                Console.WriteLine("Enter The Activity Name: ");
                ActivityName = Console.ReadLine();
                good         = 0;
                while (good == 0)
                {
                    foreach (char j in ActivityName)
                    {
                        if (j <= (char)1F & j >= (char)00)
                        {
                            Console.WriteLine("Input Invalid! Enter A New Activity Name Without Control Characters: ");
                            ActivityName = Console.ReadLine();
                            break;
                        }
                        else
                        {
                            if (j == (char)7F)
                            {
                                Console.WriteLine("Input Invalid! Enter A New Activity Name Without Control Characters: ");
                                ActivityName = Console.ReadLine();
                                break;
                            }
                            else
                            {
                                good++;
                            }
                        }
                    }
                }
                ProjectName  = ProjectName.Replace("%", "%25");
                ProjectName  = ProjectName.Replace(" ", "%20");
                ProjectName  = ProjectName.Replace("<", "%3C");
                ProjectName  = ProjectName.Replace(">", "%3E");
                ProjectName  = ProjectName.Replace("#", "%23");
                ProjectName  = ProjectName.Replace("\"", "%22");
                ProjectName  = ProjectName.Replace(";", "%3B");
                ProjectName  = ProjectName.Replace("/", "%2F");
                ProjectName  = ProjectName.Replace("?", "%3F");
                ProjectName  = ProjectName.Replace(":", "%3A");
                ProjectName  = ProjectName.Replace("@", "%40");
                ProjectName  = ProjectName.Replace("&", "%26");
                ProjectName  = ProjectName.Replace("=", "%3D");
                ProjectName  = ProjectName.Replace("+", "%2B");
                ProjectName  = ProjectName.Replace("$", "%24");
                ProjectName  = ProjectName.Replace("{", "%7B");
                ProjectName  = ProjectName.Replace("}", "%7D");
                ProjectName  = ProjectName.Replace("|", "%7C");
                ProjectName  = ProjectName.Replace("\\", "%5C");
                ProjectName  = ProjectName.Replace("^", "%5E");
                ProjectName  = ProjectName.Replace("[", "%5B");
                ProjectName  = ProjectName.Replace("]", "%5D");
                ProjectName  = ProjectName.Replace("`", "%60");
                ActivityName = ActivityName.Replace("%", "%25");
                ActivityName = ActivityName.Replace(" ", "%20");
                ActivityName = ActivityName.Replace("<", "%3C");
                ActivityName = ActivityName.Replace(">", "%3E");
                ActivityName = ActivityName.Replace("#", "%23");
                ActivityName = ActivityName.Replace("\"", "%22");
                ActivityName = ActivityName.Replace(";", "%3B");
                ActivityName = ActivityName.Replace("/", "%2F");
                ActivityName = ActivityName.Replace("?", "%3F");
                ActivityName = ActivityName.Replace(":", "%3A");
                ActivityName = ActivityName.Replace("@", "%40");
                ActivityName = ActivityName.Replace("&", "%26");
                ActivityName = ActivityName.Replace("=", "%3D");
                ActivityName = ActivityName.Replace("+", "%2B");
                ActivityName = ActivityName.Replace("$", "%24");
                ActivityName = ActivityName.Replace("{", "%7B");
                ActivityName = ActivityName.Replace("}", "%7D");
                ActivityName = ActivityName.Replace("|", "%7C");
                ActivityName = ActivityName.Replace("\\", "%5C");
                ActivityName = ActivityName.Replace("^", "%5E");
                ActivityName = ActivityName.Replace("[", "%5B");
                ActivityName = ActivityName.Replace("]", "%5D");
                ActivityName = ActivityName.Replace("`", "%60");
                Console.WriteLine("https://companyserver.com/content/{0}/files/{1}/{1}Report.pdf", ProjectName, ActivityName);
                Console.WriteLine("Enter 'y' If You Would Like To Continue With Another URL.)");
                x = Console.ReadLine();
            }
        }
Example #20
0
        /// <summary>The execute.</summary>
        /// <param name="fileType">The file type.</param>
        /// <param name="activity">The activity.</param>
        /// <param name="configurationPath">The configuration path</param>
        /// <param name="sessionContext">The session context</param>
        /// <returns>The <see cref="Tuple"/>.</returns>
        private bool Execute(FileTypes fileType, ActivityName activity, string configurationPath, IWebGreaseContext sessionContext)
        {
            var availableFileSetsForFileType = 0;

            var fullPathToConfigFiles = Path.GetFullPath(configurationPath);

            var contentTypeSectionId = new[] { fileType.ToString(), SectionIdParts.WebGreaseBuildTask };

            var sessionSuccess = sessionContext
                                 .SectionedAction(SectionIdParts.WebGreaseBuildTaskSession, fileType.ToString())
                                 .MakeCachable(new { fullPathToConfigFiles, activity })
                                 .Execute(sessionCacheSection =>
            {
                var sessionCacheData = sessionCacheSection.GetCacheData <SessionCacheData>(CacheFileCategories.SolutionCacheConfig);

                var inputFiles = new InputSpec {
                    Path = fullPathToConfigFiles, IsOptional = true, SearchOption = this.ConfigurationPathRecursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly
                }.GetFiles();
                var contentTypeSuccess = sessionContext
                                         .SectionedAction(contentTypeSectionId)
                                         .MakeCachable(new { activity, inputFiles, sessionContext.Configuration }, activity == ActivityName.Bundle)
                                         .Execute(contentTypeCacheSection =>
                {
                    var success = true;
                    try
                    {
                        // get a list of the files in the configuration folder
                        foreach (var configFile in inputFiles)
                        {
                            var executeConfigFileResult = ExecuteConfigFile(sessionContext, configFile, activity, fileType, this.Measure, fullPathToConfigFiles);
                            success &= executeConfigFileResult.Item1;
                            availableFileSetsForFileType += executeConfigFileResult.Item2;
                            GC.Collect();
                        }
                    }
                    catch (BuildWorkflowException exception)
                    {
                        this.LogError(exception.Subcategory, exception.ErrorCode, exception.HelpKeyword, exception.File, exception.LineNumber, exception.EndLineNumber, exception.ColumnNumber, exception.EndColumnNumber, exception.Message);
                        return(false);
                    }
                    catch (Exception exception)
                    {
                        this.LogError(exception, exception.Message, null);
                        return(false);
                    }

                    if (success)
                    {
                        // Add the current cachesection to the sessionCacheData
                        if (sessionCacheData != null)
                        {
                            sessionCacheData.SetConfigTypeUniqueKey(this.ConfigType, contentTypeCacheSection.UniqueKey);
                            sessionCacheSection.SetCacheData(CacheFileCategories.SolutionCacheConfig, sessionCacheData);
                        }
                    }

                    return(success);
                });

                if (contentTypeSuccess)
                {
                    // Add the cache sections of the other already cached contentTypes (Debug/Release) so that they will not get removed.
                    this.HandleOtherContentTypeCacheSections(sessionContext, sessionCacheSection, sessionCacheData, contentTypeSectionId);
                }

                return(contentTypeSuccess);
            });

            if (sessionSuccess && (availableFileSetsForFileType > 0))
            {
                sessionContext.Cache.CleanUp();
            }

            // Return tuple, that contains,the success, the results and the configuration for this thread.
            return(sessionSuccess);
        }