예제 #1
0
        /// <summary>
        /// Saves the options to the specified writer.
        /// </summary>
        public void Save(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            StringBuilder sb = new StringBuilder()
                               .AppendLine("[TeleCommand]")
                               .Append("CommandID=").AppendLine(CommandID.ToString())
                               .Append("CreationTime=").AppendLine(CreationTime.ToString(DateTimeFormatInfo.InvariantInfo))
                               .Append("ClientName=").AppendLine(ClientName)
                               .Append("UserID=").AppendLine(UserID.ToString())
                               .Append("CnlNum=").AppendLine(CnlNum.ToString())
                               .Append("ObjNum=").AppendLine(ObjNum.ToString())
                               .Append("DeviceNum=").AppendLine(DeviceNum.ToString())
                               .Append("CmdNum=").AppendLine(CmdNum.ToString())
                               .Append("CmdCode=").AppendLine(CmdCode)
                               .Append("CmdVal=").AppendLine(CmdVal.ToString(NumberFormatInfo.InvariantInfo))
                               .Append("CmdData=").AppendLine(ScadaUtils.BytesToHex(CmdData))
                               .Append("RecursionLevel=").AppendLine(RecursionLevel.ToString())
                               .AppendLine("End=");

            using (StreamWriter writer = new StreamWriter(stream, Encoding.UTF8, 1024, true))
            {
                writer.Write(sb.ToString());
            }
        }
예제 #2
0
 public DummyDataClass(int key, double value)
 {
     DataKey            = key;
     Value              = value;
     CreationTime       = DateTimeOffset.Now;
     FormattedStoreTime = CreationTime.ToString("dd-MMM-yy HH:mm:ss.ffff");
 }
예제 #3
0
        public override string ToString()
        {
            string text = string.Empty;


            text += SessionId;
            text += ",";
            text += HasLogin;
            text += ",";
            text += UserName;
            text += ",";
            text += CreationTime.ToString("yyyy-MM-dd HH:mm tt");
            text += ",";
            text += LifeTimeMinute.ToString();
            text += ",";

            text += "|";
            foreach (var claim in Claims)
            {
                text += claim.ToString();
                text += ",";
            }

            text += ".";
            text += Signature;
            return(text);
        }
예제 #4
0
        /// <summary>
        /// Saves the command to the specified file.
        /// </summary>
        public bool Save(string fileName, out string errMsg)
        {
            try
            {
                StringBuilder sb = new StringBuilder("[TeleCommand]")
                                   .Append("CommandID=").AppendLine(CommandID.ToString())
                                   .Append("CreationTime=").AppendLine(CreationTime.ToString(DateTimeFormatInfo.InvariantInfo))
                                   .Append("UserID=").AppendLine(UserID.ToString())
                                   .Append("OutCnlNum=").AppendLine(OutCnlNum.ToString())
                                   .Append("CmdTypeID=").AppendLine(CmdTypeID.ToString())
                                   .Append("ObjNum=").AppendLine(ObjNum.ToString())
                                   .Append("DeviceNum=").AppendLine(DeviceNum.ToString())
                                   .Append("CmdNum=").AppendLine(CmdNum.ToString())
                                   .Append("CmdCode=").AppendLine("CmdCode")
                                   .Append("CmdVal=").AppendLine(CmdVal.ToString(NumberFormatInfo.InvariantInfo))
                                   .Append("CmdData=").AppendLine(ScadaUtils.BytesToHex(CmdData))
                                   .Append("RecursionLevel=").AppendLine(RecursionLevel.ToString())
                                   .AppendLine("End=");

                using (StreamWriter writer = new StreamWriter(fileName, false, Encoding.UTF8))
                {
                    writer.Write(sb.ToString());
                }

                errMsg = "";
                return(false);
            }
            catch (Exception ex)
            {
                errMsg = string.Format(Locale.IsRussian ?
                                       "Ошибка при сохранении команды ТУ: " :
                                       "Error saving telecontrol command: ") + ex.Message;
                return(false);
            }
        }
예제 #5
0
        public override ListViewItem ToListViewItem()
        {
            ListViewItem lvi = new ListViewItem();

            lvi.Text       = Name;
            lvi.Tag        = this;
            lvi.ImageIndex = Win32.GetFileIconIndex(Name, Win32.FileIconSize.Small);
            if (Length > 0)
            {
                lvi.SubItems.Add(Length.ToKB());
            }
            else
            {
                lvi.SubItems.Add(string.Empty);
            }
            lvi.SubItems.Add(CreationTime.ToString("g"));
            lvi.SubItems.Add(Attributes.ToString());

            lvi.SubItems.Add(Keywords);
            lvi.SubItems.Add(Extension);
            lvi.SubItems.Add(FileDescription);
            lvi.SubItems.Add(FileVersion);

            lvi.SubItems.Add(GetVolumeUserName());
            lvi.SubItems.Add(GetPath());
            if (Crc != 0)
            {
                lvi.SubItems.Add(Crc.ToString("X"));
            }
            else
            {
                lvi.SubItems.Add(string.Empty);
            }
            return(lvi);
        }
예제 #6
0
        public MainForm(int id, FormData dat = null)
        {
            InitializeComponent();

            FORM_ID     = id;
            CustomTheme = new Theme();
            CustomStyle = new Style();

            loadThemes();
            loadStyles();
            this.AllowTransparency = true;
            this.DoubleBuffered    = true;
            this.StartPosition     = FormStartPosition.Manual;

            LoadData(dat);
            this.DateTimeLabel.Text = CreationTime.ToString();

            //set sure dialog
            Bitmap   image = new Bitmap(sureDialog.Width, sureDialog.Height);
            Graphics g     = Graphics.FromImage(image);
            Brush    brush = new HatchBrush(HatchStyle.OutlinedDiamond, Color.Turquoise, Color.LightBlue);

            g.FillRectangle(brush, 0, 0, sureDialog.Width, sureDialog.Height);
            sureDialog.BackgroundImage       = image;
            sureDialog.BackgroundImageLayout = ImageLayout.Stretch;
        }
예제 #7
0
        void IXmlSerializable.WriteXml(XmlWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            writer.WriteAttributeString(nameof(Id), Id.ToString());
            writer.WriteAttributeString(nameof(ProductName), ProductName);
            writer.WriteAttributeString(nameof(ProductVersion), ProductVersion);
            writer.WriteAttributeString(nameof(CustomerName), CustomerName);
            writer.WriteAttributeString(nameof(UniqueId), UniqueId);
            writer.WriteAttributeString(nameof(CreationTime), CreationTime.ToString("s", CultureInfo.InvariantCulture));
            writer.WriteAttributeString(nameof(ExpirationTime), ExpirationTime.ToString());

            if (_features.Count > 0)
            {
                writer.WriteStartElement(nameof(Features));

                foreach (var feature in _features)
                {
                    writer.WriteStartElement("Feature");

                    writer.WriteAttributeString(nameof(LicenseFeature.Name), feature.Name);
                    writer.WriteAttributeString(nameof(LicenseFeature.Value), feature.Value);
                    writer.WriteAttributeString(nameof(LicenseFeature.DisplayName), feature.DisplayName);

                    if (!string.IsNullOrWhiteSpace(feature.Description))
                    {
                        writer.WriteElementString(nameof(LicenseFeature.Description), feature.Description);
                    }

                    writer.WriteEndElement();
                }

                writer.WriteEndElement();
            }

            if (_attributes.Count <= 0)
            {
                return;
            }

            writer.WriteStartElement(nameof(Attributes));

            foreach (var attribute in _attributes)
            {
                writer.WriteStartElement("Attribute");

                writer.WriteAttributeString("Name", attribute.Key);
                writer.WriteString(attribute.Value);

                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
예제 #8
0
 protected override string[] GetContent()
 {
     return(new[]
     {
         ID.ToString(),
         PreDataGeneration.ToString(),
         CreationTime.ToString(),
         IsDeployed? DeployTime.ToString() : ""
     });
 }
예제 #9
0
        /// <summary>
        /// Creates a string representation of this object.
        /// </summary>
        /// <returns>A string representing the object.</returns>
        public override string ToString()
        {
            return(string.Format("{0}\t{1}{2}\t{3}\t{4}...",
                                 this.ProjectName.IsEmptyOrWhite() ? "NO-PROJ" : this.ProjectName,
                                 this.Name.IsEmptyOrWhite() ? "NO-NAME-SET" : this.Name,
                                 SuccessfulTermination ? "" : "*",
                                 CreationTime.ToString(),
                                 this.ID.ToString().Substring(0, 8)));

            //return "{ Guid = " + ID + "; " + CreationTime.ToString() + " Name = " + Name + " }";
        }
예제 #10
0
 public string ConvertToString()
 {
     return
         (Attributes.ToString()
          + "|" + CreationTime.ToString()
          + "|" + DirectoryName.ToString()
          + "|" + FileName.ToString()
          + "|" + LastAccess.ToString()
          + "|" + LastWrite.ToString()
          + "|" + Security.ToString()
          + "|" + Size.ToString());
 }
예제 #11
0
파일: AppUpdate.cs 프로젝트: Adel-dz/Hub
        protected override string[] GetContent()
        {
            string deployStr = DeployTime == NOT_YET ? "" : (DeployTime == NEVER ? "Ignorée" : DeployTime.ToString());

            return(new[]
            {
                ID.ToString(),
                Version.ToString(),
                AppArchitectures.GetArchitectureName(AppArchitecture),
                CreationTime.ToString(),
                DeployTime == NOT_YET? "" : (DeployTime == NEVER? "Ignorée" : DeployTime.ToString())
            });
        }
예제 #12
0
        public override string ToString()
        {
            string res = "";

            res += string.Format("File: {0}\n", Name);
            res += string.Format("Size: {0}\n", FileDirectorySize);
            res += string.Format("CreationTime: {0}\n", CreationTime.ToString());
            res += string.Format("IsHidden: {0}\n", IsHidden);
            res += string.Format("IsLFN: {0}\n", IsLFN);
            res += string.Format("IsReadOnly: {0}\n", IsReadOnly);
            res += string.Format("IsDir: {0}\n", IsDirectory);
            res += string.Format("IsSystem: {0}\n", IsSystem);
            return(res);
        }
예제 #13
0
 public override void CreateRestore()
 {
     File.Create(FullPath).Close();
     File.WriteAllLines(FullPath, new[]
     {
         "Incremental restore point\n",
         CreationTime.ToString(CultureInfo.CurrentCulture),
         Size.ToString(),
         Name,
         DirectoryName,
         FullPath,
         OriginalFilePath
     });
     BackupLogger.GetInstance().Info($"Incremental restore point at path {FullPath} was created.");
 }
예제 #14
0
        /// <summary>
        /// Loads and calculates date information from the page content.
        /// </summary>
        /// <param name="pageXml">The xml document containing the page content.</param>
        void LoadDates(XmlDocument pageXml)
        {
            CreationTime     = DateTime.Parse(pageXml.GetAttribute("dateTime", ""));
            LastModifiedTime = DateTime.Parse(pageXml.GetAttribute("lastModifiedTime", ""));

            LastAssignedTime = DateTime.Parse(Tag?.GetAttribute("creationDate") ?? CreationTime.ToString());

            if (Helpers.IsWeekday(SectionGroup.Name))
            {
                for (OriginalAssignmentDate = CreationTime.Date; OriginalAssignmentDate.ToString("dddd") != SectionGroup.Name.Capitalized();)
                {
                    OriginalAssignmentDate = OriginalAssignmentDate.AddDays(1);
                }
            }
            else
            {
                OriginalAssignmentDate = LastAssignedTime.Date;
            }
        }
예제 #15
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            if (CreationTime != null)
            {
                output.TagName = "span";
                output.TagMode = TagMode.StartTagAndEndTag;

                TagBuilder icon = new TagBuilder("i");
                icon.AddCssClass("far");
                icon.AddCssClass("fa-calendar");
                output.Content.AppendHtml(icon);

                TagBuilder time = new TagBuilder("time");
                time.Attributes["style"]    = "margin-left: 5px";
                time.Attributes["datetime"] = CreationTime.ToString();
                time.Attributes["title"]    = string.Format("Creation time: {0} / Modification time: {1}", CreationTime.DateTime.ToString("yyyy-MM-dd hh:mm:ss"), ModificationTime.DateTime.ToString("yyyy-MM-dd hh:mm:ss"));
                time.InnerHtml.Append(CreationTime.Date.ToString("yyyy-MM-dd"));
                output.Content.AppendHtml(time);
            }
            base.Process(context, output);
        }
예제 #16
0
        public override ListViewItem ToListViewItem()
        {
            ListViewItem lvi = new ListViewItem();

            lvi.Text       = Name;
            lvi.Tag        = this;
            lvi.ImageIndex = Win32.GetFolderIconIndex("", Win32.FileIconSize.Small);
            lvi.SubItems.Add(string.Empty);
            lvi.SubItems.Add(CreationTime.ToString("g"));
            lvi.SubItems.Add(LastWriteTime.ToString("g"));
            lvi.SubItems.Add(Attributes.ToString());

            lvi.SubItems.Add(Keywords);
            lvi.SubItems.Add(Extension);

            lvi.SubItems.Add(GetVolumeUserName());
            lvi.SubItems.Add(GetPath());

            lvi.SubItems.Add(string.Empty);
            return(lvi);
        }
예제 #17
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            // because max length of the file name can be up to 259 characters and extension also up to 259
            // we need to generalize the name to some format. If we won't do it, the output to a console will be broken.
            var name = Name.Length > 15
                ? Name.Substring(0, 15) + "..."
                : Name;

            sb.Append(name)
            .Append(' ', 20 - name.Length + 3)
            .Append(Size)
            .Append(' ', 10 - Size.ToString().Length + 3)
            .Append(' ', 22 - CreationTime.ToString().Length + 3)
            .Append(CreationTime)
            .Append("\t")
            .Append(Attributes)
            .Append("\t");

            return(sb.ToString());
        }
예제 #18
0
        public string GetDataText()
        {
            string OutputText = "SiiNunit\r\n{\r\n";

            OutputText += "user_profile : " + UserProfileNameless + " {\r\n";
            OutputText += " face: " + Face.ToString() + "\r\n";
            OutputText += " brand: " + Brand + "\r\n";
            OutputText += " map_path: \"" + MapPath + "\"\r\n";
            OutputText += " logo: " + Logo + "\r\n";
            OutputText += " company_name: " + CompanyName + "\r\n";
            OutputText += " male: " + GenederMale.ToString().ToLower() + "\r\n";
            OutputText += " cached_experience: " + CachedExperiencePoints.ToString() + "\r\n";
            OutputText += " cached_distance: " + CachedDistance.ToString() + "\r\n";
            OutputText += " user_data: 17";
            OutputText += " user_data[0]: " + string.IsNullOrEmpty(SomeTimeUD0.ToString()) ?? "\"\"" + "\r\n";
            OutputText += " user_data[1]: \"" + string.IsNullOrEmpty(LicensePlateUD1) + "\"\r\n";
            OutputText += " user_data[2]: " + string.IsNullOrEmpty(SomeCheckSumUD2) ?? "\"\"" + "\r\n";
            OutputText += " user_data[3]: " + string.IsNullOrEmpty(WoTConnectedUD3.ToString()) ?? "\"\"" + "\r\n";
            OutputText += " user_data[4]: \"" + RoadsExploredUD4.ToString() + "\"\r\n";
            OutputText += " user_data[5]: " + DeliveriesFinishedUD5.ToString() + "\r\n";
            OutputText += " user_data[6]: " + OwnedTrucksUD6.ToString() + "\r\n";
            OutputText += " user_data[7]: " + OwnedGaradesSmallUD7.ToString() + "\r\n";
            OutputText += " user_data[8]: " + OwnedGaradesLargeUD8.ToString() + "\r\n";
            OutputText += " user_data[9]: " + GameTimeSpentUD9.ToString() + "\r\n";
            OutputText += " user_data[10]: " + RealTimeSpentUD10.ToString() + "\r\n";
            OutputText += " user_data[11]: \"" + CurrentTruckUD11 + "\"";
            OutputText += " user_data[12]: \"" + string.Join(",", OwnedTruckListUD12) + "\"";
            OutputText += " user_data[13]: " + string.IsNullOrEmpty(SomeUserDataUD13) ?? "\"\"" + "\r\n";
            OutputText += " user_data[14]: " + string.IsNullOrEmpty(SomeUserDataUD14.ToString()) ?? "\"\"" + "\r\n";
            OutputText += " user_data[15]: " + string.IsNullOrEmpty(SomeUserDataUD15) ?? "\"\"" + "\r\n";
            OutputText += " user_data[16]: " + OwnedTrailersUD16.ToString() + "\r\n";

            OutputText += " active_mods: " + ActiveMods.Capacity.ToString() + "\r\n";
            for (int i = 0; i < ActiveMods.Capacity; i++)
            {
                OutputText += " active_mods[" + i.ToString() + "]: " + ActiveMods[i].ToString() + "\r\n";
            }

            OutputText += " customization: " + Customization.ToString() + "\r\n";

            OutputText += " cached_stats: " + CachedStats.Capacity.ToString() + "\r\n";
            for (int i = 0; i < CachedStats.Capacity; i++)
            {
                OutputText += " cached_stats[" + i.ToString() + "]: " + CachedStats[i].ToString() + "\r\n";
            }

            OutputText += " cached_discovery: " + CachedDiscovery.Capacity.ToString() + "\r\n";
            for (int i = 0; i < CachedDiscovery.Capacity; i++)
            {
                OutputText += " cached_discovery[" + i.ToString() + "]: " + CachedDiscovery[i].ToString() + "\r\n";
            }

            OutputText += " version: " + Version.ToString() + "\r\n";
            OutputText += " online_user_name: " + OnlineUserName + "\r\n";
            OutputText += " online_password: "******"\r\n";
            OutputText += " profile_name: " + ProfileName + "\r\n";
            OutputText += " creation_time: " + CreationTime.ToString() + "\r\n";
            OutputText += " save_time: " + SaveTime.ToString() + "\r\n";

            OutputText += "}\r\n\r\n}";

            return(OutputText);
        }
예제 #19
0
 internal virtual string GetCsvLine()
 {
     return(GetItemType() + ",\"" + GetVolumeUserName() + "\",\"" + GetPath() + "\",\"" + Name + "\",\"" + Attributes.ToString() + "\"," + CreationTime.ToString() + ",\"" + Description + "\",\"" + Keywords + "\"," + LastAccessTime.ToString() + "," + LastWriteTime.ToString());
 }
예제 #20
0
        /// <summary>
        /// Serializes this instance of <see cref="Task" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.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.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Task" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != ApiVersion ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ApiVersion) : null, "api_version", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AddIf(null != CompletionTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CompletionTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "completion_time", container.Add);
            AddIf(null != CreationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CreationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creation_time", container.Add);
            if (null != EntityReferenceList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in EntityReferenceList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entity_reference_list", __w);
            }
            AddIf(null != ErrorCode ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ErrorCode) : null, "error_code", container.Add);
            AddIf(null != ErrorDetail ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ErrorDetail) : null, "error_detail", container.Add);
            AddIf(null != LastUpdateTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(LastUpdateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "last_update_time", container.Add);
            AddIf(null != LogicalTimestamp ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((long)LogicalTimestamp) : null, "logical_timestamp", container.Add);
            AddIf(null != OperationType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(OperationType) : null, "operation_type", container.Add);
            AddIf(null != ParentTaskReference ? (Carbon.Json.JsonNode)ParentTaskReference.ToJson(null) : null, "parent_task_reference", container.Add);
            AddIf(null != PercentageComplete ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)PercentageComplete) : null, "percentage_complete", container.Add);
            AddIf(null != ProgressMessage ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ProgressMessage) : null, "progress_message", container.Add);
            AddIf(null != StartTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(StartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "start_time", container.Add);
            AddIf(null != Status ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Status) : null, "status", container.Add);
            if (null != SubtaskReferenceList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in SubtaskReferenceList)
                {
                    AddIf(__s?.ToJson(null), __r.Add);
                }
                container.Add("subtask_reference_list", __r);
            }
            AddIf(null != Uuid ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Uuid) : null, "uuid", container.Add);
            AfterToJson(ref container);
            return(container);
        }
예제 #21
0
        /// <summary>
        /// Serializes this instance of <see cref="UserMetadata" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.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.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="UserMetadata" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            }
            /* serializeToContainerMember (wildcard) doesn't support 'application/json' C:\Users\hugo1\Documents\autorest\autorest.incubator\dist\csharp\schema\wildcard.js*/
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != CreationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CreationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creation_time", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != Kind ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Kind) : null, "kind", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != LastUpdateTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(LastUpdateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "last_update_time", container.Add);
            }
            AddIf(null != OwnerReference ? (Carbon.Json.JsonNode)OwnerReference.ToJson(null) : null, "owner_reference", container.Add);
            AddIf(null != ProjectReference ? (Carbon.Json.JsonNode)ProjectReference.ToJson(null) : null, "project_reference", container.Add);
            AddIf(null != SpecHash ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(SpecHash) : null, "spec_hash", container.Add);
            AddIf(null != SpecVersion ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)SpecVersion) : null, "spec_version", container.Add);
            AddIf(null != Uuid ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Uuid) : null, "uuid", container.Add);
            AfterToJson(ref container);
            return(container);
        }
예제 #22
0
 public override string ToString()
 {
     return(CreationTime.ToString());
 }
예제 #23
0
 public override string ToString()
 {
     return(CreationTime.ToString("yyyy/MM/dd HH:mm:ss.fff ") + value);
 }
예제 #24
0
        /// <summary>
        /// Serializes this instance of <see cref="ImageMetadata" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.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.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ImageMetadata" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            }
            if (null != Categories)
            {
                foreach (var __x in Categories)
                {
                    AddIf(null != __x.Value ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x.Value) : null, (__w) => container.Add(__x.Key, __w));
                }
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != CreationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CreationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creation_time", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != Kind ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Kind) : null, "kind", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != LastUpdateTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(LastUpdateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "last_update_time", container.Add);
            }
            AddIf(null != OwnerReference ? (Carbon.Json.JsonNode)OwnerReference.ToJson(null) : null, "owner_reference", container.Add);
            AddIf(null != ProjectReference ? (Carbon.Json.JsonNode)ProjectReference.ToJson(null) : null, "project_reference", container.Add);
            AddIf(null != SpecHash ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(SpecHash) : null, "spec_hash", container.Add);
            AddIf(null != SpecVersion ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)SpecVersion) : null, "spec_version", container.Add);
            AddIf(null != Uuid ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Uuid) : null, "uuid", container.Add);
            AfterToJson(ref container);
            return(container);
        }
예제 #25
0
 public string GetCreationTimeString()
 {
     return(CreationTime.ToString("s", CultureInfo.InvariantCulture));
 }
예제 #26
0
 /// <summary>
 /// Creates a string representation of this object.
 /// </summary>
 /// <returns>A string representing the object.</returns>
 public override string ToString()
 {
     return("{ Guid = " + ID + "; " + CreationTime.ToString() + " Name = " + Name + " }");
 }
예제 #27
0
        /// <summary>
        /// Serializes this instance of <see cref="VmRecoveryPoint" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.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.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="VmRecoveryPoint" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            AddIf(null != AvailabilityZoneReference ? (Carbon.Json.JsonNode)AvailabilityZoneReference.ToJson(null) : null, "availability_zone_reference", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AddIf(null != CreationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CreationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creation_time", container.Add);
            AddIf(null != ExpirationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ExpirationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "expiration_time", container.Add);
            AddIf(null != RecoveryPointType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(RecoveryPointType) : null, "recovery_point_type", container.Add);
            AddIf(null != Resources ? (Carbon.Json.JsonNode)Resources.ToJson(null) : null, "resources", container.Add);
            AfterToJson(ref container);
            return(container);
        }
예제 #28
0
 public override string ToString()
 {
     return(string.Format("FitFunctionScript {0} (created {1})", FitFunctionName, CreationTime.ToString("yyyy-MM-dd HH:mm:ss")));
 }
예제 #29
0
 public override string ToString()
 {
     return($"ExecutorId:{ExecutorId}; ServiceId:{ServiceIndustryId}; CustomerId:{CustomerId}; Price:{Price}; CreationTime:{CreationTime.ToString("dd-mm-yyyy")}");
 }