Exemple #1
0
 /// <summary>
 /// 讀取捷徑檔案
 /// </summary>
 /// <param name="FullLinkFileName">完整的捷徑檔案名稱</param>
 public void Load(string FullLinkFileName)
 {
     if (!File.Exists(FullLinkFileName))
     {
         throw new FileNotFoundException("File is not found.", FullLinkFileName);
     }
     PersistFile.Load(FullLinkFileName, STGM_READ);
 }
Exemple #2
0
 public void Load(string lnkPath)
 {
     this.ShortcutPath = lnkPath;
     if (File.Exists(lnkPath))
     {
         PersistFile.Load(lnkPath, STGM_READWRITE);
     }
 }
Exemple #3
0
 /// <summary>
 /// 儲存捷徑檔案
 /// </summary>
 /// <param name="FullLinkFileName">完整的捷徑檔案名稱</param>
 public void Save(string FullLinkFileName)
 {
     if (FullLinkFileName == null)
     {
         throw new ArgumentNullException("File name is required.");
     }
     PersistFile.Save(FullLinkFileName, true);
 }
Exemple #4
0
 /// <summary>
 /// 读取快捷方式档案
 /// </summary>
 /// <param name="linkPath">完整的快捷方式文件名称</param>
 public void Load(string linkPath)
 {
     if (!File.Exists(linkPath))
     {
         throw new FileNotFoundException("link file is not found.", linkPath);
     }
     PersistFile.Load(linkPath, STGM_READ);
 }
Exemple #5
0
 /// <summary>
 /// 储存快捷方式档案
 /// </summary>
 /// <param name="linkPath">完整的快捷方式文件名称</param>
 public void Save(string linkPath)
 {
     if (linkPath == null)
     {
         throw new ArgumentNullException("link path is required.");
     }
     PersistFile.Save(linkPath, true);
 }
Exemple #6
0
 // Load shortcut file.
 public void Load(string file)
 {
     if (!File.Exists(file))
     {
         throw new FileNotFoundException("File is not found.", file);
     }
     else
     {
         PersistFile.Load(file, STGM_READ);
     }
 }
Exemple #7
0
 public void Save(string file)
 {
     if (file == null)
     {
         throw new ArgumentNullException("File name is required.");
     }
     else
     {
         PersistFile.Save(file, true);
     }
 }
Exemple #8
0
 public void Save(string file)
 {
     if (file == null)
     {
         throw new ArgumentNullException(nameof(file));
     }
     else
     {
         PersistFile.Save(file, true);
     }
 }
    public void Read(TProtocol iprot)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            PersistFiles = new List <PersistFile>();
                            TList _list21 = iprot.ReadListBegin();
                            for (int _i22 = 0; _i22 < _list21.Count; ++_i22)
                            {
                                PersistFile _elem23;
                                _elem23 = new PersistFile();
                                _elem23.Read(iprot);
                                PersistFiles.Add(_elem23);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
 public void Load(string file, int flags)
 {
     if (!File.Exists(file))
     {
         throw new FileNotFoundException("File is not found.", file);
     }
     else
     {
         PersistFile.Load(file, flags);
         if ((flags & 0x0000000f) == 0)
         {
             readOnly = true;
         }
     }
 }
Exemple #11
0
 public void Save(string lnkPath)
 {
     PersistFile.Save(lnkPath, true);
 }