Exemple #1
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a collaboration.";
     _id = command.Argument("collaborationId",
                            "ID of the collaboration");
     _path              = FilePathOption.ConfigureOption(command);
     _bulkPath          = BulkFilePathOption.ConfigureOption(command);
     _save              = SaveOption.ConfigureOption(command);
     _fileFormat        = FileFormatOption.ConfigureOption(command);
     _fieldsOption      = FieldsOption.ConfigureOption(command);
     _editor            = command.Option("--editor", "Set the role to editor.", CommandOptionType.NoValue);
     _viewer            = command.Option("--viewer", "Set the role to viewer.", CommandOptionType.NoValue);
     _previewer         = command.Option("--previewer", "Set the role to previewer.", CommandOptionType.NoValue);
     _uploader          = command.Option("--uploader", "Set the role to uploader.", CommandOptionType.NoValue);
     _previewerUploader = command.Option("--previewer-uploader", "Set the role to previewer uploader.", CommandOptionType.NoValue);
     _viewerUploader    = command.Option("--viewer-uploader", "Set the role to viewer uploader.", CommandOptionType.NoValue);
     _coowner           = command.Option("--co-owner", "Set the role to co-owner.", CommandOptionType.NoValue);
     _owner             = command.Option("--owner", "Set the role to owner.", CommandOptionType.NoValue);
     _role              = command.Option("-r|--role", "An option to manually enter the role", CommandOptionType.SingleValue);
     _status            = command.Option("--status", "Update the collaboration status", CommandOptionType.SingleValue);
     _canViewPath       = command.Option("--can-view-path", "Whether view path collaboration feature is enabled or not.", CommandOptionType.NoValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
Exemple #2
0
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            option_ = option as FileFormatOptionImpl;

            if (option_ == null)
            {
                return(false);
            }

            /* エンコーディング判定 */
            var encoding = Encoding.UTF8;

            switch (option_.CharCode)
            {
            case TextCharCode.UTF8:     encoding = Encoding.UTF8;             break;

            case TextCharCode.ShiftJIS: encoding = Encoding.GetEncoding(932); break;

            case TextCharCode.UnicodeB: encoding = Encoding.BigEndianUnicode; break;

            case TextCharCode.UnicodeL: encoding = Encoding.Unicode;          break;

            default:                    encoding = Encoding.UTF8;             break;
            }

            /* ファイル読み込み */
            reader_ = new StreamReader(stream, encoding);

            /* 状態初期化 */
            line_count_ = 0;

            return(true);
        }
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            writer_ = new BinaryWriter(stream);
            option_ = option as FileFormatWriterOptionImpl;

            return(true);
        }
Exemple #4
0
        private PacketLogWriter LoadOutputWriter()
        {
            if ((config_format_type_ != ConfigManager.System.AutoPacketSave.SaveFormat.Value) ||
                (output_format_ == null) ||
                (output_writer_ == null)
                )
            {
                config_format_type_ = ConfigManager.System.AutoPacketSave.SaveFormat.Value;

                switch (config_format_type_)
                {
                case AutoPacketSaveFormatType.Ratatoskr:
                    output_format_ = new FileFormat.PacketLog_Rtcap.FileFormatClassImpl();
                    break;

                case AutoPacketSaveFormatType.CSV:
                    output_format_ = new FileFormat.PacketLog_Csv.FileFormatClassImpl();
                    break;

                case AutoPacketSaveFormatType.Binary:
                    output_format_ = new FileFormat.PacketLog_Binary.FileFormatClassImpl();
                    break;
                }

                if (output_format_ != null)
                {
                    output_writer_ = output_format_.CreateWriter() as PacketLogWriter;
                    output_option_ = output_format_.CreateWriterOption();
                }
            }

            return(output_writer_);
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a folder.";
     _folderId           = command.Argument("folderId",
                                            "Id of folder to update");
     _bulkFilePath   = BulkFilePathOption.ConfigureOption(command);
     _filePath       = FilePathOption.ConfigureOption(command);
     _fileFormat     = FileFormatOption.ConfigureOption(command);
     _save           = SaveOption.ConfigureOption(command);
     _parentFolderId = command.Option("--parent-folder-id",
                                      "Id of new parent folder <ID>", CommandOptionType.SingleValue);
     _name = command.Option("--name",
                            "New name for folder <NAME>", CommandOptionType.SingleValue);
     _description = command.Option("--description",
                                   "New description for folder <DESCRIPTION>", CommandOptionType.SingleValue);
     _notSynced = command.Option("--not-synced",
                                 "Set sync state to not synced", CommandOptionType.NoValue);
     _partiallySynced = command.Option("--partially-synced",
                                       "Set sync state to partially synced", CommandOptionType.NoValue);
     _synced = command.Option("--synced",
                              "Set sync state to synced", CommandOptionType.NoValue);
     _access                = command.Option("--folder-upload-email-access <ACCESS>", "Upload email access level", CommandOptionType.SingleValue);
     _sharedLinkAccess      = command.Option("--shared-link-access <ACCESS>", "Shared link access level", CommandOptionType.SingleValue);
     _sharedLinkPassword    = command.Option("--shared-link-password <PASSWORD>", "Shared link password", CommandOptionType.SingleValue);
     _sharedLinkUnsharedAt  = command.Option("--shared-link-unshared-at <TIME>", "Time that this link will become disabled, use formatting like 03w for 3 weeks.", CommandOptionType.SingleValue);
     _sharedLinkCanDownload = command.Option("--shared-link-can-download", "Whether the shared link allows downloads", CommandOptionType.NoValue);
     _tags = command.Option("--tags <TAGS>", "Comma seperated tags", CommandOptionType.SingleValue);
     _etag = command.Option("--etag <ETAG>", "Only move if etag value matches", CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Create a collaboration for a Box item.";
            _path              = FilePathOption.ConfigureOption(command);
            _bulkPath          = BulkFilePathOption.ConfigureOption(command);
            _save              = SaveOption.ConfigureOption(command);
            _fileFormat        = FileFormatOption.ConfigureOption(command);
            _fieldsOption      = FieldsOption.ConfigureOption(command);
            _editor            = command.Option("--editor", "Set the role to editor.", CommandOptionType.NoValue);
            _viewer            = command.Option("--viewer", "Set the role to viewer.", CommandOptionType.NoValue);
            _previewer         = command.Option("--previewer", "Set the role to previewer.", CommandOptionType.NoValue);
            _uploader          = command.Option("--uploader", "Set the role to uploader.", CommandOptionType.NoValue);
            _previewerUploader = command.Option("--previewer-uploader", "Set the role to previewer uploader.", CommandOptionType.NoValue);
            _viewerUploader    = command.Option("--viewer-uploader", "Set the role to viewer uploader.", CommandOptionType.NoValue);
            _coowner           = command.Option("--co-owner", "Set the role to co-owner.", CommandOptionType.NoValue);
            _role              = command.Option("-r|--role", "An option to manually enter the role", CommandOptionType.SingleValue);
            _userId            = command.Option("--user-id", "Id for user to collaborate", CommandOptionType.SingleValue);
            _groupId           = command.Option("--group-id", "Id for group to collaborate", CommandOptionType.SingleValue);
            _login             = command.Option("--login", "Login for user to collaborate", CommandOptionType.SingleValue);
            _canViewPath       = command.Option("--can-view-path", "Whether view path collaboration feature is enabled or not.", CommandOptionType.NoValue);
            _idOnly            = IdOnlyOption.ConfigureOption(command);
            _id = command.Argument("boxItemId",
                                   "Id of the Box item");
            if (base._t == BoxType.enterprise)
            {
                _type = command.Argument("boxItemType", "Type of Box item");
            }

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
 protected override void OnBackupOption(FileFormatOption option)
 {
     if (option is FileFormatWriterOptionImpl option_i)
     {
         option_i.SaveData = (CBox_SaveDataType.SelectedItem as CBoxItem_SaveDataType).Value;
     }
 }
 protected override void OnLoadOption(FileFormatOption option)
 {
     if (option is FileFormatWriterOptionImpl option_i)
     {
         CBox_SaveDataType.SelectedItem = option_i.SaveData;
     }
 }
Exemple #9
0
 protected override void OnLoadOption(FileFormatOption option)
 {
     if (option is FileFormatReaderOptionImpl option_i)
     {
         TBox_PacketAlias.Text    = option_i.PacketAlias;
         Num_PacketDataSize.Value = option_i.PacketDataSize;
         Num_PacketInterval.Value = option_i.PacketInterval;
     }
 }
Exemple #10
0
 protected override void OnBackupOption(FileFormatOption option)
 {
     if (option is FileFormatReaderOptionImpl option_i)
     {
         option_i.PacketAlias    = TBox_PacketAlias.Text;
         option_i.PacketDataSize = (uint)Num_PacketDataSize.Value;
         option_i.PacketInterval = (uint)Num_PacketInterval.Value;
     }
 }
Exemple #11
0
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            reader_ = new BinaryReader(stream);
            option_ = option as FileFormatReaderOptionImpl;

            if (option_ == null)
            {
                return(false);
            }

            return(true);
        }
Exemple #12
0
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            reader_main_ = new BinaryReader(stream);

            /* パターンコードチェック */
            if (!ReadPatternCode(reader_main_))
            {
                return(false);
            }

            return(true);
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all pending collaborations for a user.";
     _save       = SaveOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            writer_ = new BinaryWriter(stream);

            /* パターンコード書込み */
            if (stream.Position == 0)
            {
                WritePatternCode(option, writer_);
            }

            return(true);
        }
Exemple #15
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all webhooks.";
     _save       = SaveOption.ConfigureOption(command);
     _path       = FilePathOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
Exemple #16
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Get all metadata templates in your Enterprise.";

            _save       = SaveOption.ConfigureOption(command);
            _fileFormat = FileFormatOption.ConfigureOption(command);
            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
Exemple #17
0
        public static void SavePacketLog(bool overwrite, bool rule)
        {
            if (InvokeRequired)
            {
                Invoke((SavePacketLogDelegate)SavePacketLog, overwrite, rule);
                return;
            }

            var file = (FileControlParam)null;

            /* 保存先とフォーマットを取得 */
            if ((overwrite) &&
                (last_save_path_ != null) &&
                (last_save_format_ != null)
                )
            {
                /* Save */
                file = new FileControlParam()
                {
                    FilePath = last_save_path_,
                    Format   = last_save_format_,
                    Option   = last_save_option_,
                };
            }
            else
            {
                /* Save As */
                file = FileManager.PacketLogSave.SelectWriteControllerFromDialog(ConfigManager.GetCurrentDirectory());
            }

            if (file == null)
            {
                return;
            }

            if (rule)
            {
                GatePacketManager.SavePacketFile(file, FormTaskManager.GetPacketConverterClone());
            }
            else
            {
                GatePacketManager.SavePacketFile(file, null);
            }

            last_save_path_   = file.FilePath;
            last_save_format_ = file.Format;
            last_save_option_ = file.Option;

            /* カレントディレクトリ更新 */
            ConfigManager.SetCurrentDirectory(Path.GetDirectoryName(last_save_path_));
        }
Exemple #18
0
        protected override bool OnOpenPath(FileFormatOption option, string path, bool is_append)
        {
            try {
                pcap_device_ = new CaptureFileWriterDevice(
                    LinkLayers.Ethernet,
                    null,
                    path,
                    (is_append) ? (FileMode.Append) : (FileMode.Create));

                return(true);
            } catch {
                return(false);
            }
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all collaborations on a Box item.";
     _id = command.Argument("boxItemId",
                            "Id of the Box item");
     _save       = SaveOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
Exemple #20
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all tasks on this file.";
     _fileId             = command.Argument("fileId",
                                            "Id of file on which to retrieve tasks");
     _save       = SaveOption.ConfigureOption(command);
     _path       = FilePathOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List items in a folder.";
     _folderId           = command.Argument("folderId",
                                            "Id of folder to manage, use '0' for the root folder");
     _save       = SaveOption.ConfigureOption(command);
     _path       = FilePathOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "List all task assignments on a task.";
            _taskId             = command.Argument("taskId",
                                                   "Id of task");
            _save       = SaveOption.ConfigureOption(command);
            _path       = FilePathOption.ConfigureOption(command);
            _fileFormat = FileFormatOption.ConfigureOption(command);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all collaborations for a group.";
     _save       = SaveOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     _id         = command.Argument("groupId",
                                    "Id of the group");
     _limit        = LimitOption.ConfigureOption(command);
     _fieldsOption = FieldsOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
Exemple #24
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Get events.";
            _enterprise = command.Option("-e|--enterprise", "Get enterprise events", CommandOptionType.NoValue);
            _createdBefore = command.Option("--created-before", "Return enterprise events that occured before a time. Use a timestamp or shorthand syntax 00t, like 05w for 5 weeks. If not used, defaults to now.", CommandOptionType.SingleValue);
            _createdAfter = command.Option("--created-after", "Return enterprise events that occured before a time. Use a timestamp or shorthand syntax 00t, like 05w for 5 weeks. If not used, defaults to 5 days ago.", CommandOptionType.SingleValue);
            _save = SaveOption.ConfigureOption(command);
            _path = FilePathOption.ConfigureOption(command);
            _fileFormat = FileFormatOption.ConfigureOption(command);

            command.OnExecute(async () =>
            {
                return await this.Execute();
            });
            base.Configure(command);
        }
Exemple #25
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List all Box users.";
     _managedUsers       = ManagedUsersOnlyOption.ConfigureOption(command);
     _appUsers           = AppUsersOnlyOption.ConfigureOption(command);
     _save         = SaveOption.ConfigureOption(command);
     _path         = FilePathOption.ConfigureOption(command);
     _fileFormat   = FileFormatOption.ConfigureOption(command);
     _fieldsOption = FieldsOption.ConfigureOption(command);
     _limit        = LimitOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
Exemple #26
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Create a new folder";
     _bulkPath           = BulkFilePathOption.ConfigureOption(command);
     _filePath           = FilePathOption.ConfigureOption(command);
     _fileFormat         = FileFormatOption.ConfigureOption(command);
     _save           = SaveOption.ConfigureOption(command);
     _idOnly         = IdOnlyOption.ConfigureOption(command);
     _parentFolderId = command.Argument("parentFolderId",
                                        "Id of parent folder to add new folder to, use '0' for the root folder");
     _name = command.Argument("name", "Name of new folder");
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
        protected override bool OnOpenStream(FileFormatOption option, Stream stream)
        {
            option_ = option as UserConfigWriterOption;
            if (option_ == null)
            {
                option_ = new UserConfigWriterOption();
            }

            /* プロファイルが存在しないときは失敗 */
            if (!ConfigManager.ProfileIsExist(option_.TargetProfileID))
            {
                return(false);
            }

            writer_ = new BinaryWriter(stream);

            return(true);
        }
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Assign a storage policy to a user.";
            _policyId           = command.Argument("storagePolicyId",
                                                   "Id of the storage policy");
            _userId = command.Argument("userId",
                                       "Id of the user to assign the policy to");

            _bulkPath   = BulkFilePathOption.ConfigureOption(command);
            _save       = SaveOption.ConfigureOption(command);
            _fileFormat = FileFormatOption.ConfigureOption(command);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
Exemple #29
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Update a user's membership to a group.";
            _bulkPath           = BulkFilePathOption.ConfigureOption(command);
            _save         = SaveOption.ConfigureOption(command);
            _fileFormat   = FileFormatOption.ConfigureOption(command);
            _membershipId = command.Argument("membershipId",
                                             "Id of group membership");
            _admin = command.Option("--set-admin",
                                    "Set the user's role to Group Admin", CommandOptionType.NoValue);
            _member = command.Option("--set-member",
                                     "Set the user's role to Group Member", CommandOptionType.NoValue);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
Exemple #30
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "List members in a group, groups a user belongs to, or collaborations for a group. Lists members in a group by default.";
     _id = command.Argument("id",
                            "Id of group or user");
     _listMembers = command.Option("--list-members",
                                   "List members of a group with a group ID", CommandOptionType.NoValue);
     _listGroups = command.Option("--list-groups",
                                  "List groups a user belongs to with a user ID", CommandOptionType.NoValue);
     _listCollab = command.Option("--list-collaborations",
                                  "List collaborations for a group with a group ID", CommandOptionType.NoValue);
     _save       = SaveOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }