Ejemplo n.º 1
0
 public void WriteSaveInfo()
 {
     File.WriteAllText(Path.Combine(Location, "nsm_name"), Name);
     File.WriteAllText(Path.Combine(Location, "nsm_group"), Group);
     File.WriteAllText(Path.Combine(Location, "nsm_game_version"), GameVersion);
     File.WriteAllText(Path.Combine(Location, "nsm_last_modified"), LastModified.ToString("yyyy-MM-dd HH:mm:ss"));
 }
Ejemplo n.º 2
0
 public List <string> Properties()
 {
     return(new List <string> {
         FileName, Extension, FileSize.ToString(), FileType, Name, Hidden.ToString(),
         LastModified.ToString(), LastAccessed.ToString(), CreationDate.ToString()
     });
 }
        public string GetEtag()
        {
            using var hasher = MD5.Create();
            var bytes = Encoding.UTF8.GetBytes($"{Id}.{Name}.{LastModified.ToString("s")}");
            var hash  = hasher.ComputeHash(bytes);

            return(Convert.ToBase64String(hash));
        }
Ejemplo n.º 4
0
 /// <summary>
 ///     Converts the Url to an xml node.
 /// </summary>
 /// <returns></returns>
 public XElement ToXml()
 {
     return(new XElement("url", new XElement("loc", Location),
                         new XElement("lastmod", LastModified.ToString("yyyy-MM-ddTHH:mm:sszzz")),
                         new XElement("changefreq", ChangeFrequency),
                         new XElement("priority", Priority.ToString("N1", CultureInfo.InvariantCulture))
                         ));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Lists all of the <see cref="WatchedFile"/>'s properties
 /// </summary>
 public override string ToString()
 {
     return(ShortPath + Environment.NewLine +
            "  Size:          " + ByteCount.ToString("n0") + " bytes" + Environment.NewLine +
            "  Archive:       " + Archive + Environment.NewLine +
            "  Hidden:        " + Hidden + Environment.NewLine +
            "  Readonly:      " + ReadOnly + Environment.NewLine +
            "  Last Opened:   " + LastOpened.ToString(DateFormatString) + Environment.NewLine +
            "  Last Modified: " + LastModified.ToString(DateFormatString));
 }
Ejemplo n.º 6
0
 public override string ToString()
 {
     return(string.Format(
                "Apply\tLastModified:{0},FileSize:{1},AllowRanges:{2},BlockSize:{3},ActuallyChunks{4}",
                LastModified.ToString("yyyy-MM-dd HH:mm:ss"),
                FileSize.ToString(),
                AllowRanges.ToString(),
                BlockSize.ToString(),
                ActuallyChunks.ToString()
                ));
 }
Ejemplo n.º 7
0
        public void UpdateSubtitle()
        {
            if (BuiltIn)
            {
                return;
            }

            Subtitle  = LastModified.ToString();
            Subtitle += " - HP:  " + HP + "/" + MaxHP;
            Subtitle += " - Money:  " + Money;
            Subtitle += " - Seed:  " + Seed;
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     Translate the json document to a <see cref = "JObject" />
        /// </summary>
        /// <returns></returns>
        public JObject ToJson()
        {
            if (Projection != null)
            {
                return(Projection);
            }

            var doc      = new JObject(DataAsJson);        //clone the document
            var metadata = new JObject(Metadata);          // clone the metadata

            metadata["Last-Modified"] = JToken.FromObject(LastModified.ToString("r"));
            var etagProp = metadata.Property("@etag");

            if (etagProp == null)
            {
                etagProp = new JProperty("@etag");
                metadata.Add(etagProp);
            }
            etagProp.Value = new JValue(Etag.ToString());
            doc.Add("@metadata", metadata);
            metadata["Non-Authoritive-Information"] = JToken.FromObject(NonAuthoritiveInformation);
            return(doc);
        }
Ejemplo n.º 9
0
        public virtual void dump(StringBuilder strBuilder)
        {
            strBuilder.AppendLine(Id.ToString());
            strBuilder.AppendLine(Naziv != null ? Naziv : NULL);
            strBuilder.AppendLine(Gimnastika.ToString());
            strBuilder.AppendLine(Datum.ToString());
            strBuilder.AppendLine(Mesto != null ? Mesto : NULL);
            strBuilder.AppendLine(TipTakmicenja.ToString());
            strBuilder.AppendLine(PrvoKolo != null ? PrvoKolo.Id.ToString() : NULL);
            strBuilder.AppendLine(DrugoKolo != null ? DrugoKolo.Id.ToString() : NULL);
            strBuilder.AppendLine(TreceKolo != null ? TreceKolo.Id.ToString() : NULL);
            strBuilder.AppendLine(CetvrtoKolo != null ? CetvrtoKolo.Id.ToString() : NULL);

            strBuilder.AppendLine(VrhovniSudija != null ? VrhovniSudija.Id.ToString() : NULL);

            strBuilder.AppendLine(BrojEOcena.ToString());
            strBuilder.AppendLine(BrojDecimalaD.ToString());
            strBuilder.AppendLine(BrojDecimalaE1.ToString());
            strBuilder.AppendLine(BrojDecimalaE.ToString());
            strBuilder.AppendLine(BrojDecimalaPen.ToString());
            strBuilder.AppendLine(BrojDecimalaTotal.ToString());
            strBuilder.AppendLine(ZavrsenoTak1.ToString());
            strBuilder.AppendLine(ZrebZaFinalePoSpravama != null ? ZrebZaFinalePoSpravama : NULL);
            strBuilder.AppendLine(LastModified.ToString());

            strBuilder.AppendLine(TakmicenjeDescriptions.Count.ToString());
            foreach (RezultatskoTakmicenjeDescription d in TakmicenjeDescriptions)
            {
                d.dump(strBuilder);
            }

            strBuilder.AppendLine(Kategorije.Count.ToString());
            foreach (TakmicarskaKategorija k in Kategorije)
            {
                k.dump(strBuilder);
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                using (XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.UTF8))
                {
                    Nullable <DateTime> ims = IfModifiedSince;

                    if (ims.HasValue)
                    {
                        if (ims.Value.ToUniversalTime() >= LastModified)
                        {
                            Response.StatusCode = 304;
                            return;
                        }
                    }

                    Response.Clear();
                    Response.Cache.SetLastModified(LastModified.ToLocalTime());
                    Response.Cache.SetCacheability(HttpCacheability.Private);
                    Response.ContentType = XmlContentType;
                    Response.AddHeader("Modified", LastModified.ToString("r"));
                    WriteXml(writer);
                    writer.Close();
                }

                Response.End();
            }
            catch (ThreadAbortException)
            {
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Ejemplo n.º 11
0
 public override string ToString()
 {
     return(LastModified.ToString());
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Serializes this instance of <see cref="ApiKey" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ApiKey" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)Name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(Name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)ConnectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(ConnectionString.ToString()) : null, "connectionString", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)Id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(Id.ToString()) : null, "id", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != LastModified ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(LastModified?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModified", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != ReadOnly ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonBoolean((bool)ReadOnly) : null, "readOnly", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)Value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(Value.ToString()) : null, "value", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 13
0
 public override string ToString()
 {
     return(Name + "\t" + LastModified.ToString("d"));
 }
Ejemplo n.º 14
0
 public void UpdateDB()
 {
     DataSource.Update(Strings.DailyStats, Strings.RevNew + "='" + TodaysStats.RevFromNew + "'," + Strings.RevOld + "='" + TodaysStats.RevFromOld + "'", Strings.Day + "='" + TodaysStats.Today.Day + "' AND " + Strings.Month + "='" + TodaysStats.Today.Month + "' AND " + Strings.Year + "='" + TodaysStats.Today.Year + "'");
     DataSource.Update(Strings.Stats, Strings.Count + "='" + count + "'," + Strings.RevNew + "='" + RevenueFromNew + "'," + Strings.RevOld + "='" + RevenueFromOld + "'", Strings.LastModified + "='" + LastModified.ToString("yyyyMMdd ") + DateTime.Today.ToString().Split(' ')[1] + "'");
 }