예제 #1
0
        public IdRefTypeConverter(WarbendService warbend, Type baseType, string path)
        {
            this.warbend = warbend;
            BaseType     = baseType;
            Path         = path;

            standardValues = new Lazy <StandardValuesCollection>(() => {
                var resp = warbend.GetArrayInfoAsync(Path).GetAwaiter().GetResult();
                var size = resp.Value <int>("size");
                return(new StandardValuesCollection(Enumerable.Range(0, size).ToArray()));
            });
        }
예제 #2
0
        private Mutable(WarbendService warbend, Mutable parent, int index, string name, string path, string typeName, string label, int mutableCount)
        {
            this.warbend = warbend;
            Parent       = parent;
            Index        = index;
            Name         = name;
            Path         = path;
            TypeName     = typeName;
            Label        = label;
            MutableCount = mutableCount;
            IsArray      = typeName?.Contains("array(") == true;

            mutables[path] = new WeakReference(this);
            Invalidate();
        }
예제 #3
0
        public MainForm()
        {
            InitializeComponent();
            initialTitle = Text;

            buttonLoad.DefaultItem = buttonLoadBinary;
            buttonSave.DefaultItem = buttonSaveBinary;

            propertyGrid.MainForm        = this;
            propertyGrid.Selection       = selection;
            selection.CollectionChanged += Selection_CollectionChanged;

            openFileDialog.InitialDirectory = saveFileDialog.InitialDirectory = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                "Mount&Blade Warband Savegames");

            status   = new Progress <string>(StatusChanged);
            progress = new Progress <int>(ProgressChanged);
            warbend  = new WarbendService(status, progress);
            warbend.EnsureStarted();
            warbend.Console.VisibleChanged += Console_VisibleChanged;
        }
예제 #4
0
 public Mutable(WarbendService warbend)
     : this(warbend, null, 0, "game", "game", "game", null, 1)
 {
 }