private SanitizedHtmlString GetBusyTypeHtml(BusyType busyType)
        {
            SanitizingStringWriter <OwaHtml> sanitizingStringWriter = new SanitizingStringWriter <OwaHtml>();

            switch (busyType)
            {
            case BusyType.Free:
                this.sessionContext.RenderThemeImage(sanitizingStringWriter, ThemeFileId.Available, "free", new object[0]);
                sanitizingStringWriter.Write(LocalizedStrings.GetNonEncoded(-971703552));
                goto IL_DC;

            case BusyType.Busy:
                this.sessionContext.RenderThemeImage(sanitizingStringWriter, ThemeFileId.Busy, "busy", new object[0]);
                sanitizingStringWriter.Write(LocalizedStrings.GetNonEncoded(2052801377));
                goto IL_DC;

            case BusyType.OOF:
                this.sessionContext.RenderThemeImage(sanitizingStringWriter, ThemeFileId.OutOfOffice, "oof", new object[0]);
                sanitizingStringWriter.Write(LocalizedStrings.GetNonEncoded(2047193656));
                goto IL_DC;
            }
            this.sessionContext.RenderThemeImage(sanitizingStringWriter, ThemeFileId.Tentative, "tntv", new object[0]);
            sanitizingStringWriter.Write(LocalizedStrings.GetNonEncoded(1797669216));
IL_DC:
            return(sanitizingStringWriter.ToSanitizedString <SanitizedHtmlString>());
        }
Пример #2
0
        private void SetOptionalAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                this.optionalAttendeeCount--;
                return;
            }
            if (busyType != BusyType.Free)
            {
                if (this.strongestOptConflict < busyType)
                {
                    this.strongestOptConflict = busyType;
                }
                this.optionalAttendeeConflictCount++;
                this.weightedOptConflicts += (double)busyType * 0.25 + 0.25;
                BusyType[] busyTypeRange = attendee.GetBusyTypeRange(this.meetingStartTime, this.meetingDuration);
                foreach (BusyType busyType2 in busyTypeRange)
                {
                    if (busyType2 != BusyType.Free)
                    {
                        this.optOverlap         += (double)this.options.FreeBusyInterval / (double)this.meetingDuration;
                        this.weightedOptOverlap += ((double)busyType * 0.25 + 0.25) * ((double)this.options.FreeBusyInterval / (double)this.meetingDuration);
                    }
                }
            }
        }
        public BusyTypeDropDownList(string id, BusyType busyType)
        {
            int num = (int)busyType;

            base..ctor(id, num.ToString(CultureInfo.InvariantCulture), null);
            this.busyType = busyType;
        }
Пример #4
0
        private BusyType[] GetMergedFreeBusy(ExDateTime start, int duration)
        {
            int num  = (int)((start - this.freeBusyStart).TotalMinutes / 30.0);
            int num2 = duration / 30;
            int num3 = (this.mergedFreeBusy != null) ? this.mergedFreeBusy.Length : 0;

            BusyType[] array = new BusyType[num2];
            for (int i = 0; i < num2; i++)
            {
                int num4 = num + i;
                if (num4 < 0 || num4 >= num3)
                {
                    array[i] = BusyType.NoData;
                }
                else
                {
                    array[i] = (BusyType)(this.mergedFreeBusy[num4] - '0');
                    if (this.requestSchemaVersion < ExchangeVersionType.Exchange2012 && array[i] == BusyType.WorkingElsewhere)
                    {
                        array[i] = BusyType.NoData;
                    }
                }
            }
            return(array);
        }
Пример #5
0
        private void SetRequiredAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                this.requiredAttendeeCount--;
                return;
            }
            if (this.strongestReqConflict < busyType)
            {
                this.strongestReqConflict = busyType;
            }
            if (busyType != BusyType.Free)
            {
                this.requiredAttendeeConflictCount++;
            }
            this.SetConvenience(attendee);
            int    num  = this.meetingDuration / this.options.FreeBusyInterval;
            int    num2 = 0;
            int    num3 = 0;
            double num4 = 0.0;

            if (num > 0)
            {
                BusyType[] busyTypeRange = attendee.GetBusyTypeRange(this.meetingStartTime, this.meetingDuration);
                ExDateTime startUtc      = this.meetingStartTime.ToUtc();
                foreach (BusyType busyType2 in busyTypeRange)
                {
                    ExDateTime exDateTime = startUtc.AddMinutes((double)this.options.FreeBusyInterval);
                    if (busyType2 != BusyType.Free)
                    {
                        num4 += this.GetConflictValue(busyType2);
                        num3++;
                    }
                    else if (!attendee.WorkingHours.IsWorkTime(startUtc, exDateTime))
                    {
                        num4 += 0.25;
                        num3++;
                    }
                    else if (num3 == 0)
                    {
                        num2++;
                    }
                    startUtc = exDateTime;
                }
                this.sumReqFrontTime += (double)num2 / (double)num;
                double num5 = (double)num2 / (double)num;
                if (num5 < this.minPctReqFrontTime)
                {
                    this.minPctReqFrontTime = num5;
                }
                this.weightedReqConflicts += num4 / (double)num;
            }
        }
Пример #6
0
        public BusyType GetBusyType(ExDateTime start, int duration)
        {
            BusyType[] array    = this.GetMergedFreeBusy(start, duration);
            BusyType   busyType = BusyType.Free;

            for (int i = 0; i < array.Length; i++)
            {
                if (array[i] > busyType)
                {
                    busyType = array[i];
                }
            }
            return(busyType);
        }
Пример #7
0
        private List <string> GenerateGameData(bool FullPackageData)
        {
            List <string> ReturnList;

            if (FullPackageData)
            {
                ReturnList = new List <string>
                {
                    GameMode,
                    isGameJoltPlayer.Tobool().ToString(),
                    isGameJoltPlayer ? GameJoltID.ToString() : "",
                    DecimalSeparator,
                    Name,
                    LevelFile,
                    Position.ConvertStringCulture(this),
                    Facing.ToString(),
                    Moving.Tobool().ToString(),
                    Skin,
                    BusyType.ToString(),
                    PokemonVisible.Tobool().ToString(),
                    PokemonPosition.ConvertStringCulture(this),
                    PokemonSkin,
                    PokemonFacing.ToString()
                };
            }
            else
            {
                ReturnList = new List <string>
                {
                    "",
                    "",
                    "",
                    "",
                    "",
                    LastValidGameData[0] == LevelFile ? "" : LevelFile,
                    LastValidGameData[1] == Position ? "" : Position.ConvertStringCulture(this),
                    LastValidGameData[2] == Facing.ToString() ? "" : Facing.ToString(),
                    LastValidGameData[3] == Moving.Tobool().ToString() ? "" : Moving.Tobool().ToString(),
                    LastValidGameData[4] == Skin ? "" : Skin,
                    LastValidGameData[5] == BusyType.ToString() ? "" : BusyType.ToString(),
                    LastValidGameData[6] == PokemonVisible.Tobool().ToString() ? "" : PokemonVisible.Tobool().ToString(),
                    LastValidGameData[7] == PokemonPosition ? "" : PokemonPosition.ConvertStringCulture(this),
                    LastValidGameData[8] == PokemonSkin ? "" : PokemonSkin,
                    LastValidGameData[9] == PokemonFacing.ToString() ? "" : PokemonFacing.ToString()
                };
            }

            return(ReturnList);
        }
Пример #8
0
 private void processAct()
 {
     if (!objToInteract)
     {
         Debug.Log(queue[0].need.GetAction());
         Debug.Log("No object to interact with, missing one GO_TARGET in your steps");
     }
     if (objToInteract.canBeUsed())
     {
         actualState = BusyType.ACTING;
         ++currentStep;
         objToInteract.onUse();
         StartCoroutine(delayProcessCurrent());
     }
 }
Пример #9
0
        private void SetResourceAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                return;
            }
            this.resourceAttendeeCount++;
            if (busyType == BusyType.Free)
            {
                this.resourceAttendeeAvailableCount++;
                return;
            }
            this.resourceAttendeeConflictCount++;
        }
Пример #10
0
        internal static string BusyTypeToString(BusyType busyType)
        {
            switch (busyType)
            {
            case BusyType.Free:
            case BusyType.WorkingElseWhere:
                return("FREE");

            case BusyType.Tentative:
                return("TENTATIVE");

            case BusyType.OOF:
                return("OOF");
            }
            return("BUSY");
        }
Пример #11
0
        public static void ClarifaiTrainFromStream(MemoryStream image, BusyType type)
        {
            string       ACCESS_TOKEN     = ConfigurationManager.AppSettings["apiKey"];
            const string CLARIFAI_API_URL = "https://api.clarifai.com/v2/inputs";

            using (HttpClient client = new HttpClient())
            {
                // Set the authorization header
                client.DefaultRequestHeaders.Add("Authorization", "Bearer " + ACCESS_TOKEN);

                string encodedData = Convert.ToBase64String(image.ToArray());

                string concept = BusyTypeToString(type);

                // The JSON to send in the request that contains the encoded image data
                // Read the docs for more information - https://developer.clarifai.com/guide/predict#predict
                HttpContent json = new StringContent(
                    "{" +
                    "\"inputs\": [" +
                    "{" +
                    "\"data\": {" +
                    "\"image\": {" +
                    "\"base64\": \"" + encodedData + "\"" +
                    "}," +
                    "\"concepts\": [" +
                    "{ \"id\": \"" + concept + "\", \"value\":\"true\" }" +
                    "]" +
                    "}" +
                    "}" +
                    "]" +
                    "}", Encoding.UTF8, "application/json");

                // Send the request to Clarifai and get a response
                var response = client.PostAsync(CLARIFAI_API_URL, json).Result;

                // Check the status code on the response
                if (!response.IsSuccessStatusCode)
                {
                    // End here if there was an error
                    Console.WriteLine("Error: {0}, {1}", response.StatusCode, response.ReasonPhrase);
                }
                else
                {
                    Console.WriteLine("Image added successfully");
                }
            }
        }
Пример #12
0
        public static string BusyTypeToString(BusyType type)
        {
            switch (type)
            {
            case BusyType.Light:
                return("BC Light");

            case BusyType.Medium:
                return("BC Medium");

            case BusyType.Heavy:
                return("BC Heavy");

            default:
                throw new ArgumentException();
            }
        }
Пример #13
0
        private void SetRoomAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                return;
            }
            this.roomsRequested = true;
            this.roomCount++;
            if (busyType == BusyType.Free)
            {
                this.roomsAvailableCount++;
                return;
            }
            this.roomConflictCount++;
        }
Пример #14
0
        private static string BuildMergedFreeBusyString(ExTimeZone timeZone, int mergedFreeBusyInterval, ExDateTime windowStart, ExDateTime windowEnd, int numberOfFreeBusySlots, CalendarEvent[] calendarEventArray, bool exceptionOccurred, byte[] globalObjectId, ExchangeVersionType requestedSchemaVersion)
        {
            char[] array = new char[numberOfFreeBusySlots];
            char   c;

            if (requestedSchemaVersion < ExchangeVersionType.Exchange2012)
            {
                c = (exceptionOccurred ? '4' : '0');
            }
            else
            {
                c = (exceptionOccurred ? '5' : '0');
            }
            for (int i = 0; i < numberOfFreeBusySlots; i++)
            {
                array[i] = c;
            }
            if (!exceptionOccurred && calendarEventArray != null)
            {
                int num = calendarEventArray.Length;
                int j   = 0;
                while (j < num)
                {
                    if (globalObjectId == null)
                    {
                        goto IL_72;
                    }
                    byte[] globalObjectId2 = calendarEventArray[j].GlobalObjectId;
                    if (globalObjectId2 == null || !ArrayComparer <byte> .Comparer.Equals(globalObjectId2, globalObjectId))
                    {
                        goto IL_72;
                    }
IL_B3:
                    j++;
                    continue;
IL_72:
                    ExDateTime startTime = new ExDateTime(timeZone, calendarEventArray[j].StartTime);
                    ExDateTime endTime  = new ExDateTime(timeZone, calendarEventArray[j].EndTime);
                    BusyType   busyType = calendarEventArray[j].BusyType;
                    MergedFreeBusy.AddAppointmentToFreeBusyString(windowStart, windowEnd, startTime, endTime, busyType, mergedFreeBusyInterval, array, requestedSchemaVersion);
                    goto IL_B3;
                }
            }
            return(new string(array));
        }
Пример #15
0
        private double GetConflictValue(BusyType busyType)
        {
            double result = 0.0;

            switch (busyType)
            {
            case BusyType.Tentative:
            case BusyType.NoData:
                result = 0.5;
                break;

            case BusyType.Busy:
            case BusyType.OOF:
                result = 1.0;
                break;
            }
            return(result);
        }
        public string ConvertFreeBusyToTitle(BusyType busyType)
        {
            switch (busyType)
            {
            case BusyType.Free:
                return(ClientStrings.Free.ToString(this.ClientCulture));

            case BusyType.Tentative:
                return(ClientStrings.Tentative.ToString(this.ClientCulture));

            case BusyType.Busy:
                return(ClientStrings.Busy.ToString(this.ClientCulture));

            case BusyType.OOF:
                return(ClientStrings.OOF.ToString(this.ClientCulture));

            default:
                return(string.Empty);
            }
        }
Пример #17
0
        internal static string GetSubjectFromFreeBusyStatus(BusyType busyType, CultureInfo culture)
        {
            switch (busyType)
            {
            case BusyType.Free:
                return(ClientStrings.Free.ToString(culture));

            case BusyType.Tentative:
                return(ClientStrings.Tentative.ToString(culture));

            case BusyType.Busy:
                return(ClientStrings.Busy.ToString(culture));

            case BusyType.OOF:
                return(ClientStrings.OOF.ToString(culture));

            default:
                ExTraceGlobals.ICalTracer.TraceDebug <BusyType>(0L, "CalendarUtil::GetSubjectFromFreeBusy. Found invalid BusyType '{0}'.", busyType);
                return(ClientStrings.Tentative.ToString(culture));
            }
        }
Пример #18
0
        // Token: 0x06002FCE RID: 12238 RVA: 0x00116524 File Offset: 0x00114724
        public static void RenderBusyTypeDropdownList(TextWriter output, Item item, bool forceDisable)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            BusyType busyType = BusyType.Busy;

            if (item != null)
            {
                object obj = item.TryGetProperty(CalendarItemBaseSchema.FreeBusyStatus);
                if (obj is int)
                {
                    busyType = (BusyType)obj;
                }
            }
            new BusyTypeDropDownList("divBsyType", busyType)
            {
                Enabled = !forceDisable
            }.Render(output);
        }
Пример #19
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            BusyType busyType = BusyType.Tentative;

            if (base.Item != null)
            {
                object obj = base.Item.TryGetProperty(CalendarItemBaseSchema.FreeBusyStatus);
                if (obj is int)
                {
                    busyType = (BusyType)obj;
                }
            }
            switch (busyType)
            {
            case BusyType.Free:
                this.busyFreeString = LocalizedStrings.GetHtmlEncoded(-971703552);
                goto IL_91;

            case BusyType.Busy:
                this.busyFreeString = LocalizedStrings.GetHtmlEncoded(2052801377);
                goto IL_91;

            case BusyType.OOF:
                this.busyFreeString = LocalizedStrings.GetHtmlEncoded(2047193656);
                goto IL_91;
            }
            this.busyFreeString = LocalizedStrings.GetHtmlEncoded(1797669216);
IL_91:
            if (base.Item.Importance == Importance.High)
            {
                this.importanceString = LocalizedStrings.GetHtmlEncoded(-77932258);
            }
            else if (base.Item.Importance == Importance.Low)
            {
                this.importanceString = LocalizedStrings.GetHtmlEncoded(1502599728);
            }
            this.categoriesString            = ItemUtility.GetCategoriesAsString(base.Item);
            this.attachmentWellRenderObjects = AttachmentWell.GetAttachmentInformation(base.Item, base.AttachmentLinks, base.UserContext.IsPublicLogon, base.IsEmbeddedItem);
        }
Пример #20
0
    public void SetBusy(BusyType busyType)
    {
        if (busyType == BusyType.NotBusy)
        {
            return;
        }
        isBusy    = true;
        BusyState = busyType;
        switch (busyType)
        {
        case BusyType.Grabbed:
            RecordAgentState(ref agent);
            stateMachine = new StateMachine();
            stateMachine.ChangeState(new Grabbed(agent));
            break;

        case BusyType.SearchingForResource:
            stateMachine.ChangeState(
                new SearchForResource(foodItemsLayer, waterItemsLayer, this, speed * 15f, agent, foodConsumingRate, waterConsumingRate));
            break;

        case BusyType.Hurt:
            break;

        case BusyType.Ingesting:
            break;

        case BusyType.Resting:
            stateMachine.ChangeState(new Resting(this, agent));
            break;

        case BusyType.Fetching:
            RecordAgentState(ref agent);
            stateMachine.ChangeState(new FetchState(agent));
            break;
        }
    }
Пример #21
0
        internal Suggestion(ExDateTime meetingStartTime, int inputMeetingDuration, int inputRequiredAttendeeCount, int inputOptionalAttendeeCount, AttendeeData[] inputAttendees, ConfigOptions inputOptions)
        {
            this.options = inputOptions;
            Suggestion.Tracer.TraceDebug <object, ExDateTime>((long)this.GetHashCode(), "{0}: Suggestion.Suggestion() entered, inputStartDateTime: {1}", TraceContext.Get(), meetingStartTime);
            this.meetingStartTime      = meetingStartTime;
            this.startDateTime         = meetingStartTime.LocalTime;
            this.meetingDuration       = inputMeetingDuration;
            this.requiredAttendeeCount = inputRequiredAttendeeCount;
            this.optionalAttendeeCount = inputOptionalAttendeeCount;
            ExDateTime endUtc = meetingStartTime.AddMinutes((double)inputMeetingDuration);
            bool       flag   = true;
            int        num    = 0;

            this.attendeeConflictDataArray = new AttendeeConflictData[inputAttendees.Length];
            foreach (AttendeeData attendeeData in inputAttendees)
            {
                BusyType busyType = attendeeData.GetBusyType(this.meetingStartTime, this.meetingDuration);
                IndividualAttendeeConflictData individualAttendeeConflictData = IndividualAttendeeConflictData.Create(attendeeData, busyType);
                if (attendeeData.AttendeeType == MeetingAttendeeType.Required || attendeeData.AttendeeType == MeetingAttendeeType.Organizer)
                {
                    this.SetRequiredAttendeeAvailability(attendeeData, individualAttendeeConflictData);
                    if (individualAttendeeConflictData.BusyType != BusyType.NoData)
                    {
                        this.excludeConflict |= attendeeData.ExcludeConflict;
                    }
                }
                else if (attendeeData.AttendeeType == MeetingAttendeeType.Optional)
                {
                    this.SetOptionalAttendeeAvailability(attendeeData, individualAttendeeConflictData);
                }
                else if (attendeeData.AttendeeType == MeetingAttendeeType.Room)
                {
                    this.SetRoomAttendeeAvailability(attendeeData, individualAttendeeConflictData);
                    if (individualAttendeeConflictData.BusyType != BusyType.NoData)
                    {
                        flag &= attendeeData.ExcludeConflict;
                    }
                }
                else if (attendeeData.AttendeeType == MeetingAttendeeType.Resource)
                {
                    this.SetResourceAttendeeAvailability(attendeeData, individualAttendeeConflictData);
                }
                else
                {
                    Suggestion.Tracer.TraceError <object, MeetingAttendeeType>((long)this.GetHashCode(), "{0}: unknown attendee type: {1}", TraceContext.Get(), attendeeData.AttendeeType);
                }
                if (attendeeData.AttendeeType == MeetingAttendeeType.Organizer)
                {
                    this.isWorkTime = attendeeData.WorkingHours.IsWorkTime(this.meetingStartTime, endUtc);
                }
                this.attendeeConflictDataArray[num] = individualAttendeeConflictData;
                num++;
            }
            if (this.roomsRequested)
            {
                this.excludeConflict = (this.excludeConflict || flag);
            }
            Suggestion.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: required: {1}, optional: {2}, worktime?: {3}", new object[]
            {
                TraceContext.Get(),
                this.requiredAttendeeCount,
                this.optionalAttendeeCount,
                this.isWorkTime
            });
            if (this.requiredAttendeeCount != 0)
            {
                this.sumPctReqFrontTime      = this.sumReqFrontTime / (double)this.requiredAttendeeCount;
                this.weightedPctReqConflicts = this.weightedReqConflicts / (double)this.requiredAttendeeCount;
            }
            else
            {
                this.weightedPctReqConflicts = 1.0;
            }
            if (this.optionalAttendeeCount != 0)
            {
                this.pctOptConflicts = (double)this.optionalAttendeeConflictCount / (double)this.optionalAttendeeCount;
                this.pctOptOverlap   = this.optOverlap / (double)this.optionalAttendeeCount;
            }
            this.timeSlotRating = this.GetRating();
            if (this.weightedPctReqConflicts == 0.0)
            {
                this.bucket = SuggestionQuality.Excellent;
            }
            else if (this.weightedPctReqConflicts * 100.0 >= 50.0)
            {
                this.bucket = SuggestionQuality.Poor;
            }
            else if (this.weightedPctReqConflicts * 100.0 <= (double)this.options.GoodThreshold)
            {
                this.bucket = SuggestionQuality.Good;
            }
            else
            {
                this.bucket = SuggestionQuality.Fair;
            }
            Suggestion.Tracer.TraceDebug <object, long, SuggestionQuality>((long)this.GetHashCode(), "{0}: final suggestion results, timeSlotRating: {1}, bucket: {2}", TraceContext.Get(), this.timeSlotRating, this.bucket);
        }
Пример #22
0
 /// <summary>
 /// This implementation has no effect
 /// </summary>
 /// <param name="which"></param>
 public void Busy(BusyType which)
 { }
Пример #23
0
 public void Busy(BusyType which)
 {
     //throw new NotImplementedException();
 }
Пример #24
0
        // Token: 0x06002FD5 RID: 12245 RVA: 0x00116CC8 File Offset: 0x00114EC8
        private static SanitizedHtmlString BuildAdjacencyOrConflictSection(List <AdjacencyOrConflictInfo> appointments, string sectionTitle, UserContext userContext, OwaStoreObjectId folderId)
        {
            SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>(128);

            sanitizingStringBuilder.Append("<div id=\"divCnfHdr\">");
            sanitizingStringBuilder.Append(sectionTitle);
            sanitizingStringBuilder.Append("</div>");
            foreach (AdjacencyOrConflictInfo adjacencyOrConflictInfo in appointments)
            {
                BusyType freeBusyStatus = adjacencyOrConflictInfo.FreeBusyStatus;
                bool     flag           = adjacencyOrConflictInfo.Sensitivity == Sensitivity.Private && folderId != null && folderId.IsOtherMailbox;
                sanitizingStringBuilder.Append("<div class=\"cnf\" id=\"divCnfItem\">");
                sanitizingStringBuilder.Append("<div id=\"divCnfIcnSbj\">");
                switch (freeBusyStatus)
                {
                case BusyType.Tentative:
                    userContext.RenderThemeImage(sanitizingStringBuilder.UnsafeInnerStringBuilder, ThemeFileId.Tentative, "tntv", new object[0]);
                    break;

                case BusyType.Busy:
                    userContext.RenderThemeImage(sanitizingStringBuilder.UnsafeInnerStringBuilder, ThemeFileId.Busy, "busy", new object[0]);
                    break;

                case BusyType.OOF:
                    userContext.RenderThemeImage(sanitizingStringBuilder.UnsafeInnerStringBuilder, ThemeFileId.OutOfOffice, "oof", new object[0]);
                    break;
                }
                sanitizingStringBuilder.Append("<span id=\"");
                sanitizingStringBuilder.Append(adjacencyOrConflictInfo.OccurrenceInfo.VersionedId.ObjectId.ToBase64String());
                if (adjacencyOrConflictInfo.GlobalObjectId != null)
                {
                    sanitizingStringBuilder.Append("\" gid=\"");
                    sanitizingStringBuilder.Append(Convert.ToBase64String(adjacencyOrConflictInfo.GlobalObjectId));
                }
                if (folderId != null)
                {
                    sanitizingStringBuilder.Append("\" fid=\"");
                    sanitizingStringBuilder.Append(folderId.ToBase64String());
                }
                sanitizingStringBuilder.Append("\"");
                if (!flag)
                {
                    sanitizingStringBuilder.Append(" class=\"IbL\" ");
                    sanitizingStringBuilder.Append <SanitizedEventHandlerString>(Utilities.GetScriptHandler("onclick", "Owa.Components.MeetingHelpers.onClickAppointment(_this);"));
                }
                sanitizingStringBuilder.Append(">");
                if (flag)
                {
                    sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(840767634));
                }
                else
                {
                    string text = string.Empty;
                    if (!string.IsNullOrEmpty(adjacencyOrConflictInfo.Subject))
                    {
                        text = adjacencyOrConflictInfo.Subject.Trim();
                    }
                    if (text.Length == 0)
                    {
                        sanitizingStringBuilder.Append(userContext.DirectionMark);
                        sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(6409762));
                        sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(-776227687));
                        sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(-1023695022));
                        sanitizingStringBuilder.Append(userContext.DirectionMark);
                    }
                    else
                    {
                        sanitizingStringBuilder.Append(text);
                    }
                }
                sanitizingStringBuilder.Append("</span></div><div class=\"cnf\" id=\"divCnfLctTime\">");
                string     empty     = string.Empty;
                ExDateTime startTime = adjacencyOrConflictInfo.OccurrenceInfo.StartTime;
                ExDateTime endTime   = adjacencyOrConflictInfo.OccurrenceInfo.EndTime;
                TimeSpan   timeSpan  = endTime - startTime;
                if (startTime.Day != endTime.Day || timeSpan.TotalDays >= 1.0)
                {
                    sanitizingStringBuilder.Append <SanitizedHtmlString>(SanitizedHtmlString.Format(LocalizedStrings.GetNonEncoded(492249539), new object[]
                    {
                        startTime.ToString(userContext.UserOptions.DateFormat),
                        startTime.ToString(userContext.UserOptions.TimeFormat),
                        endTime.ToString(userContext.UserOptions.DateFormat),
                        endTime.ToString(userContext.UserOptions.TimeFormat)
                    }));
                }
                else
                {
                    sanitizingStringBuilder.Append <SanitizedHtmlString>(SanitizedHtmlString.Format(LocalizedStrings.GetNonEncoded(-792821726), new object[]
                    {
                        startTime.ToString(userContext.UserOptions.TimeFormat),
                        endTime.ToString(userContext.UserOptions.TimeFormat)
                    }));
                }
                sanitizingStringBuilder.Append("&nbsp;&nbsp;&nbsp;");
                if (!flag && adjacencyOrConflictInfo.Location != null && adjacencyOrConflictInfo.Location.Trim().Length > 0)
                {
                    sanitizingStringBuilder.Append(userContext.DirectionMark);
                    sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(6409762));
                    sanitizingStringBuilder.Append(adjacencyOrConflictInfo.Location);
                    sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(-1023695022));
                    sanitizingStringBuilder.Append(userContext.DirectionMark);
                }
                sanitizingStringBuilder.Append("</div></div>");
            }
            return(sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>());
        }
Пример #25
0
        // Token: 0x06002FD4 RID: 12244 RVA: 0x001169D4 File Offset: 0x00114BD4
        private static void AddConflictingAppointmentsInfobarMessage(Infobar infobar, AdjacencyOrConflictInfo[] adjacencyOrConflictInfo, UserContext userContext, CalendarItemType calendarItemType, string receivedRepresentingDisplayName, OwaStoreObjectId folderId)
        {
            List <AdjacencyOrConflictInfo> list  = new List <AdjacencyOrConflictInfo>();
            List <AdjacencyOrConflictInfo> list2 = new List <AdjacencyOrConflictInfo>();
            List <AdjacencyOrConflictInfo> list3 = new List <AdjacencyOrConflictInfo>();

            for (int i = 0; i < adjacencyOrConflictInfo.Length; i++)
            {
                AdjacencyOrConflictType adjacencyOrConflictType = adjacencyOrConflictInfo[i].AdjacencyOrConflictType;
                BusyType freeBusyStatus = adjacencyOrConflictInfo[i].FreeBusyStatus;
                if (freeBusyStatus != BusyType.Free)
                {
                    if ((adjacencyOrConflictType & AdjacencyOrConflictType.Conflicts) != (AdjacencyOrConflictType)0)
                    {
                        list.Add(adjacencyOrConflictInfo[i]);
                    }
                    else if ((adjacencyOrConflictType & AdjacencyOrConflictType.Precedes) != (AdjacencyOrConflictType)0)
                    {
                        list2.Add(adjacencyOrConflictInfo[i]);
                    }
                    else if ((adjacencyOrConflictType & AdjacencyOrConflictType.Follows) != (AdjacencyOrConflictType)0)
                    {
                        list3.Add(adjacencyOrConflictInfo[i]);
                    }
                }
            }
            if (list.Count == 0 && list2.Count == 0 && list3.Count == 0)
            {
                return;
            }
            SanitizedHtmlString sanitizedHtmlString = null;

            if (calendarItemType != CalendarItemType.RecurringMaster)
            {
                SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>();
                Strings.IDs localizedId  = 1786149639;
                Strings.IDs localizedId2 = -669919370;
                if (list.Count > 0)
                {
                    if (string.IsNullOrEmpty(receivedRepresentingDisplayName))
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(-812272237);
                    }
                    else
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(49937409);
                    }
                }
                else if (list2.Count > 0 && list3.Count > 0)
                {
                    if (string.IsNullOrEmpty(receivedRepresentingDisplayName))
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(2138994880);
                    }
                    else
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(-1207817018);
                    }
                    localizedId  = -1877110893;
                    localizedId2 = 1083835406;
                }
                else if (list2.Count > 0)
                {
                    if (string.IsNullOrEmpty(receivedRepresentingDisplayName))
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(-1508975609);
                    }
                    else
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(602898401);
                    }
                    localizedId  = 2029212075;
                    localizedId2 = -1796482192;
                }
                else if (list3.Count > 0)
                {
                    if (string.IsNullOrEmpty(receivedRepresentingDisplayName))
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(-1710537313);
                    }
                    else
                    {
                        sanitizedHtmlString = SanitizedHtmlString.FromStringId(-996033031);
                    }
                    localizedId  = -608468101;
                    localizedId2 = -1733349590;
                }
                sanitizingStringBuilder.Append("<span id=spnS class=IbL>");
                sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(localizedId));
                sanitizingStringBuilder.Append("</span>");
                sanitizingStringBuilder.Append("<span id=spnH class=IbL style=\"display:none\">");
                sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(localizedId2));
                sanitizingStringBuilder.Append("</span>");
                SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder2 = new SanitizingStringBuilder <OwaHtml>();
                sanitizingStringBuilder2.Append("<div id=\"divCnf\">");
                if (list.Count > 0)
                {
                    sanitizingStringBuilder2.Append <SanitizedHtmlString>(CalendarUtilities.BuildAdjacencyOrConflictSection(list, LocalizedStrings.GetNonEncoded(-1874853770), userContext, folderId));
                }
                if (list2.Count > 0)
                {
                    sanitizingStringBuilder2.Append <SanitizedHtmlString>(CalendarUtilities.BuildAdjacencyOrConflictSection(list2, LocalizedStrings.GetNonEncoded(2095567903), userContext, folderId));
                }
                if (list3.Count > 0)
                {
                    sanitizingStringBuilder2.Append <SanitizedHtmlString>(CalendarUtilities.BuildAdjacencyOrConflictSection(list3, LocalizedStrings.GetNonEncoded(-51439729), userContext, folderId));
                }
                sanitizingStringBuilder2.Append("</div>");
                if (!string.IsNullOrEmpty(receivedRepresentingDisplayName))
                {
                    sanitizedHtmlString = SanitizedHtmlString.Format(sanitizedHtmlString.ToString(), new object[]
                    {
                        receivedRepresentingDisplayName
                    });
                }
                infobar.AddMessage(sanitizedHtmlString, InfobarMessageType.Expanding, "divIbL", sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>(), sanitizingStringBuilder2.ToSanitizedString <SanitizedHtmlString>());
                return;
            }
            if (list.Count > 0)
            {
                sanitizedHtmlString = SanitizedHtmlString.FromStringId(890561325);
            }
            else if (list2.Count > 0 || list3.Count > 0)
            {
                sanitizedHtmlString = SanitizedHtmlString.FromStringId(1923039961);
            }
            infobar.AddMessage(sanitizedHtmlString, InfobarMessageType.Informational);
        }
Пример #26
0
 /// <summary>
 /// This implementation has no effect
 /// </summary>
 /// <param name="which"></param>
 public void Busy(BusyType which)
 {
 }
Пример #27
0
        internal static CalendarEvent CreateFromQueryData(EmailAddress mailbox, object[] properties, FreeBusyViewType allowedView, bool isCallerMailboxOwner, ExchangeVersionType exchangeVersion)
        {
            CalendarEvent calendarEvent = new CalendarEvent();

            calendarEvent.viewType       = allowedView;
            calendarEvent.globalObjectId = CalendarEvent.GetPropertyValue <byte[]>(properties, QueryPropertyIndexes.GlobalObjectId);
            calendarEvent.StartTime      = DateTime.SpecifyKind((DateTime)CalendarEvent.GetPropertyValue <ExDateTime>(properties, QueryPropertyIndexes.StartTime, ExDateTime.MinValue), DateTimeKind.Unspecified);
            calendarEvent.EndTime        = DateTime.SpecifyKind((DateTime)CalendarEvent.GetPropertyValue <ExDateTime>(properties, QueryPropertyIndexes.EndTime, ExDateTime.MinValue), DateTimeKind.Unspecified);
            BusyType busyType = CalendarEvent.GetPropertyValue <BusyType>(properties, QueryPropertyIndexes.BusyStatus, BusyType.Busy);

            if (busyType < BusyType.Free || busyType > BusyType.NoData)
            {
                CalendarEvent.CalendarViewTracer.TraceError((long)calendarEvent.GetHashCode(), "{0}: Calendar event with start time {1} and end time {2} in mailbox {3} has invalid busy type: {4}. This is being returned as BusyType.Tentative", new object[]
                {
                    TraceContext.Get(),
                    calendarEvent.StartTime,
                    calendarEvent.EndTime,
                    mailbox,
                    busyType
                });
                calendarEvent.BusyType = BusyType.Tentative;
            }
            else
            {
                if (exchangeVersion < ExchangeVersionType.Exchange2012 && busyType == BusyType.WorkingElsewhere)
                {
                    busyType = BusyType.Free;
                }
                calendarEvent.BusyType = busyType;
            }
            Sensitivity propertyValue = CalendarEvent.GetPropertyValue <Sensitivity>(properties, QueryPropertyIndexes.Sensitivity, Sensitivity.Normal);

            if (propertyValue < Sensitivity.Normal || propertyValue > Sensitivity.CompanyConfidential)
            {
                CalendarEvent.CalendarViewTracer.TraceError((long)calendarEvent.GetHashCode(), "{0}: Calendar event with start time {1} and end time {2} in mailbox {3} has invalid sensitivity value: {4}.", new object[]
                {
                    TraceContext.Get(),
                    calendarEvent.StartTime,
                    calendarEvent.EndTime,
                    mailbox,
                    propertyValue
                });
            }
            VersionedId propertyValue2 = CalendarEvent.GetPropertyValue <VersionedId>(properties, QueryPropertyIndexes.EntryId);
            ByteArray   byteArray      = new ByteArray(propertyValue2.ObjectId.ProviderLevelItemId);

            if (allowedView != FreeBusyViewType.Detailed && allowedView != FreeBusyViewType.DetailedMerged)
            {
                return(calendarEvent);
            }
            calendarEvent.CalendarEventDetails = new CalendarEventDetails();
            CalendarEventDetails calendarEventDetails = calendarEvent.CalendarEventDetails;

            calendarEventDetails.IsPrivate = (propertyValue != Sensitivity.Normal);
            if (calendarEventDetails.IsPrivate && !isCallerMailboxOwner)
            {
                CalendarEvent.CalendarViewTracer.TraceError((long)calendarEvent.GetHashCode(), "{0}: Calendar event with start time {1} and end time {2} in mailbox {3} is a private item. Detail data will not be included.", new object[]
                {
                    TraceContext.Get(),
                    calendarEvent.StartTime,
                    calendarEvent.EndTime,
                    mailbox
                });
                return(calendarEvent);
            }
            calendarEventDetails.ID            = byteArray.ToString();
            calendarEventDetails.Subject       = CalendarEvent.GetPropertyValue <string>(properties, QueryPropertyIndexes.Subject);
            calendarEventDetails.Location      = CalendarEvent.GetPropertyValue <string>(properties, QueryPropertyIndexes.Location);
            calendarEventDetails.IsReminderSet = CalendarEvent.GetPropertyValue <bool>(properties, QueryPropertyIndexes.IsReminderSet, false);
            AppointmentStateFlags propertyValue3 = CalendarEvent.GetPropertyValue <AppointmentStateFlags>(properties, QueryPropertyIndexes.AppointmentState, AppointmentStateFlags.None);

            calendarEventDetails.IsMeeting = ((propertyValue3 & AppointmentStateFlags.Meeting) > AppointmentStateFlags.None);
            CalendarItemType propertyValue4 = CalendarEvent.GetPropertyValue <CalendarItemType>(properties, QueryPropertyIndexes.CalendarItemType, CalendarItemType.Single);

            if (propertyValue4 == CalendarItemType.Occurrence)
            {
                calendarEventDetails.IsRecurring = true;
            }
            if (propertyValue4 == CalendarItemType.Exception)
            {
                calendarEventDetails.IsException = true;
                calendarEventDetails.IsRecurring = true;
            }
            return(calendarEvent);
        }
Пример #28
0
 private void Busy(BusyType which)
 {
     Device.Busy(which);
 }
Пример #29
0
 private void processGoHome()
 {
     actualState = BusyType.TRAVELLING;
     traveler.SetTarget(entity.house.transform);
 }
Пример #30
0
 private void processGoHere()
 {
     actualState = BusyType.TRAVELLING;
     traveler.SetTarget(queue[0].need.transform);
 }
 public XsoBusyStatusProperty(BusyType defaultValue, PropertyType type) : base(CalendarItemBaseSchema.FreeBusyStatus, type)
 {
     this.defaultValue = defaultValue;
 }
Пример #32
0
 public void Busy(BusyType which)
 {
     //throw new NotImplementedException();
 }