Skip to content

Commit

Permalink
Fix startup_ documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Jun 22, 2024
1 parent cfccdf2 commit a9c75be
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/documentation/Guides/Overview/Tutorials/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace example {
};
}

startup_(example::form1);
startup_(example::form1::main);
```
### Start position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## Examples: Use the directory_info class
Expand Down Expand Up @@ -86,7 +86,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

The following example uses the [directory_info::enumerate_files](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1directory__info.html#aae6b6e624c5ac50f1f7bb5ec8088114a) method to list all files whose [length](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1file__info.html#a7bbc1abbd603c19f70d687770961d195) exceeds 10MB.
Expand Down Expand Up @@ -145,7 +145,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "log.txt" and writes the following lines to it,
// or appends them to the existing "log.txt" file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "Test.data" and writes the integers 0 through 10 to it in binary format.
// It then writes the contents of Test.data to the console with each integer on a separate line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "write_lines.txt" with the following contents:
// First line
Expand Down Expand Up @@ -70,7 +70,7 @@ public:
}
};
startup_(program);
startup_(program::main);
// The example adds the following line to the contents of "write_lines.txt":
// Fourth Line
Expand Down Expand Up @@ -106,7 +106,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "write_file.txt" with the contents:
// First line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Behind this keyword there is a `main` global function that call `main` static me
## startup_ definition
```cpp
#define startup_(main_class) \
#define startup_(main_method) \
auto main(int argc, char* argv[]) -> int {\
return xtd::startup::safe_run(main_method, argc, argv);\
}\
Expand Down Expand Up @@ -305,7 +305,7 @@ namespace examples {
};
}
startup_(examples::program);
startup_(examples::program::main);
```

* Static `main` member function without argument and with int return value.
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/Guides/xtd.core/Events/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class program {
}
};
startup_(program);
startup_(program::main);
```

## Static and dynamic event handlers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace console_application1 {
};
}

startup_(console_application1::program);
startup_(console_application1::program::main);
```
## Example 2
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace console_application1 {
};
}
startup_(console_application1::program);
startup_(console_application1::program::main);
```

## Example 3
Expand Down Expand Up @@ -220,7 +220,7 @@ namespace console_application1 {
};
}

startup_(console_application1::program);
startup_(console_application1::program::main);
```
# See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public:
}
};

startup_(math_class);
startup_(math_class::main);

/* Output:
Invoking the delegate using 'multiply_numbers':
Expand Down Expand Up @@ -261,7 +261,7 @@ public:
}
};
startup_(test_sample_class);
startup_(test_sample_class::main);
/* Output:
A message from the instance method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
10 changes: 5 additions & 5 deletions docs/documentation/Guides/xtd.core/delegates_and_lambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
Expand Down Expand Up @@ -62,7 +62,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

The following example demonstrates the use of delegates with static method.
Expand Down Expand Up @@ -90,7 +90,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
* The `using reverse = delegate<ustring(const ustring& s)>;` line creates a delegate type of a certain signature, in this case a method that takes a string parameter and then returns a string parameter.
Expand Down Expand Up @@ -129,7 +129,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

For this simple example, having a method defined outside of the `main` method seems a bit superfluous. c++11 introduced the concept of [lambda expressions](https://en.cppreference.com/w/cpp/language/lambda), which let you create `inline` methods without having to specify any additional type or method.
Expand All @@ -155,7 +155,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
As you can see, the delegate body is just a set of expressions, like any other delegate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ private:
label label1;
};

startup_(form1);
startup_(form1::main);

// This example produces the following output display if you launch the application,
// then double-click the button1 and then close the application:
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/eBook/first_programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ start_position(xtd::forms::form_start_position::center_screen);
The method [start_position](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1forms_1_1form.html#aef5f579130f9834f4f35a85a94b0cf97) centers the [xtd::forms::form](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1forms_1_1form.html) on the screen, both horizontally and vertically.

```cpp
startup_(tutorial::simple);
startup_(tutorial::simple::main);
```
The code behind [startup_](https://gammasoft71.github.io/xtd/reference_guides/latest/group__keywords.html#ga44bd440a34d147923e428eacd1c8eedd) macro can be replaced by :
Expand Down

0 comments on commit a9c75be

Please sign in to comment.