Example #1
0
        public static void LoadAll(String filename, SaveType type)
        {
            LastLoadedFile = filename;

            Components.ComponentsManager.VisibilityMap.ignorePlacableRestriction = true;
            switch (type)
            {
                case SaveType.Default:
                    loadAllDefault(filename);
                    break;
                case SaveType.LevelsSave:
                    scriptLocFromFile = true;
                    loadAllLevels(filename);
                    break;
                case SaveType.Levels:
                    scriptLocFromFile = false;
                    loadAllLevels(filename);
                    break;
                case SaveType.LevelDesigner:
                    loadAllLevelDesigner(filename);
                    break;
                default:
                    break;
            }
            Components.ComponentsManager.VisibilityMap.ignorePlacableRestriction = false;
        }
Example #2
0
 /// <summary>
 /// Constructor to initialize save type and the campaign data object to edit
 /// </summary>
 public AddCampaign(SaveType eSaveType, ObjectCampaign.CampaignInstance objCampaign)
 {
     InitializeComponent();
     m_objCampaign = objCampaign;
     m_eSaveType = eSaveType;
     this.InitializeModule();
 }
 public void ShouldntThrowException(SaveType saveType)
 {
     using (var conn = Create(null, null, true))
     {
         var Server = GetServer(conn);
         Server.Save(saveType);
     }
 }
Example #4
0
 /// <summary>
 /// Save meta to the Blam Cache File
 /// </summary>
 public MetaWriter(IWriter writer, uint baseOffset, ICacheFile cache, SaveType type, FieldChangeSet changes)
 {
     _writer = writer;
     _baseOffset = baseOffset;
     _cache = cache;
     _type = type;
     _changes = changes;
 }
Example #5
0
 public async override void GetImageByImageUrl(MangaPageItem pageItem, SaveType saveType = SaveType.Temp)
 {
     string imgUrl = pageItem.WebImageUrl;
     //Get Image 
     //To Do
     string fileRealPath = "/Assets/ApplicationIcon.png";
     pageItem.SetImage(fileRealPath);
     return;
 }
Example #6
0
 /// <summary>
 /// Constructor to initialize save type and the user data object to edit
 /// </summary>
 public AddUser(SaveType eSaveType, ObjectUser.UserInstance objUser)
 {
     this.Visible = false;
     InitializeComponent();
     m_objUser = objUser;
     m_eSaveType = eSaveType;
     this.Visible = true;
     this.layoutControlItemSIP.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
 }
    /// <summary>
    /// Sets various values, hooks, and jquery elements to run the tool.
    /// </summary>
    /// <param name="e"></param>
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        // Add resources dynamically so can resolve the url.
        ScriptHelper.RegisterScriptFile(this.Page, ResolveUrl("~/CMSModules/RelationshipsExtended/Controls/RelatedCategories_Files/jquery.js"));
        ScriptHelper.RegisterScriptFile(this.Page, ResolveUrl("~/CMSModules/RelationshipsExtended/Controls/RelatedCategories_Files/AdvancedCategorySelector.js"));

        PossibleCategories            = new List <CategoryInfo>();
        tbxOnlyLeafSelectable.Text    = OnlyLeafSelectable.ToString();
        tbxParentSelectsChildren.Text = (OnlyLeafSelectable ? ParentSelectsChildren.ToString() : "False");
        // Set Enum Values
        switch (SaveMode)
        {
        case "ToCategories":
            SaveModeVal = SaveType.ToCategory;
            break;

        case "ToNodeCategories":
            // Same as Join table but with presets
            SaveModeVal = SaveType.ToJoinTable;
            JoinTableThisObjectForeignKey = "NodeID";
            JoinTableName                      = "CMS.TreeCategory";
            JoinTableLeftFieldName             = "NodeID";
            JoinTableRightFieldName            = "CategoryID";
            JoinTableGUIDFieldOverride         = "";
            JoinTableLastModifiedFieldOverride = "";
            JoinTableCodeNameFieldOverride     = "";
            JoinTableSiteIDFieldOverride       = "";
            FieldSaveMode                      = "ID";
            break;

        case "ToJoinTable":
            SaveModeVal = SaveType.ToJoinTable;
            break;
        }

        switch (FieldSaveMode)
        {
        case "ID":
            FieldSaveModeVal = FieldSaveType.ID;
            break;

        case "GUID":
            FieldSaveModeVal = FieldSaveType.GUID;
            break;

        case "CategoryName":
            FieldSaveModeVal = FieldSaveType.CategoryName;
            break;
        }

        // Set the mode based on the field.
        DisplayMode                        = (CategoryDisplayMode == "Tree" ? DisplayType.Tree : DisplayType.List);
        btnSearch.OnClientClick            = "SearchCategories('.FormTool_" + this.ID + "');return false;";
        tvwCategoryTree.LineImagesFolder   = "~/CMSModules/RelationshipsExtended/Controls/RelatedCategories_Files";
        tvwCategoryTree.NodeStyle.CssClass = "InputNode";
    }
Example #8
0
        private string SaveConsultationApply(SaveType saveType, string consultApplySN, ConsultStatus status)
        {

            string typeID = Convert.ToString((int)saveType);
            string consultSuggestion = memoConsultSuggestion.Text.Trim();
            string finishTime = dateEditConsultationDate.Text + " " + timeEditConsultationTime.Text;

            return Dal.DataAccess.InsertConsultationApply(typeID, consultApplySN, m_ConsultationEntity.NoOfInpat, consultSuggestion, finishTime, Convert.ToString((int)status));
        }
Example #9
0
        /// <summary>
        ///     Save the DB in background asynchronous.
        /// </summary>
        /// <param name="saveType"></param>
        public async void SaveAsync(SaveType saveType)
        {
            var endPoints = Database.Multiplexer.GetEndPoints();

            foreach (var endpoint in endPoints)
            {
                await Database.Multiplexer.GetServer(endpoint).SaveAsync(saveType);
            }
        }
Example #10
0
 public TValidationBuilder Presence(Func <TDocument, bool> unless = null, SaveType on = SaveType.Any)
 {
     _validators.Add(new PresenceValidator <TDocument>
     {
         Unless = unless,
         On     = on
     });
     return((TValidationBuilder)this);
 }
Example #11
0
 // Token: 0x0600065B RID: 1627 RVA: 0x00026384 File Offset: 0x00024784
 public void Delete_Picture(SaveDataFormat sData, SaveType sType, int chgIdx)
 {
     if (sType != SaveType.Album)
     {
         if (sType == SaveType.Temp)
         {
             Debug.Log(string.Concat(new object[]
             {
                 "[SaveManager] 写真を削除します: sType = ",
                 sType,
                 " / chgIdx = ",
                 chgIdx,
                 "[",
                 this.tmp_Path.Count,
                 "] name [",
                 this.tmp_Path.Count,
                 "] = ",
                 this.tmp_Path[chgIdx]
             }));
             if (File.Exists(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx]))
             {
                 File.Delete(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx]);
             }
             if (File.Exists(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx] + ".back"))
             {
                 File.Delete(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx] + ".back");
             }
             this.tmp_Path.RemoveAt(chgIdx);
         }
     }
     else
     {
         Debug.Log(string.Concat(new object[]
         {
             "[SaveManager] 写真を削除します: sType = ",
             sType,
             " / chgIdx = ",
             chgIdx,
             "[",
             this.album_Path.Count,
             "] name[",
             this.album_Path.Count,
             "] = ",
             this.album_Path[chgIdx]
         }));
         if (File.Exists(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx]))
         {
             File.Delete(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx]);
         }
         if (File.Exists(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx] + ".back"))
         {
             File.Delete(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx] + ".back");
         }
         this.album_Path.RemoveAt(chgIdx);
     }
     this.Update_PictureIndex();
 }
Example #12
0
        public static Dictionary <string, List <byte> > GetFiledAcreData(SaveType saveType, string language = "en")
        {
            StreamReader contents;
            var          acreDbLocation = MainForm.AssemblyLocation + "\\Resources\\";

            if (saveType == SaveType.WildWorld)
            {
                acreDbLocation += "WW_Acres_" + language + ".txt";
            }
            try { contents = File.OpenText(acreDbLocation); }
            catch (Exception e)
            {
                MainForm.DebugManager.WriteLine(
                    $"An error occured opening acre database file:\n\"{acreDbLocation}\"\nError Info:\n{e.Message}", DebugLevel.Error);
                return(null);
            }
            var    filedList = new Dictionary <string, List <byte> >();
            string line;
            var    currentAcreType = "Unsorted";

            while ((line = contents.ReadLine()) != null)
            {
                if (line.Contains("//"))
                {
                    if (currentAcreType != "Unsorted")
                    {
                        if (!filedList.ContainsKey(currentAcreType))
                        {
                            filedList.Add(currentAcreType, new List <byte>());
                        }
                    }
                    currentAcreType = line.Replace("//", "");
                }
                else if (line.Contains("0x"))
                {
                    if (!filedList.ContainsKey(currentAcreType))
                    {
                        filedList.Add(currentAcreType, new List <byte>());
                    }
                    string acreIdString = line.Substring(0, 4), acreName = line.Substring(5);
                    if (byte.TryParse(acreIdString.Replace("0x", ""), NumberStyles.AllowHexSpecifier, null, out var acreId))
                    {
                        filedList[currentAcreType].Add(acreId);
                    }
                    else
                    {
                        MainForm.DebugManager.WriteLine("Unable to add Acre: " + acreIdString + " | " + acreName, DebugLevel.Error);
                    }
                }
            }

            contents.Close();
            contents.Dispose();

            return(filedList);
        }
Example #13
0
        static void SaveWorkFile(SaveType type, string path = "")
        {
            string file_text = "";

            if (type == SaveType.Counter)
            {
                file_text += "=== " + PROGRAM + " - " + VERSION + " ===" + "\r\n";
                file_text += DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "\r\n";
            }

            // MAKE FILE TEXT
            if (type == SaveType.Counter)
            {
                for (int i = 0; i < Count.count; i++)
                {
                    file_text += Random.players[i] + " - " + Count.counter[i] + "\r\n";
                }
            }
            else if (type == SaveType.Log)
            {
                file_text += Log.log;
            }

            // SAVE TO FILE
            try
            {
                if (path == "")
                {
                    string date = DateTime.Now.ToShortDateString() + "-" + DateTime.Now.Hour + "." + DateTime.Now.Minute + "." + DateTime.Now.Second + "." + DateTime.Now.Millisecond;

                    if (type == SaveType.Counter)
                    {
                        path = "counter-" + date + ".txt";
                    }
                    else if (type == SaveType.Log)
                    {
                        path = "log-" + date + ".txt";
                    }
                }

                if (File.Exists(path))
                {
                    File.AppendAllText(path, "\r\n" + file_text);
                }
                else
                {
                    File.AppendAllText(path, file_text);
                }

                Console.WriteLine("File saved - " + path);
            }
            catch (Exception e)
            {
                Console.WriteLine("! Error while saving file \r\n[" + e.ToString() + "]");
            }
        }
Example #14
0
        public object CaptureSaveData(SaveType saveType)
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (sceneName == "TransitionRoom" || sceneName == "Village")
            {
                return(null);
            }
            return(slots[5].ability.remainingUses);
        }
Example #15
0
        public static void ThreadSave(Action callback, Area area, SaveType saveType, bool old = false, string path = null)
        {
            // new Thread(() => {
            Save(area, saveType, old, path);
            callback?.Invoke();

            // }) {
            //  Priority = ThreadPriority.Lowest
            // }.Start();
        }
Example #16
0
 public TValidationBuilder Length(int minimum = 0, int maximum = int.MaxValue,
                                  Func <TDocument, bool> unless = null, SaveType on = SaveType.Any)
 {
     _validators.Add(new StringLengthValidator <TDocument>(minimum, maximum)
     {
         Unless = unless,
         On     = on
     });
     return((TValidationBuilder)this);
 }
 public override void Reset()
 {
     saveType      = SaveType.xml;
     sortType      = SortType.descending;
     sortBy        = SortBy.score;
     publicCode    = null;
     highscoreList = null;
     ListSize      = null;
     errorMessage  = "";
 }
 public DocumentValidationContext(TDocument document,
                                  object parentDocument, string parentPropertyName,
                                  SaveType saveType, ValidationContext validationContext)
 {
     _document           = document;
     _parentDocument     = parentDocument;
     _parentPropertyName = parentPropertyName;
     _saveType           = saveType;
     _validationContext  = validationContext;
 }
Example #19
0
        public object CaptureSaveData(SaveType saveType)
        {
            List <object> saveData = new List <object>();

            foreach (var item in connectedBank.ShowLoot())
            {
                saveData.Add(item.GetSaveData());
            }
            return(saveData);
        }
Example #20
0
    /// <summary> 클라이언트에 저장하기 </summary>
    /// <param name="type"> 저장하고자 하는 타입 (중복불가,데이터가 덧붙여짐)</param>
    /// <param name="data"> 저장하고자 하는 데이터 List<T> or Data Class </param>
    /// <returns></returns>
    public static IEnumerator Save(SaveType type, object data)
    {
        var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

        using (Stream fileStream = File.Open(Application.persistentDataPath + "/" + type.ToString() + ".dat", FileMode.Create))
        {
            formatter.Serialize(fileStream, data);
            yield break;
        }
    }
Example #21
0
        public void Save()
        {
            SaveType saveType  = SaveType.BackgroundSave;
            var      endPoints = Database.Multiplexer.GetEndPoints();

            foreach (var endpoint in endPoints)
            {
                Database.Multiplexer.GetServer(endpoint).Save(saveType);
            }
        }
Example #22
0
        public async Task SaveAsync()
        {
            SaveType saveType  = SaveType.BackgroundSave;
            var      endPoints = database.Multiplexer.GetEndPoints();

            foreach (var endpoint in endPoints)
            {
                await database.Multiplexer.GetServer(endpoint).SaveAsync(saveType);
            }
        }
Example #23
0
        public static Dictionary <ushort, string> GetItemInfo(SaveType Save_Type, string Language = "en")
        {
            StreamReader Contents         = null;
            string       Item_DB_Location = NewMainForm.Assembly_Location + "\\Resources\\";

            if (Save_Type == SaveType.Wild_World)
            {
                Item_DB_Location += "WW_Items_" + Language + ".txt";
            }
            else if (Save_Type == SaveType.Animal_Crossing)
            {
                Item_DB_Location += "AC_Items_" + Language + ".txt";
            }
            else if (Save_Type == SaveType.City_Folk)
            {
                Item_DB_Location += "CF_Items_" + Language + ".txt";
            }
            else if (Save_Type == SaveType.New_Leaf)
            {
                Item_DB_Location += "NL_Items_" + Language + ".txt";
            }
            else if (Save_Type == SaveType.Welcome_Amiibo)
            {
                Item_DB_Location += "WA_Items_" + Language + ".txt";
            }
            try { Contents = File.OpenText(Item_DB_Location); }
            catch (Exception e)
            {
                NewMainForm.Debug_Manager.WriteLine(string.Format("An error occured opening item database file:\n\"{0}\"\nError Info:\n{1}", Item_DB_Location, e.Message), DebugLevel.Error);
                return(null);
            }
            Dictionary <ushort, string> Item_Dictionary = new Dictionary <ushort, string>();
            string Line;

            while ((Line = Contents.ReadLine()) != null)
            {
                if (!Properties.Settings.Default.DebuggingEnabled && Line.Contains("//"))
                {
                    MessageBox.Show("Now loading item type: " + Line.Replace("//", ""));
                }
                else if (Line.Contains("0x"))
                {
                    string Item_ID_String = Line.Substring(0, 6), Item_Name = Line.Substring(7).Trim();
                    if (ushort.TryParse(Item_ID_String.Replace("0x", ""), NumberStyles.AllowHexSpecifier, null, out ushort Item_ID))
                    {
                        Item_Dictionary.Add(Item_ID, Item_Name);
                    }
                    else
                    {
                        NewMainForm.Debug_Manager.WriteLine("Unable to add item: " + Item_ID_String + " | " + Item_Name, DebugLevel.Error);
                    }
                }
            }
            return(Item_Dictionary);
        }
Example #24
0
        public ACString(byte[] stringBuffer, SaveType saveType)
        {
            Save_Type    = saveType;
            String_Bytes = stringBuffer;
            switch (saveType)
            {
            case SaveType.Doubutsu_no_Mori:
            case SaveType.Doubutsu_no_Mori_Plus:
            case SaveType.Doubutsu_no_Mori_e_Plus:
                Char_Dictionary = StringUtility.Doubutsu_no_Mori_e_Plus_Char_Map;
                break;

            case SaveType.Animal_Crossing:
                Char_Dictionary = StringUtility.AC_CharacterDictionary;
                break;

            case SaveType.Wild_World:
                Char_Dictionary = StringUtility.WW_CharacterDictionary;
                break;

            default:
                Char_Dictionary = null;
                break;
            }
            if ((saveType == SaveType.Doubutsu_no_Mori || saveType == SaveType.Doubutsu_no_Mori_Plus || saveType == SaveType.Animal_Crossing || saveType == SaveType.Doubutsu_no_Mori_e_Plus ||
                 saveType == SaveType.Wild_World) && Char_Dictionary != null)
            {
                foreach (byte b in stringBuffer)
                {
                    if (Char_Dictionary.ContainsKey(b))
                    {
                        String += Char_Dictionary[b];
                    }
                    else
                    {
                        String += Encoding.UTF8.GetString(saveType == SaveType.Wild_World ? StringUtility.Fix_Wild_World_String(new byte[1] {
                            b
                        }) : new byte[1] {
                            b
                        });
                    }
                }
            }
            else if (saveType == SaveType.City_Folk)
            {
                for (int i = 0; i < stringBuffer.Length; i += 2)
                {
                    String += Encoding.Unicode.GetString(stringBuffer.Skip(i).Take(2).Reverse().ToArray());
                }
            }
            else if (saveType == SaveType.New_Leaf || saveType == SaveType.Welcome_Amiibo)
            {
                String = Encoding.Unicode.GetString(stringBuffer);
            }
        }
Example #25
0
        public override List <ISaveable> GetSaveableRefs(SaveType type)
        {
            List <ISaveable> parentRefs = base.GetSaveableRefs(type);

            if (parentRefs == null)
            {
                parentRefs = new List <ISaveable>();
            }
            parentRefs.Add(stage);
            return(parentRefs);
        }
Example #26
0
 public object CaptureSaveData(SaveType saveType)
 {
     if (saveType == SaveType.All)
     {
         return(killAmount);
     }
     else
     {
         return(null);
     }
 }
Example #27
0
        public List <ISaveable> GetSaveableRefs(SaveType type)
        {
            List <ISaveable> refs = new List <ISaveable>();

            foreach (ISaveable reference in this)
            {
                refs.Add(reference);
            }

            return(refs);
        }
Example #28
0
        Message GetSaveMessage(SaveType type, CommandFlags flags = CommandFlags.None)
        {
            switch (type)
            {
            case SaveType.BackgroundRewriteAppendOnlyFile: return(Message.Create(-1, flags, RedisCommand.BGREWRITEAOF));

            case SaveType.BackgroundSave: return(Message.Create(-1, flags, RedisCommand.BGSAVE));

            default:  throw new ArgumentOutOfRangeException("type");
            }
        }
Example #29
0
        public static LoadResponse Load(BinaryReader reader, SaveType saveType)
        {
            /* 0 - Depersist object table. */
            uint rootId    = 0;
            bool rootFound = false;
            Dictionary <uint, ISaveable> objectTable = new Dictionary <uint, ISaveable>();

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                uint   objectId = reader.ReadUInt32();
                String assemblyQualifiedTypeName = reader.ReadString();
                bool   isRoot = reader.ReadBoolean();
                if (isRoot && rootFound)
                {
                    throw new NotSupportedException("More than one root object defined in the save file!");
                }
                else if (isRoot)
                {
                    rootFound = true;
                    rootId    = objectId;
                }

                ISaveable loadedObject = constructType(assemblyQualifiedTypeName, objectId);
                loadedObject.Load(reader, saveType);

                objectTable.Add(loadedObject.GetId(), loadedObject);
            }

            if (rootFound == false)
            {
                throw new NotSupportedException("No root object defined in the save file!");
            }

            /* 1 - Inflate all objects */
            inflateObjects(objectTable, saveType);

            /* 2 - Construct the result object */
            List <ISaveable> values = new List <ISaveable>();

            foreach (ISaveable saveable in objectTable.Values)
            {
                values.Add(saveable);
            }

            LoadResponse response = new LoadResponse();

            response.root    = objectTable[rootId];
            response.objects = values;

            /* 3 - Return the response object */
            return(response);
        }
Example #30
0
        ResultProcessor <bool> GetSaveResultProcessor(SaveType type)
        {
            switch (type)
            {
            case SaveType.BackgroundRewriteAppendOnlyFile: return(ResultProcessor.DemandOK);

            case SaveType.BackgroundSave: return(ResultProcessor.BackgroundSaveStarted);

            default: throw new ArgumentOutOfRangeException("type");
            }
        }
Example #31
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="saveType"></param>
 /// <param name="propertyNames"></param>
 public ScriptValidator(SaveType saveType, string[] propertyNames)
 {
     if (propertyNames == null || propertyNames.Length == 0)
     {
         return;
     }
     OrmObject     = Winner.Creator.Get <IOrm>().GetOrm(typeof(T).FullName);
     Validations   = Winner.Creator.Get <IValidation>().GetValidations(typeof(T).FullName);
     SaveType      = saveType;
     PropertyNames = propertyNames;
 }
Example #32
0
        private static Dictionary <int, byte> GetNonCatalogFields(SaveType saveType)
        {
            switch (saveType)
            {
            case SaveType.AnimalCrossing:
                return(AnimalCrossingCatalogBitmap);

            default:
                return(null);
            }
        }
 public void Save(SaveType saveType = SaveType.BackgroundSave, CommandFlags flags = CommandFlags.None)
 {
     try
     {
         _redisServer?.Save(saveType, flags);
     }
     catch (Exception e)
     {
         LogError(e);
     }
 }
Example #34
0
        public static String ToFileExtension(this SaveType saveType)
        {
            switch (saveType)
            {
            case SaveType.Json: return(".json");

            case SaveType.Xml: return(".xml");

            default: throw new NotImplementedException();
            }
        }
Example #35
0
        public static int GetHouseUpgradeSize(int Offset, SaveType Save_Type)
        {
            switch (Save_Type)
            {
            case SaveType.Doubutsu_no_Mori_e_Plus:
                return((MainForm.Save_File.Working_Save_Data[Offset + 0x26] >> 2) & 7);

            default:
                return(0);
            }
        }
Example #36
0
        /// <summary>
        /// Save Fhir item
        /// </summary>
        public static void Save(this Base fhirBase, String path, SaveType saveType)
        {
            switch (saveType)
            {
            case SaveType.Json: fhirBase.SaveJson(path + ".json"); break;

            case SaveType.Xml: fhirBase.SaveXml(path + ".xml"); break;

            default: throw new NotImplementedException();
            }
        }
Example #37
0
        /// <summary>
        ///     上传文件
        /// </summary>
        /// <param name="files">获取要上传的文件</param>
        /// <param name="filePath">要保存的文件路径,</param>
        /// <param name="lstFileType">允许上传的文件类型,大小,单位为KB,Size=0表示无任何限制</param>
        /// <param name="saveType">保存方式:1:按时间取名</param>
        public List<stuUpLoadFile> Upload(HttpFileCollection files, string filePath,
                                          SaveType saveType = SaveType.DateTime,
                                          List<stuUpLoadFileType> lstFileType = null)
        {
            var lstUpLoadFile = new List<stuUpLoadFile>();
            foreach (HttpPostedFile file in files)
            {
                lstUpLoadFile.Add(Upload(file, filePath, saveType, lstFileType));
            }

            return lstUpLoadFile;
        }
        /// <summary>
        /// Save pressure loss report to a file according to customer's settings.
        /// </summary>
        public bool SaveReportToFile(string fileName, PressureLossReportData settings, SaveType eSaveType)
        {
            // TODO
             if (eSaveType == SaveType.HTML)
            writer = new SaveDataToHTML();
             else
            writer = new SaveDataToCSV();

             PressureLossReportHelper.instance.ReportData = settings;

             return writer.save(fileName, settings);
        }
Example #39
0
        /// <summary>
        /// Save meta to the Blam Cache File
        /// </summary>
        public MetaWriter(IWriter writer, uint baseOffset, ICacheFile cache, BuildInformation buildInfo, SaveType type, FieldChangeSet changes)
        {
            _writer = writer;
            _baseOffset = baseOffset;
            _cache = cache;
            _type = type;
            _changes = changes;

            // Load layouts
            _reflexiveLayout = buildInfo.GetLayout("reflexive");
            _tagRefLayout = buildInfo.GetLayout("tag reference");
            _dataRefLayout = buildInfo.GetLayout("data reference");
        }
Example #40
0
 /// <summary>
 /// Copies a list of Craft Info to a folder. SaveType determes the folder, where Hangar is the defined plugin Hangar folder
 /// and Save is the save file passed in by the optional parameter.
 /// </summary>
 /// <param name="craftsToCopy">List of CraftInfo to copy</param>
 /// <param name="saveType">Type of save being copied into</param>
 /// <param name="save">Optional name of a save to copy into</param>
 public void CopyCraftToSave(List<CraftInfo> craftsToCopy, SaveType saveType, string save = null)
 {
     if (saveType == SaveType.Hangar)
     {
         foreach (CraftInfo craft in craftsToCopy)
             CopyExistingCraft(Util.FolderNameHangar, craft);
     }
     else if (saveType == SaveType.Save && save != null)
     {
         foreach (CraftInfo craft in craftsToCopy)
             CopyExistingCraft(save, craft);
     }
 }
Example #41
0
        public ImageRaker(string saveFolder, FilePathMaker.FileNameMakingMethod fileNameMakingMethod, SaveType saveType)
        {
            this.saveFolder = saveFolder;
            this.fileNameMakingMethod = fileNameMakingMethod;
            //this.overwrite = overwrite;
            this.saveType = saveType;

            Directory.CreateDirectory(saveFolder);

            filePathMaker = new FilePathMaker(saveFolder);

            Logger.Log("Imageraker created. savefolder: {0}, filenamemakingmethod: {1}",
                        saveFolder, fileNameMakingMethod);
        }
Example #42
0
        public SaveFileGump( Mobile mobile, ArrayList argsList, SaveType savetype, string filename )
            : base(0,0)
        {
            gumpMobile = mobile;

            ArgsList = argsList;
            GetArgsList();

            GetTextColors();

            saveType = savetype;
            FileName = filename;

            AddPage(0); // Page 0

            MC.DisplayStyle( this, StyleTypeConfig, 180, 180, 340, 120 );

            MC.DisplayBackground( this, BackgroundTypeConfig, 200, 200, 300, 40 );
            MC.DisplayBackground( this, BackgroundTypeConfig, 200, 260, 300, 20 );

            AddHtml( 221, 181, 280, 20, MC.ColorText( titleTextColor, "Save File" ), false, false );

            switch ( saveType )
            {
                case SaveType.FileEdit:
                {
                    AddHtml( 201, 201, 280, 20, MC.ColorText( defaultTextColor, "Are you sure you want to save file:" ), false, false );
                    AddHtml( 201, 221, 280, 20, MC.ColorText( defaultTextColor, FileName ), false, false );

                    break;
                }
                default:
                {
                    AddHtml( 201, 201, 280, 20, MC.ColorText( defaultTextColor, "Type in a filename without an extension:" ), false, false );
                    MC.DisplayBackground( this, ActiveTEBGTypeConfig, 200, 220, 300, 18 );
                    AddTextEntry( 200, 220, 300, 15, ActiveTextEntryTextColor, 0, "" );

                    break;
                }
            }

            AddHtml( 441, 261, 60, 20, MC.ColorText( defaultTextColor, "Cancel" ), false, false );
            AddButton( 400, 260, 4017, 4019, 0, GumpButtonType.Reply, 0 );

            AddHtml( 241, 261, 60, 20, MC.ColorText( defaultTextColor, "Ok" ), false, false );
            AddButton( 200, 260, 4023, 4025, 1, GumpButtonType.Reply, 0 );

            CompileSpawnerList();
        }
Example #43
0
        /// <summary>
        ///     Save meta to the Blam Cache File
        /// </summary>
        public MetaWriter(IWriter writer, uint baseOffset, ICacheFile cache, EngineDescription buildInfo, SaveType type,
			FieldChangeSet changes, Trie stringIdTrie)
        {
            _writer = writer;
            _baseOffset = baseOffset;
            _cache = cache;
            _type = type;
            _changes = changes;
            _stringIdTrie = stringIdTrie;

            // Load layouts
            _reflexiveLayout = buildInfo.Layouts.GetLayout("reflexive");
            _tagRefLayout = buildInfo.Layouts.GetLayout("tag reference");
            _dataRefLayout = buildInfo.Layouts.GetLayout("data reference");
        }
Example #44
0
        public override string GetImageByImageUrl(MangaPageItem page, SaveType saveType = SaveType.Temp)
        {
            string imgUrl = GetImageUrl(page.PageUrl);
            return imgUrl;

            ////Get Image
            //string extention = imgUrl.Substring(imgUrl.LastIndexOf("."));
            //HttpWebRequest request = (HttpWebRequest)WebRequest.Create(imgUrl);
            //CookieContainer cc = new CookieContainer();
            //var res = request.GetResponseAsync();
            //HttpWebResponse myResponse = (HttpWebResponse)res.Result;
            //string folder = page.Chapter.Menu.Title + "\\" + page.Chapter.Title + "\\" ;
            //var res2 = FileService.SaveFile(myResponse.GetResponseStream(), (int)myResponse.ContentLength, folder, page.PageNum + extention,saveType);
            //string path = res2;
            //return path;
        }
        internal static bool Save(IControlManager cm, SaveType saveType)
        {
            if (cm.State == StateType.Edit)
            {
                if (!cm.SaveCurrent())
                {
                    return false;
                }
            }

            任务 entity = cm.DisplayManager.CurrentItem as 任务;
            switch (saveType)
            {
                case SaveType.正式备案确认:
                    任务Dao.生成任务号(entity);
                    break;
                case SaveType.拒绝确认:
                    entity.是否拒绝 = true;
                    entity.IsActive = false;
                    entity.任务号 = null;
                    break;
                default:
                    break;
            }

            bool ret;
            if (cm.State == StateType.Edit)
            {
                ret = cm.EndEdit(true);
            }
            else
            {
                try
                {
                    cm.Dao.Update(entity);
                    ret = true;
                }
                catch (Exception ex)
                {
                    ExceptionProcess.ProcessWithNotify(ex);
                    ret = false;
                }
            }

            return ret;
        }
Example #46
0
        /// <summary>
        /// Constructor to initialize save type and the user data object to edit
        /// </summary>
        public AddUser(SaveType eSaveType, ObjectUser.UserInstance objUser, bool EditCredentialsOnly)
        {
            this.Visible = false;
            InitializeComponent();
            m_objUser = objUser;
            m_eSaveType = eSaveType;

            if (EditCredentialsOnly)
            {
                txtFullname.Enabled = false;
                txtTitle.Enabled = false;
                cboManager.Enabled = false;
                txtSite.Enabled = false;
                txtPhone.Enabled = false;
                txtMobile.Enabled = false;
                txtEmail.Enabled = false;
                chkActive.Enabled = false;
            }

            this.Visible = true;
        }
Example #47
0
        /// <summary>
        ///     上传文件
        /// </summary>
        /// <param name="file">FileUpload</param>
        /// <param name="filePath">要保存的文件路径,</param>
        /// <param name="lstFileType">允许上传的文件类型,大小,单位为KB,Size=0表示无任何限制</param>
        /// <param name="saveType">保存方式:1:按时间取名</param>
        public stuUpLoadFile Upload(HttpPostedFile file, string filePath, SaveType saveType = SaveType.DateTime,List<stuUpLoadFileType> lstFileType = null)
        {
            string fileName;

            //获取保存为的文件名
            switch (saveType)
            {
                case SaveType.FileName:
                    {
                        fileName = Files.ConvertPath(file.FileName);
                        fileName = fileName.Substring(fileName.IndexOf('/') + 1);
                        break;
                    }
                default:
                    {
                        fileName = string.Format("{0}{1}{2}", DateTime.Now.ToString("yyyyMMddHHmmss"),
                                                 Rand.CreateRandomString(4), Path.GetExtension(file.FileName));
                        break;
                    }
            }
            return Upload(file, filePath, fileName, lstFileType);
        }
Example #48
0
        /// <summary>
        /// Creates the "ecd" formatted file.
        /// </summary>
        /// <param name="savedDirName">The saved directory name.</param>
        /// <param name="logData">The list of the "LogData"</param>
        /// <param name="saveType">The type of saved file.</param>
        /// <param name="startTime">The start time to save the log.</param>
        /// <param name="endTime">The end time to save the log.</param>
        public void Create(string savedDirName, LogData logData, SaveType saveType,
            double startTime, double endTime)
        {
            string fileName = null;
            string fileExtension = "";
            string splitter = "";

            if (saveType == SaveType.CSV)
            {
                fileExtension = ".csv";
                splitter = Constants.delimiterComma;
            }
            else
            {
                fileExtension = ".ecd";
                splitter = Constants.delimiterTab;
            }

            try
            {
                //
                // Initializes.
                //
                if (savedDirName == null || savedDirName.Length <= 0)
                {
                    return;
                }
                else if (logData == null)
                {
                    return;
                }

                //
                // Sets the file name.
                //
                fileName =
                    logData.type + Constants.delimiterUnderbar +
                    logData.key + Constants.delimiterUnderbar +
                    logData.propName;
                fileName = fileName.Replace(Constants.delimiterPath, Constants.delimiterUnderbar);
                fileName = fileName.Replace(Constants.delimiterColon, Constants.delimiterUnderbar);
                fileName = savedDirName + Constants.delimiterPath +
                    fileName + fileExtension;
                //
                // Checks the old model file.
                //
                if (File.Exists(fileName))
                {
                    string date
                        = File.GetLastAccessTime(fileName).ToString().Replace(
                            Constants.delimiterColon, Constants.delimiterUnderbar);
                    date = date.Replace(Constants.delimiterPath, Constants.delimiterUnderbar);
                    date = date.Replace(Constants.delimiterSpace, Constants.delimiterUnderbar);
                    string destFileName
                        = Path.GetDirectoryName(fileName) + Constants.delimiterPath
                        + Constants.delimiterUnderbar + date + Constants.delimiterUnderbar + Path.GetFileName(fileName);
                    File.Move(fileName, destFileName);
                }
                //
                // Saves the "LogData".
                //
                m_writer = new StreamWriter(
                        new FileStream(fileName, FileMode.CreateNew), System.Text.Encoding.UTF8);

                //
                // Writes the header.
                //
                if (saveType != SaveType.CSV)
                {
                    m_writer.WriteLine(
                        Constants.delimiterSharp + Constants.headerData + Constants.delimiterColon + Constants.delimiterSpace +
                        logData.type + Constants.delimiterColon +
                        logData.key + Constants.delimiterColon +
                        logData.propName
                        );
                    int headerColumn = 0;
                    if (Double.IsNaN(logData.logValueList[0].avg) &&
                        Double.IsNaN(logData.logValueList[0].min) &&
                        Double.IsNaN(logData.logValueList[0].max)
                        )
                    {
                        headerColumn = 2;
                    }
                    else
                    {
                        headerColumn = 5;
                    }
                    m_writer.WriteLine(
                    Constants.delimiterSharp + Constants.headerSize + Constants.delimiterColon + Constants.delimiterSpace +
                    headerColumn + Constants.delimiterSpace +
                    logData.logValueList.Count
                    );
                    m_writer.WriteLine(
                        Constants.delimiterSharp + Constants.headerLabel + Constants.delimiterColon + Constants.delimiterSpace +
                            Constants.headerTime + splitter +
                            Constants.headerValue + splitter +
                            Constants.headerAverage + splitter +
                            Constants.headerMinimum.ToLower() + splitter +
                            Constants.headerMaximum.ToLower()
                            );
                    m_writer.WriteLine(
                        Constants.delimiterSharp + Constants.headerNote + Constants.delimiterColon + Constants.delimiterSpace
                        );
                    m_writer.WriteLine(
                        Constants.delimiterSharp
                        );
                    string separator = "";
                    for (int i = 0; i < 22; i++)
                    {
                        separator += Constants.delimiterHyphen;
                    }
                    m_writer.WriteLine(
                        Constants.delimiterSharp + separator
                        );
                    m_writer.Flush();
                }
                //
                // Writes the "LogData".
                //
                foreach (LogValue logValue in logData.logValueList)
                {
                    if (m_oldTime == logValue.time)
                    {
                        continue;
                    }
                    double ltime;
                    double.TryParse(logValue.time.ToString(), out ltime);
                    if (startTime > ltime ||
                        endTime < ltime)
                        continue;
                    if (Double.IsNaN(logValue.avg) &&
                        Double.IsNaN(logValue.min) &&
                        Double.IsNaN(logValue.max)
                        )
                    {
                        m_writer.WriteLine(
                            logValue.time + splitter +
                            logValue.value
                            );
                    }
                    else
                    {
                        m_writer.WriteLine(
                            logValue.time + splitter +
                            logValue.value + splitter +
                            logValue.avg + splitter +
                            logValue.min + splitter +
                            logValue.max
                            );
                    }
                    m_oldTime = logValue.time;
                }
            }
            catch (Exception ex)
            {
                if (m_writer != null)
                {
                    m_writer.Close();
                    m_writer = null;

                }
                throw new EcellException(string.Format(MessageResources.ErrCreFile,
                    new object[] { fileName }), ex);
            }
        }
Example #49
0
 public virtual void SaveAs(WorldDraw mode, SaveType st)
 {
     createInstance();
     BaseEntity.SaveAs(mode,st);
     tr.Dispose();
 }
        private void Save(SaveType saveType)
        {
            // 验证控件有效值(有些控件需移出焦点后对其他控件产生影响,如果这里不Validate,会先执行Save)
            this.ValidateChildren();

            if (m_cm.SaveCurrent())
            {
                任务 entity = m_cm.DisplayManager.CurrentItem as 任务;

                switch (saveType)
                {
                    case SaveType.正式备案确认:
                        任务Dao.生成任务号(entity);
                        break;
                    case SaveType.拒绝确认:
                        entity.是否拒绝 = true;
                        entity.IsActive = false;
                        entity.任务号 = null;
                        break;
                    default:
                        break;
                }
                bool ret;
                if (m_cm.State == StateType.Edit)
                {
                    ret = m_cm.EndEdit(true);
                }
                else
                {
                    try
                    {
                        m_cm.Dao.Update(entity);
                        ret = true;
                    }
                    catch (Exception ex)
                    {
                        ExceptionProcess.ProcessWithNotify(ex);
                        ret = false;
                    }
                }

                if (m_cm.State == StateType.View)
                {
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    //ArchiveDetailForm.UpdateStatusDataControl(m_cm, m_gridName);
                }
            }
        }
Example #51
0
        private XmlNode _xmlnode = null; //��ǰ��_sworkUnitһ�µĽڵ�

        #endregion Fields

        #region Constructors

        // ͨ��workUnitName�õ����е�����Դdataitem,��ͨ��dataitem�鵽��Ӧ��sqltext,���õ�table
        // workUnitFileԭ���ڴ�ָ�����������ļ�������workitem.xml��Ŀǰworkitem.xml��hmsys���ݿ��������ˣ����Բ��ٿ���
        // ��ʱ��workUnitNameΪ��Ԫ���ƣ�ֻ����hmsys��unititem���ҵ�workUnitName���ϼ���,Ȼ����ȡ��workUnitName��Ԫ����������
        public UnitItem(string	workUnitFile,string	workUnitName)
        {
            if (workUnitName == "") return;
            this._unitFile = workUnitFile;
            CreateAppTable(workUnitFile,workUnitName);
            if (this.dtWorkUnit == null) return;

            DataRow[] _drnodes = this.dtWorkUnit.Select("ntype='UnitItem'");
             if (_drnodes.Length == 0) return;
             this._drnode = _drnodes[0];
            this.SetWorkUnit(workUnitName);

            this.WorkItemList		=	this.GetWorkItemList();
            this.CommandItemList	=	this.GetCommandItemList();
            this.AppendItemList		=	this.GetAppendItemList();
            this.UnitType			=	this.GetWorkUnitType();
            this.DataSrcFile		=	this.GetDataSrcFile();
            this.FileEditTp			=	this.GetFileEditTp();
            this.WorkFlow           =   this.GetWorkFlow();

            this.FilePrnTp          =   this.GetFilePrintTp();
            this.SaveOPType			=	this.GetSaveType();
            this.DictColSrcFile		=	this.GetDictColSrcFile();
            this.StFilter			=	this.GetShortcutFilter();
            this.treeFilter			=	this.GetTreeFilter();

            this.BillType			=	this.GetBillType();
            this.PrintType          =   this.GetPrnType();
            this.IsVisibleNav       =   this.GetVisibleNav();
        }
        private void Save(SaveType saveType)
        {
            // 验证控件有效值(有些控件需移出焦点后对其他控件产生影响,如果这里不Validate,会先执行Save)
            this.ValidateChildren();

            if (m_cm.SaveCurrent())
            {
                任务 entity = m_cm.DisplayManagerT.CurrentEntity;

                switch (saveType)
                {
                    case SaveType.暂存待确认:
                        任务Dao.生成预录入号(entity);
                        break;
                    case SaveType.预录入发送:
                        entity.IsActive = true;
                        entity.是否拒绝 = false;
                        任务Dao.生成预录入号(entity);
                        break;
                    default:
                        break;
                }
                m_cm.EndEdit(true);

                if (m_cm.State == StateType.View)
                {
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    //ArchiveDetailForm.UpdateStatusDataControl(m_cm, m_gridName);
                    //m_cm.DisplayManager.OnPositionChanged(System.EventArgs.Empty);
                }
            }
        }
Example #53
0
        private void InitializeForRoster()
        {
            SaveType = SaveType.Roster;
            mPlayerStart = 0xAFA8;
            mModifiableNameSectionEnd = 0x88d8f;
            mCollegePlayerNameSectionStart = 0x8b7d0;
            mCollegePlayerNameSectionEnd = 0x8f00f;
            mFreeAgentPlayersPointer = 0x7c;
            mFreeAgentCountLocation = 0x78; // default : 00 c5 // guess???
            m49ersPlayerPointersStart = 0x41c8; // playerLoc = ptrLoc + ptrVal -1;
            m49ersNumPlayersAddress = 0x42e4; // 35
            mMaxPlayers = 1943;

            Year = 0; //?? does a year apply to a roster at all???
            AutoPlayerStartLocation();
        }
Example #54
0
 public async override void GetImageByImageUrl(MangaPageItem pageItem, SaveType saveType = SaveType.Temp)
 {
     string imgUrl = pageItem.WebImageUrl;
     //Get Image 
     //To Do
     string fileRealPath = await DownloadImgPage(imgUrl, pageItem, saveType,WEBSITEURL);
     pageItem.SetImage(fileRealPath);
     return;
 }
Example #55
0
 private void Dump(SaveType dumpType)
 {
     SaveFileDialog fileDialog = new SaveFileDialog();
     if (DialogResult.OK == fileDialog.ShowDialog())
     {
         switch (dumpType)
         {
             case SaveType.Node:
                 Asn1.Encode(fileDialog.FileName, this.Asn1Node);
                 break;
             case SaveType.Data:
                 Asn1.EncodeData(fileDialog.FileName, this.Asn1Node);
                 break;
             case SaveType.Text:
                 Asn1.ExportText(fileDialog.FileName, this.Asn1Node);
                 break;
             default:
                 break;
         }
     }
 }
Example #56
0
        /// <summary>
        /// Save file.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public bool SaveDocument(SaveType type)
        {
            // Get the file name
            string newFileName = this.fileName;

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            saveFileDialog1.Filter = fileDlgFilter;

            if ((type == SaveType.SaveAs) ||
                Empty(newFileName))
            {

                if (!Empty(newFileName))
                {
                    saveFileDialog1.InitialDirectory = Path.GetDirectoryName(newFileName);
                    saveFileDialog1.FileName = Path.GetFileName(newFileName);
                }
                else
                {
                    saveFileDialog1.InitialDirectory = fileDlgInitDir;
                    saveFileDialog1.FileName = newDocName;
                }

                DialogResult res = saveFileDialog1.ShowDialog(frmOwner);

                if (res != DialogResult.OK)
                    return false;

                newFileName = saveFileDialog1.FileName;
                fileDlgInitDir = new FileInfo(newFileName).DirectoryName;
            }

            // Write the data
            try
            {
                using (Stream stream = new FileStream(
                           newFileName, FileMode.Create, FileAccess.Write))
                {
                    // Serialize object to text format
                    IFormatter formatter = new BinaryFormatter();

                    if (SaveEvent != null)        // if caller subscribed to this event
                    {
                        SerializationEventArgs args = new SerializationEventArgs(
                            formatter, stream, newFileName);

                        // raise event
                        SaveEvent(this, args);

                        if (args.Error)
                            return false;
                    }

                }
            }
            catch (ArgumentNullException ex) { return HandleSaveException(ex, newFileName); }
            catch (ArgumentOutOfRangeException ex) { return HandleSaveException(ex, newFileName); }
            catch (ArgumentException ex) { return HandleSaveException(ex, newFileName); }
            catch (SecurityException ex) { return HandleSaveException(ex, newFileName); }
            catch (FileNotFoundException ex) { return HandleSaveException(ex, newFileName); }
            catch (DirectoryNotFoundException ex) { return HandleSaveException(ex, newFileName); }
            catch (PathTooLongException ex) { return HandleSaveException(ex, newFileName); }
            catch (IOException ex) { return HandleSaveException(ex, newFileName); }

            // Clear the dirty bit, cache the new file name
            // and the caption is set automatically
            Dirty = false;
            SetFileName(newFileName);

            // Success
            return true;
        }
Example #57
0
 /// <summary>
 /// Constructor to initialize save type and the sub campaign data object to edit
 /// </summary>
 public AddSubCampaign(SaveType eSaveType, ObjectSubCampaign.SubCampaignInstance objSubCampaign)
 {
     InitializeComponent();
     m_objSubCampaign = objSubCampaign;
     m_eSaveType = eSaveType;
 }
        /// <summary>
        /// Save the imported XDocument to the file specified by the strings.
        /// The file saved with the extension as ".req".
        /// IMPORTANT: the file name will be processed by the macros if possible.
        /// </summary>
        /// <param name="checklistDocument">The XDocument parameter contain the checklist tree information</param>
        /// <param name="fullPath">The absolute path with extension specify the file to save the document</param>
        /// <param name="saveType">Save type, see BusinessLogic.SaveType</param>
        /// <returns>
        ///     ERROR_CODE_NONE if save successfull.
        ///     ERROR_CODE_FILE_EXISTS if the file already exists and saveType is SaveType.TRY.
        /// </returns>
        public int SaveChecklistFile(XDocument checklistDocument, string fullPath, SaveType saveType = SaveType.TRY)
        {
            bool isExportSuccessful = FileBusiness.XmlHandler.writeToFile(fullPath, checklistDocument, saveType == SaveType.OVERRIDE);
            if (!isExportSuccessful)
            {
                return Config.ERROR_CODE_FILE_NOT_EXISTS;
            }

            return Config.ERROR_CODE_NONE;
        }
Example #59
0
 /// <summary>
 /// Constructor to initialize save type and the customer data object to edit
 /// </summary>
 public AddCustomer(SaveType eSaveType, ObjectCustomer.CustomerInstance objCustomer)
 {
     InitializeComponent();
     m_objCustomer = objCustomer;
     m_eSaveType = eSaveType;
 }
Example #60
0
        /// <summary>
        /// Append the log data to the writer object.
        /// </summary>
        /// <param name="savedDirName">the save directory.</param>
        /// <param name="logData">the list of log data.</param>
        /// <param name="saveType">the save type.</param>
        /// <param name="startTime">the start time to save the log.</param>
        /// <param name="endTime">the end time to save the log.</param>
        public void Append(string savedDirName, LogData logData, SaveType saveType,
            double startTime, double endTime)
        {
            string fileName = null;
            string fileExtension = "";
            string splitter = "";

            if (saveType == SaveType.CSV)
            {
                fileExtension = ".csv";
                splitter = Constants.delimiterComma;
            }
            else
            {
                fileExtension = ".ecd";
                splitter = Constants.delimiterTab;
            }

            try
            {
                //
                // Initializes.
                //
                if (savedDirName == null || savedDirName.Length <= 0)
                {
                    return;
                }
                else if (logData == null)
                {
                    return;
                }

                //
                // Sets the file name.
                //
                fileName =
                    logData.type + Constants.delimiterUnderbar +
                    logData.key + Constants.delimiterUnderbar +
                    logData.propName;
                fileName = fileName.Replace(Constants.delimiterPath, Constants.delimiterUnderbar);
                fileName = fileName.Replace(Constants.delimiterColon, Constants.delimiterUnderbar);
                fileName = savedDirName + Constants.delimiterPath +
                    fileName + fileExtension;

                    //
                    // Writes the "LogData".
                    //
                    foreach (LogValue logValue in logData.logValueList)
                    {
                        if (m_oldTime == logValue.time)
                        {
                            continue;
                        }
                        double ltime;
                        double.TryParse(logValue.time.ToString(), out ltime);
                        if (startTime > ltime ||
                            endTime < ltime)
                            continue;
                        if (Double.IsNaN(logValue.avg) &&
                            Double.IsNaN(logValue.min) &&
                            Double.IsNaN(logValue.max)
                            )
                        {
                            m_writer.WriteLine(
                                logValue.time + splitter +
                                logValue.value
                                );
                        }
                        else
                        {
                            m_writer.WriteLine(
                                logValue.time + splitter +
                                logValue.value + splitter +
                                logValue.avg + splitter +
                                logValue.min + splitter +
                                logValue.max
                                );
                        }

                }
            }
            catch (Exception ex)
            {
                if (m_writer != null)
                {
                    m_writer.Close();
                    m_writer = null;
                }
                throw new EcellException(string.Format(MessageResources.ErrCreFile,
                    new object[] { fileName }), ex);
            }
        }